Number Systems
Chapt. 2
Common Number Systems
System
Base Symbols b l
Used by humans? Used in computers? Decimal
10
0, 1, … 9
Yes
No
Binary
2
0, 1
No
Yes
Octal
8
0, 1, … 7
No
No
Hexadecimal
16
0, 1, … 9,
, ,
,
A, B, … F
No
No
1
6/28/2012
Quantities/Counting (1 of 3)
Decimal
0
1
2
3
4
5
6
7
Binary
0
1
10
11
100
101
110
111
HexaOctal decimal
0
0
1
1
2
2
3
3
4
4
5
5
6
6
7
7
p. 33
Quantities/Counting (2 of 3)
Decimal
8
9
10
11
12
13
14
15
Binary
1000
1001
1010
1011
1100
1101
1110
1111
Hexadecimal
Octal
10
8
11
9
12
A
13
B
14
C
15
16
17
D
E
F
2
6/28/2012
Quantities/Counting (3 of 3)
Decimal
16
17
18
19
20
21
22
23
Binary
10000
10001
10010
10011
10100
10101
10110
10111
HexaOctal decimal
20
10
21
11
22
12
23
13
24
14
25
15
26
16
27
17
Etc.
Conversion Among Bases
• The possibilities:
Decimal
Octal
Binary
Hexadecimal pp. 40-46
3
6/28/2012
Quick Example
2510 = 110012 = 318 = 1916
Base
Decimal to Decimal (just for fun)
Decimal
Octal
Binary
Hexadecimal
Next slide…
4
6/28/2012
Weight
12510 =>
5 x 100
2 x 101
1 x 102
=
5
= 20
= 100
125
Base
Binary to Decimal
Decimal
Octal
Binary
Hexadecimal
5
6/28/2012
Binary to Decimal
• Technique
– Multiply each bit by 2n, where n is the “weight” of the bit
– The weight is the position of the bit, starting from
0 on the right
– Add the results
Example
Bit “0”
1010112 =>
1
1
0
1
0
1
x x x x x x 20
21
22
23
24
25
=
=
=
=
=
=
1
2
0
8
0
32
4310
6
6/28/2012
Octal to Decimal
Decimal
Octal
Binary
Hexadecimal
Octal to Decimal
• Technique
– Multiply each bit by 8n, where n is the “weight” of the bit
– The weight is the position of the