I-42 Computer Fundamentals
10. What are the disadvantages of using BCD code? How do we remove this problem? Is BCD
code weighted code? If yes, then explain.
Ans: The disadvantages of using BCD code are as follows:
• This coding is not sufficient for business purposes, as a 4-bit BCD code can represent only 16 (that is,
2
4
) symbols, even a 6-bit BCD code can also represent only 64 (that is, 2
6
) symbols.
• The BCD representation of a decimal number requires more bits than its equivalent binary
representation. For example, the BCD code of decimal number 215 is 0010 0001 0101 (requires12
bits), while its binary equivalent is 1101 0111 (requires 8 bits). In general, a decimal number with
k digits requires 4k bits in BCD.
• Computers using BCD codes could work only with upper case letters and 0 to 9 numbers and a
few characters. This is not sufficient for providing decimal numbers (10), lowercase letters (26),
uppercase letters (26) and a large number of other special characters (28+).
To remove above problems, the BCD code was extended from a 6-bit code to an 8-bit code, which comes
to known as Extended Binary Coded Decimal Interchange Code (EBCDIC). The added 2 bits are used
as additional zone bits, expanding the zone to 4 bits. Thus, it is possible to represent 256 (2
8
) different
characters instead of 64 (2
6
) by making use of EBCDIC.
Yes, BCD code is a weighted code, as it is possible to assign weights to the binary bits according to
their positions. The weights in the 4-bit BCD code are 8(2
3
), 4(2
2
), 2(2
1
) and 1(2
0
).
11. How do we convert binary numbers into gray codes?
Ans: A binary number is converted to its equivalent gray code by performing the following steps.
1. Take the MSB of the binary code as the MSB of the gray code word.
2. Starting from left to right, add each adjacent pair of bits in the binary code to get the next gray code
bit, while ignoring the carries.
For example, consider a binary number 10100111 that is to be converted to its equivalent gray code. The
required conversion is illustrated as follows.
Gray code
1 1 1 1 1
0 0 0
Thus, the required gray code is 11110100.
12. Convert the following:
(a) (0.4375)
10
to ( )
2
(b) (2AD)
16
to ( )
2
(c) (11100111101)
2
to ( )
16
(d) (1110101101)
2
to ( )
10
(e) (A2B.D8)
16
to ( )
10
Ans: (a) To convert (0.4375)
10
into binary form, multiply the fraction part (0.4375) by 2. Then, sepa-
rate the integer and fraction parts of the result. Repeat the above steps until the fraction part becomes
zero. Finally, write the integer parts (in downward direction) to form the binary equivalent of given
number. The conversion of (0.4375)
10
to binary is shown here.
M02_ITL-ESL4791_01_SE_C02.indd 42 12/22/2012 4:52:57 PM