Lecture 3 Number Systems
Lecture 3 Number Systems
Number Systems
1
COUNTING AND ARITHMETIC
Decimal or base 10 number system
Origin: counting on the fingers
“Digit” from the Latin word digitus meaning “finger”
2
WHY BINARY?
Early computer design was decimal
Mark I and ENIAC
3
KEEPING TRACK OF THE BITS
Bits commonly stored and manipulated in groups
8 bits = 1 byte
4 bytes = 1 word (in many systems –32 bit word size)
4
NUMBERS: PHYSICAL REPRESENTATION
Consider you want to represent value “5”.
Different numerals and number systems
Roman:V
Arabic: 5
5
NUMBERS
Example 52710
6
NUMBERS
Example 6248
7
NUMBERS
Example 1011112
8
CONVERSION BETWEEN DIFFERENT BASES
Convert from Base 10 to Other Bases:
Base 10 to Base 2
Base 10 to Base 8
Base 10 to Base 16
9
CONVERSION BETWEEN DIFFERENT BASES
Convert Between Different Bases
If not base 10
Convert to decimal
Convert back to needed base
If base 10
Conversion in previous step
10
BASE OR RADIX
Base: The number of different symbols required to represent any
given number
For a given number, the larger the base the more symbols required,
but the fewer digits needed
6516 to base 10 =10110
6516 to base 8 =1458
6516 to base 2 =11001012
11
BINARY ADDITION AND BOOLEAN LOGIC
Adds two one-bit binary numbers (A and B)
The output is the sum of the two bits (S) and the carry (C)
12
BINARY ADDITION AND BOOLEAN LOGIC
Half Adder
13
BINARY ADDITION AND BOOLEAN LOGIC
14
BINARY MULTIPLICATION
15
BINARY MULTIPLICATION
Example
16
BINARY MULTIPLICATION
Multiply the multiplicand by one bit of the multiplier at a time
17
1s & 2S COMPLEMENT
1’s complement:
Another binary number obtained by toggling all bits in it.
2’s complement:
1 added to the 1’s complement of the binary number.
18
Negative Numbers
Use a sign bit
0 for positive, 1 for negative
11111011 = -128 + 64 + 32 + 16 + 8 + 0 + 2 + 1 = -5
19
Fractions
Example: 0.258910
20
Fractions
A fractional number that can be represented exactly in one
number base may be impossible to be exactly represented in
another base
0.110 in binary?
=0.00011001100112 . . .
0.3333310 … in base 3?
=0.13
21
THANK YOU
22