In BCD addition why add 6?

  • Thread starter Avichal
  • Start date
  • #1
292
0

Main Question or Discussion Point

In BCD addition when the number exceed 9 we add 6 as the correction value. Although I tried all the cases and saw tthat 6 was indeed the asnwer, how do I prove that? Suppose that instead of BCD I had a 6-bit number, what would be the correction value for that coding?
 

Answers and Replies

  • #2
berkeman
Mentor
56,448
6,366
In BCD addition when the number exceed 9 we add 6 as the correction value. Although I tried all the cases and saw tthat 6 was indeed the asnwer, how do I prove that? Suppose that instead of BCD I had a 6-bit number, what would be the correction value for that coding?
http://en.wikipedia.org/wiki/Binary-coded_decimal

When you get to 0x09, what is the binary representation of it? And to get to 0x10, what do you have to add to 0x09?
 
  • #3
292
0
What is x in 0x09. Anyways for 9 representation is 1001 and for 10 its 1010 in binary.
In BCD representation for 9 is the same but for 10 its 0001 0000 instead of 1010.
We need to add 6 for that - I get that but how to prove it?
 
  • #4
berkeman
Mentor
56,448
6,366
What is x in 0x09. Anyways for 9 representation is 1001 and for 10 its 1010 in binary.
In BCD representation for 9 is the same but for 10 its 0001 0000 instead of 1010.
We need to add 6 for that - I get that but how to prove it?
Standard notation. 0x = hex, 0b = binary...
 
  • #5
The max amount of digits that a decimal increments before a carry is 9. The four bits used in the BCD nibble allows the max value of 16 to be counted. Therefore to properly carry from one nibble to the next 6 is added to any value above 9 to implement a carry to the next nibble. As for the the six bit number I would assume it would be the difference between the max size of the amount of bits you are using and 9.
((2^n)-1)-9= the amount needed to carry into the next group of bits
where n is the number of bits used.
 

Related Threads for: In BCD addition why add 6?

Replies
11
Views
13K
  • Last Post
Replies
12
Views
5K
  • Last Post
Replies
13
Views
3K
  • Last Post
Replies
21
Views
4K
  • Last Post
Replies
1
Views
16K
  • Last Post
Replies
3
Views
647
  • Last Post
Replies
2
Views
4K
  • Last Post
Replies
2
Views
2K
Top