Académique Documents
Professionnel Documents
Culture Documents
Why Binary?
Early computer design was decimal
Mark I and ENIAC
Natural relationship between on/off switches and calculation using Boolean logic
Chapter 2 Number Systems
On True Yes 1
Off False No 0
2-2
Base: the number of different digits including zero in the number system
Example: Base 10 has 10 digits, 0 through 9
Binary or base 2 Bit (binary digit): 2 digits, 0 and 1 Octal or base 8: 8 digits, 0 through 7 Hexadecimal or base 16: 16 digits, 0 through F
Examples: 1010 = A16; 1110 = B16
2-3
Number System
Roman: position independent Modern: based on positional notation (place value)
Decimal system: system of positional notation based on powers of 10. Binary system: system of positional notation based powers of 2 Octal system: system of positional notation based on powers of 8 Hexadecimal system: system of positional notation based powers of 16
Chapter 2 Number Systems 2-5
101 10 4 x 10
100 1 3 x1
Sum
40
2-6
101 10 2 x 10 20
100 1 7 x1 7
2-7
82 64 6 x 64
81 8 2x8
80 1 4x1
384
16
2-8
161 16 0 x 16
160 1 4x1
24,576
1,792
2-9
1 x 128 1 x 64 0 x 32 128 64 0
2-10
1 x 128 1 x 64 128 64
2-11
1
4 8
0+
1+ 2+
2 (0 and 1)
16 (0 to 15) 256
10
16 20 32 64 128
Chapter 2 Number Systems
3
4+ 6 9+ 19+ 38+
1,024 (1K)
65,536 (64K) 1,048,576 (1M) 4,294,967,296 (4G) Approx. 1.6 x 1019 Approx. 2.6 x 1038
2-13
Base or Radix
Base:
The number of different symbols required to represent any given number
2-14
Example #1:
6516 10110 1458 110 01012 1 0001 11002
Example #2:
11C16 28410 4348
2-15
Counting in Base 2
Binary Number 0 1 10 11 100 101 110 111 1000 1001 1010 1 x 23 1 x 23 1 x 23 1 x 21 1 x 20 1 x 22 1 x 22 1 x 22 1 x 22 1 x 21 1 x 21 1 x 20 1 x 20 1 x 21 1 x 21 Equivalent 8s (23) 4s (22) 2s (21) 1s (20) 0 x 20 1 x 20 0 x 20 1 x 20 Decimal Number 0 1 2 3 4 5 6 7 8 9 10
2-16
Addition
Base Decimal Problem 6 +3 6 +1 6 +9 1 +0 Largest Single Digit 9
7 F 1
2-17
Binary Arithmetic
1 1 1 1 1
1 + 1 0
1 0
0 1 0
1 0 0
1 1 0
0 1 1
1 0 1
2-18
Binary Arithmetic
Addition Multiplication
+
0 1
0
0 1 0 0 1 0 0
1
1 10 1 0 1
2-19
Output is 1 only if either input, but not both inputs, is a 1 Output is 1 if and only both inputs are a 1
+ 1
0 1 0
1 0 0
1 1 0
0 1 1
1 0 1
2-20
Binary Multiplication
Boolean logic without performing arithmetic
Shift
Shifting a number in any base left one digit multiplies its value by the base Shifting a number in any base right one digit divides its value by the base Examples:
Binary Multiplication
1 1 1 1 1 0 0 0 0 1 1 1 1s place
2s place
1
1 0
1
0
0 1
0 0 0
1 Result (AND)
2-22
Binary Multiplication
1 1 0 1 1 0 1
x
1 1 1 1 1 0 1 0 0 0 1 1 0 0 1 0 0 0
1
0 1 1 1
0
1 1
0 1
1 0 0 1
1
1
0
2s place (bits shifted to line up with 2s place of multiplier) 4s place 32s place
1 1
0 Result (AND)
Note the 0 at the end, since the 1s place is not brought down.
2-23
8
16
65,536 4,096
2-24
2-25
2 ) 21 ( 1 2 ) 10 ( 0
2) 2) 2) Base 2
Chapter 2 Number Systems
16
65,536
4,096 1
16 6 103 /16 =6
1 7 7
Integer Remainder
5,735 /4,096 =1
2-27
16 ) 16 ) 16 ) 16 ) Base 16
Chapter 2 Number Systems
16 ) 16 ) 16 ) 16 ) Base 16
Chapter 2 Number Systems
82 64 x2 128
81 8 x6 48
80 1 x3 3
3,584
2-30
58 x8 464 + 6 =
Base 16
F 1111
6 0110
7 0111
Base 2 0001
Why hexadecimal?
Modern computer operating systems and networks present variety of troubleshooting data in hex format
2-32
2-33