CC442 Ch02 Number Systems
CC442 Ch02 Number Systems
Number Systems,
Operations, and Codes
1
Decimal Numbering System
The decimal numbering system has 10 digits 0 through 9
….105 104 103 102 101 100. 10-1 10-2 10-3 10-4 10-5…
2
Binary Numbers
The binary numbering system has 2 digits 0 and 1
3
Table 2--1
4
Decimal-to-Binary Conversion
Sum-of-weight method
Binary weights
256 128 64 32 16 8 4 2 1
357 = 256 + 64 + 32 + 4 + 1 101100101
Binary weights
1024 512 256 128 64 32 16 8 4 2 1
1937 = 1024 + 512 + 256 + 128 + 16 + 1 11110010001
5
Repeated division-by-2 method
6
Converting Decimal fractions to Binary
Using Sum-of-weights
Binary weights
64 32 16 8 4 2 1 .5 .25 .125 .0625
95.6875 = 64 + 16 + 8 + 4 + 2 + 1 + .5 + .125 + .0625
1011111.1011
Repeated division by 2 yields the whole number while
repeated multiplication by 2 of the fraction yields the
binary fraction
7
Binary Addition
0+0=0 11001
0+1=1 +1101
1+0=1 100110
1 + 1 = 10
8
Binary Subtraction
0-0=0
1-1=0
1-0=1
10 -1 = 1 0 -1 with a borrow of 1
1011
-111
100
9
Binary Multiplication
00=0
01=0
10=0 100110
11=1 101
100110
000000
100110
10111110
10
Binary Division
Use the same procedure as decimal division
11
Hexadecimal Numbers
12
Binary-to-Hexadecimal Conversion
13
Hexadecimal-to-Binary Conversion
14
Hexadecimal-to-Decimal Conversion
15
16
Decimal-to-Hexadecimal Conversion
17
Binary Coded Decimal (BCD)
18
19
Digital Codes and Parity
20
• ASCII (American Standard Code for Information Interchange)
21
Parity Method for Error Detection
22
23
Digital System Application
25
Figure 2--10 The system has just counted its fifty-first bottle of tablets.
26