FOR FREE YEAR SOLVED

BCD

 

Binary Coded Decimal (BCD): 

Binary Coded Decimal is a special binary code that represents a decimal number.BCD always represents a single decimal number at a time by a 4-bit binary number (total represent 24=16 numbers (0000 to 1111)) but only the first 10 numbers (0000 to 1001 i.e. 0 to 9) are valid for BCD and the rest of 1010 to 1111 (10 to 15) are invalid.

 

Basically we use BCD to encoded decimal number by grouped into four binary digits one at a time. It mainly used for an accurate representation of decimal numbers and their conversion to and from other number systems.

 

Example: 

Now we encoded the above decimal number using BCD.

 

 

Difference between normal binary code and BCD:

Let take an example to clear the difference.

 

1. We are converting Decimal to Binary.

 

Or

The number of binary bits after conversion is 4

 

2. We are converting Decimal to Binary Coded Decimal.

 

Number of binary bits after conversion is 5

 

Therefore,

Note: All BCD code which mentioned above is 8421 BCD code.

 

 

BCD has some other code also like 242152114311, etc. which we discuss next. 

 

The BCD can be classified into two categories weighted and non-weighted code. Weighted code can also be categorized as positive or negative weighted code.

 

Before discussing Weighted and Un-weighted BCD code here we are discussing some important properties:

1.  Self-complementing codes

2.  Sequential codes

 

1. Self-complementing codes: In the Self Complementing Code, the code of a digit and the code of 9’s complement of the digit are is complement to each other.

For a binary code to become a self-complementing code, the following two conditions must be satisfied:

 

a. Self-complementing codes are the codes that have the property that 9’s complement of a decimal number is obtained directly by replacing 1s by 0s and 0s by 1s i.e. by complementing each bit in the pattern.

 

or 

 

b. The sum of the binary number and its complement should be equal to decimal 9.

 

c. In the case of weighted codeif the sum of weighted code is 9, then it is a self-complement code.

 

Some self-complementary code are 2421, excess 3, 8421, 3321, 2241, 6311, etc. 

 

Example

Now, if we represent this decimal number in the 2421 code.

 

[For more details see 9’s complement: Number System: Complements

 

Now, after changing 0’s and 1’s of 0010 (which2 in 2421 code number), we will get 1101 which is 7 in 2421 code number.

Which is 9’s complement of(which is 0010).

 

# We can check other ways that are the sum of the binary number and its complement should be equal to decimal 9. 

 

After changing  0’s and 1’s of  0 0 1 0 (which 2 in 2421 code number), we will get 1101 which is 7 in 2421 code number.

 

So, 2+7 = 9.

 

# For weighted code we can check self-complementary by another way also that is if the sum of weighted code is 9, then it is a self-complement code.

 

Here we are weighted code is 2421. Sum of the 2421 code is 2 + 4 + 2 + 1 = 9.

 

So, the 2421 code is a self-complement code.

 

You can check other self-complement code excess 3, 8421, 3321, 2241, 6311 in the same way.

 

2.  Sequential codes: Sequential codes are codes in which two consecutive binary numbers differ by only one digit i.e. codes are coming sequentially.

 

Decimal digit

8 4 2 1

Excess – 3

0

0000

0011

1

0001

0100

2

0010

0101

3

0011

0110

4

0100

0111

5

0101

1000

6

0110

1001

7

0111

1010

8

1000

1011

9

1001

1100

 

Now, we will discuss weighted and un-weighted BCD code in the next chapter.