How To Convert Binary Code To Bcd And Vise Versa?

Thread Starter

transgalactic

Joined Apr 29, 2008
74
i know that BCD is a sub group of binary numbers from 0-9

so i dont know how to convert 1111 to BCD code (its impossible)
or 0011 to BCD (it stays the same)

??????????????
 

Caveman

Joined Apr 15, 2008
471
BCD is just a method of using 4-bit values to represent a digit of a decimal number. The 4-digit codes, 1010,1011,1100,1101, and 1111 are invalid because they would translate to 10-15, which are not decimal numbers.

You can see that BCD is more inefficient that binary, but easier to directly read.

1111 is invalid as a BCD number directly, but as binary it is equal to decimal 15, which will require two BCD digits 0001 and 0101.
 
Top