You are on page 1of 4

Decimal BCD 8421

Number Code

0 0000 0000

1 0000 0001

2 0000 0010

3 0000 0011

4 0000 0100

5 0000 0101

6 0000 0110

7 0000 0111

8 0000 1000

9 0000 1001

10 (1+0
0001 0000
)

11 (1+1
0001 0001
)

12 (1+2
0001 0010
)

… …

20 (2+0
0010 0000
)

21 (2+1
0010 0001
)

22 (2+2
0010 0010
)
1. Decimal to BCD Conversion:
Firstly, separate the decimal number into its weighted digits and then write down the
equivalent 4-bit 8421 BCD code representing each decimal digit as shown.

Using the above table, convert the following decimal (denary) numbers: 85 10, 57210 and

857910 into their 8421 BCD equivalents.


8510 = 1000 0101 (BCD)
57210 = 0101 0111 0010 (BCD)
857910 = 1000 0101 0111 1001 (BCD)

BCD-to-Decimal Conversion
The conversion from binary coded decimal to decimal is the exact opposite of the above.
Simply divide the binary number into groups of four digits, starting with the least significant
digit and then write the decimal digit represented by each 4-bit group. Add additional zero’s
at the end if required to produce a complete 4-bit grouping. So for example, 1101012 would
become: 0011 01012 or 3510 in decimal.

Convert the following binary numbers: 1001 2, 10102, 10001112 and 10100111000.1012into


their decimal equivalents.
10012 = 1001BCD = 910
10102 = this will produce an error as it is decimal 1010 and not a valid BCD number
10001112 = 0100 0111BCD = 4710
10100111000.1012 = 0101 0011 0001.1010BCD = 538.62510

2. Gray Conversion:
To convert any number to Gray, first convert that number to binary. Then follow the steps
Binary to Gray Code Conversion
This conversion method strongly follows the EX-OR gate operation between binary bits . The
below steps & solved example may useful to know how to perform binary to grey code
conversion.

1. To convert binary to grey code, bring down the most siginificant digit of the given binary
number, because, the first digit or most siginificant digit of the grey code number is same as
the binary number.
2. To obtain the successive grey coded bits to produce the equivalent grey coded number for
the given binary, add the first bit or the most siginificant digit of binary to the second one
and write down the result next to the first bit of grey code, add the second binary bit to third
one and write down the result next to the second bit of grey code, follow this operation until
the last binary bit and write down the results based on EX-OR logic to produce the
equivalent grey coded binary.
Solved Example :
The below solved example may useful to understand how to perform binary to grey code
conversion.

Problem
Find the equivalent grey code for the binary 11101 2.
Solution :

Grey Code to Binary Conversion


This conversion method also follows the EX-OR gate operation between grey & binary bits.
The below steps & solved example may useful to know how to perform grey code to binary
conversion.

1. To convert grey code to binary, bring down the most siginificant digit of the given grey
code number, because, the first digit or the most siginificant digit of the grey code number is
same as the binary number.
2. To obtain the successive second binary bit, perform the EX-OR operation between the first
bit or most siginificant digit of binary to the second bit of the given grey code.
3. To obtain the successive third binary bit, perform the EX-OR operation between the
second bit or most siginificant digit of binary to the third MSD (most significant digit) of grey
code and so on for the next successive binary bits conversion to find the equivalent.
Solved Example :
The below solved example may useful to understand how to perform grey code to binary
conversion.

Problem
Find the equivalent binary number for the grey code 1010.
Solution :

You might also like