Binary Coding
1. Binary Coded Decimal (BCD)
Binary coded decimal (BCD) is a way to express each of the decimal digits with a binary code. There
are only ten code groups in the BCD system, so it is very easy to convert between decimal and BCD.
Because welike to read and write in decimal, the BCD code provides an excellent interface to binary
systems. Examples of such interfaces are keypad inputs and digital readouts.
The 8421 Code:
The 8421 code is a type of BCD (binary coded decimal) code. Binary coded decimal means that each
decimal digit, 0 through 9, is represented by a binary code of four bits.
The designation 8421indicates the binary weights of the four bits 23, 22, 21, 20. The ease of
conversion between 8421 code numbers and the familiar decimal numbers is the main advantage of
this code. All wehave to remember are the ten binary combinations that represent the ten decimal
digits as shown in Table 1. The 8421 code is the predominant BCD code, and when we refer to BCD,
we always mean the 8421 code unless otherwise stated.
Decimal to BCD conversion
Decimal Digit Binary Coded Decimal (BCD)
0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001
10 0001 0000
11 0001 0001
12 0001 0010
13 0001 0011
2. Excess-3 code
This is an unweighted code. Its code assignment is obtained from the corresponding value of BCD
after the addition of 3. It has been used in some old computers. Table 2 represents excess-3 code for
corresponding decimal digits.
3. 8,4, -2, -1code
Negative weights can be assigned to decimal digits as shown in Table 2 by 8, 4, -2, -1. In this case
the bit combination 0110 is interpreted as the decimal digit 2, as obtained from
8x0 + 4x1+ (-2)x1 + (-1)x0 = 2.
4. 2, 4, 2, 1 code
This one is another weighted code shown in Table 2 corresponding to the decimal digit. Inthis case
the bit combination 1011is interpreted as the decimal digit 5, as obtained from
2x1 + 4x0+ 2x1 + 1x1 = 5.
5. Biquinary code
The weights in the biquinary code are 5, 0, 4, 3, 2, 1, 0. The biquinary code is an example of a seven-bit code with error detection properties. Each decimal digit consists of five 0’s and two 1’s placed in
the corresponding weighted column. During transmission of signals from one location to another, an
error may occur. One or more bits may change value. A circuit in the receiving side can detect the
presence of more (or less) than two 1’s and if the received combination of bits does not agree with the
allowable combination, an error is detected.Biquinary code is presented in Table 2.
1. Binary Coded Decimal (BCD)
Binary coded decimal (BCD) is a way to express each of the decimal digits with a binary code. There
are only ten code groups in the BCD system, so it is very easy to convert between decimal and BCD.
Because welike to read and write in decimal, the BCD code provides an excellent interface to binary
systems. Examples of such interfaces are keypad inputs and digital readouts.
The 8421 Code:
The 8421 code is a type of BCD (binary coded decimal) code. Binary coded decimal means that each
decimal digit, 0 through 9, is represented by a binary code of four bits.
The designation 8421indicates the binary weights of the four bits 23, 22, 21, 20. The ease of
conversion between 8421 code numbers and the familiar decimal numbers is the main advantage of
this code. All wehave to remember are the ten binary combinations that represent the ten decimal
digits as shown in Table 1. The 8421 code is the predominant BCD code, and when we refer to BCD,
we always mean the 8421 code unless otherwise stated.
Decimal to BCD conversion
Decimal Digit Binary Coded Decimal (BCD)
0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001
10 0001 0000
11 0001 0001
12 0001 0010
13 0001 0011
2. Excess-3 code
This is an unweighted code. Its code assignment is obtained from the corresponding value of BCD
after the addition of 3. It has been used in some old computers. Table 2 represents excess-3 code for
corresponding decimal digits.
3. 8,4, -2, -1code
Negative weights can be assigned to decimal digits as shown in Table 2 by 8, 4, -2, -1. In this case
the bit combination 0110 is interpreted as the decimal digit 2, as obtained from
8x0 + 4x1+ (-2)x1 + (-1)x0 = 2.
4. 2, 4, 2, 1 code
This one is another weighted code shown in Table 2 corresponding to the decimal digit. Inthis case
the bit combination 1011is interpreted as the decimal digit 5, as obtained from
2x1 + 4x0+ 2x1 + 1x1 = 5.
5. Biquinary code
The weights in the biquinary code are 5, 0, 4, 3, 2, 1, 0. The biquinary code is an example of a seven-bit code with error detection properties. Each decimal digit consists of five 0’s and two 1’s placed in
the corresponding weighted column. During transmission of signals from one location to another, an
error may occur. One or more bits may change value. A circuit in the receiving side can detect the
presence of more (or less) than two 1’s and if the received combination of bits does not agree with the
allowable combination, an error is detected.Biquinary code is presented in Table 2.
Comments
Post a Comment