Why do we add 6 in BCD addition?

20.1k Views Asked by At

When performing addition in BCD, if we get an invalid BCD value, we remedy this by adding 6 to our sum.

For example:

$0101 + 0110 = 1011$ (Invalid in BCD)

So, we add 6 to fix this.

$1011 + 0110 = 0001 0001$

I've been told that it is to skip the 6 invalid BCD stages, but I have a problem with this. But, if our result was 14 we would only need to skip 1 invalid BCD combination So, why do we need to add 6 specifically?

2

There are 2 best solutions below

0
On BEST ANSWER

$$10_{bcd}=0001\ 0000_b=16_d$$ $$11_{bcd}=0001\ 0001_b=17_d$$ $$12_{bcd}=0001\ 0010_b=18_d$$ $$13_{bcd}=0001\ 0011_b=19_d$$ $$14_{bcd}=0001\ 0100_b=20_d$$ $$...$$ As you see, the discrepancy is always $6$. A carry from a BCD digit to the next converts ten units to a single tenth, but a BCD tenth has weight $16$ instead of $10_d$, hence the correction $6$.

0
On

Whenever you add 2 numbers (0-9), if the sum>=10, the required bcd should be: 0001, followed by 4 bits representing the last decimal digit.

Eg:- 8+8=16 1000+1000= 10000, but required BCD: 0001 0110

To obtain the binary representation of the last digit, you need to subtract ten (i.e, 1010)

This is the same thing as adding the 2’s complement of 1010 which is, 0110( 6 )

In binary subtraction of unsigned numbers using 2’s complement method, you will always have an end carry when the result is positive.

Continuing the previous example,

10000

+0110

Ans: 1(end carry) 0110

Upon adding leading zeroes:

0001 0110, which is the required BCD