Q. Show Binary Coded Decimal Number System?
If we analysis single digit values for hex, the numbers 0 - F, they represent the values 0 - 15 in decimal, and occupy a nibble. Frequently, we wish to use a binary equivalent of the decimal system.
This system is called as BCD or Binary Coded Decimal which also occupies a nibble. In Binary Coded Decimal, the binary patterns 1010 through 1111 do not represent valid BCD numbers, and cannot be used.
Conversion from Decimal to Binary Coded Decimal (BCD) is straightforward. You simply assign each digit of the decimal number to a byte and convert 0 through 9 to 0000 0000 through 0000 1001, but you can't perform the repeated division by 2 as you did to convert decimal to binary.
Lets us see how this works. Determine the Binary Coded Decimal or BCD value for the decimal number 5,319. Ever since there are four digits in our decimal number, there are four bytes in our BCD number. They are as
Thousands
|
Hundreds
|
Tens
|
Units
|
5
|
3
|
1
|
9
|
0 0 0 0 0 1 0 1
|
0 0 0 0 0 0 1 1
|
0 0 0 0 0 0 0 1
|
0 0 0 0 1 0 0 1
|
Ever since computer storage requires the minimum of 1 byte, you can see that the upper nibble of each BCD or Binary Coded Decimal number is wasted storage. Binary Coded Decimal is still a weighted position number system so you may perform mathematics, but we must use special techniques in order to obtain a correct answer.
(BCD) Binary Coded decimal is a variation on binary code in which each digit of a base-10 (decimal) number is represented by its 4-digit binary code. Therefore, to represent the number 5739 in BCD, we take each digit separately and write down its binary representation with 4 -digits:
5 - binary 0101
7 - binary 0111
3 - binary 0011
9 - binary 1001
The Binary Coded Decimal representation of 5739 is therefore 0101 0111 0011 1001
Binary Coded Decimal is not a particularly efficient code as in pure binary 4-bits can represent 16 different numbers but in Binary Coded Decimal 4-bits are used to represent only 10 numbers.