# How To Convert Binary Code To Bcd And Vise Versa?

#### transgalactic

Joined Apr 29, 2008
74
??????????????????????

#### mik3

Joined Feb 4, 2008
4,843
??????????????????????

#### techroomt

Joined May 19, 2004
198
you need to first understand "binary" and "binary coded decimal". when you do it is easy. read up on both.

#### 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)

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

#### mrmount

Joined Dec 5, 2007
59
I suppose you have to convert binary to decimal and then convert it to BCD. So 1111 would become 0001 0101.

#### 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.