文档介绍:Digital concept and Number system
Chapter 1
Binary Codes
Shall pare thee to a summer’s day?
group of four binary digits represent a single decimal digit
0 1 2 3 4 5 6 7 8 9
0000 0001 0010 0011 0100 0101 0110 0111 1000 1001
Decimal BCD
Natural Binary Coded Decimal (BCD)
0 1 2 3 4 5 6 7 8 9
0000 0001 0010 0011 0100 0101 0110 0111 1000 1001
Decimal 8421 2421 Ex-3
0000 0001 0010 0011 0100 1011 1100 1101 1110 1111
0011 0100 0101 0110 0111 1000 1001 1010 1011 1100
Assign fixed weight for each bit position
Weighted Binary Coded Decimal
plements
A plement of a binary digit is its opposite value.
The plement of 0 is 1 and the plement of 1 is 0.
Ex. plement of (0011)2 is 1100.
BCD plementing codes
*b is the radix of the numeral x
Two plements
plement of x is written x’
X’= (b) – X
diminish plement of x is written x-1’
X-1’= (b - 1) – X
plement (plement) of 610
10-6=410
plement ( Diminish plement ) of 610
10-1-6=310
1
0,
0
1
BCD plementing codes
BCD plement are designed so the arithmetic plement can be found by taking the plement ,a bit-by-bit inversion of BCD code
plementing code is a code whose arithmetic and plement are the same.
0 1 2 3 4 5 6 7 8 9
Decimal 2421 Ex-3
0000 0001 0010 0011 0100 1011 1100 1101 1110 1111
0011 0100 0101 0110 0111 1000 1001 1010 1011 1100
BCD plementing codes
Diminish plement
X=610
X-1’= 10-1-6=310
6ex-3 = 1001
plement of 6ex-3 is 0110.
3ex-3 = 0110
Only one bit change occurs between essive value in this code
Gray code
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111
Decimal binary Gray
0000 0001 0011 0010 0110 0111 0101 0100 1100 1101 1111 1110 1010 1011 1001 1000
B =Bn-1Bn-2…Bi+1Bi…B1B0
G =Gn-1Gn-2…Gi+1Gi…G1G0
Bn-1=Gn-1 ; Gi=Bi+1⊕Bi
Gn-1= Bn-1; Bi=Gi⊕Bi+1
Unit Distance Code
Alphanumeric code
Alphabet /Punctuation
7-bit/8-bit ASCII code
American standard code for information interchange (ASCII)
Use the most significant