Wednesday, November 16, 2011

If two BCD digits are added then their sum result will not always be in BCD.
Consider the two given examples.

In the first example, result is in BCD while in the second example it is not in BCD.
Four bits are needed to represent all BCD digits (0 – 9). But with four bits we can represent up to 16 values (0000 through 1111). The extra six values (1010 through 1111) are not valid BCD digits.
Whenever the sum result is > 9, it will not be in BCD and will require correction to get a valid BCD result.

Correction is done through the addition of 6 to the result to skip the six invalid values as shown in the truth table by yellow color.
Consider the given examples of non-BCD sum result and its correction.

A BCD adder is a circuit that adds two BCD digits in parallel and produces a sum BCD digit and a carry out bit.
The maximum sum result of a BCD input adder can be 19. As maximum number in BCD is 9 and may be there will be a carry from previous stage also, so 9 + 9 + 1 = 19
The following truth table shows all the possible sum results when two BCD digits are added.

The logic circuit that checks the necessary BCD correction can be derived by detecting the condition where the resulting binary sum is 01010 through 10011 (decimal 10 through 19).
It can be done by considering the shown truth table, in which the function F is true when the digit is not a valid BCD digit. It can be simplified using a 5-variable K-map.
But detecting values 1010 through 1111 (decimal 10 through 15) can also be done by using a 4-variable K-map as shown in the figure.

Values greater than 1111, i.e., from 10000 through 10011 (decimal 16 through 19) can be detected by the carry out (CO) which equals 1 only for these output values. So, F = CO = 1 for these values. Hence, F is true when CO is true OR when (Z3 Z2 + Z3 Z1) is true.
Thus, the correction step (adding 0110) is performed if the following function equals 1:
F = CO + Z3 Z2 + Z3 Z1
The circuit of the BCD adder will be as shown in the figure.

The two BCD digits, together with the input carry, are first added in the top 4-bit binary adder to produce the binary sum. The bottom 4-bit binary adder is used to add the correction factor to the binary result of the top binary adder.
Note:
1. When the Output carry is equal to zero, the correction factor equals zero.
2. When the Output carry is equal to one, the correction factor is 0110.

The output carry generated from the bottom binary adder is ignored, since it supplies information already available at the output-carry terminal.
A decimal parallel adder that adds n decimal digits needs n BCD adder stages. The output carry from one stage must be connected to the input carry of the next higher-order stage.

1. I disagree with most people here ; since I started reading this blog post I couldn’t stop until I was done, while it wasn’t just what I had been trying to find, was still a great read though. I will instantaneously get your blog feed to keep in touch of future updates

2. We offer car top racks that will allow many vehicles to have a roof rack when normally they wouldn't. It is worth noting that the vast majority of our racks, carriers, bags, etc. will typically mount utilizing a vehicle's existing vertical and/or cross bars. We encourage our customers to contact our sales staff via the online form or via phone to address any questions that pertain to the mounting of the racks

1. I'm impressed. I don't think I've met anyone who knows as much about this subject as you do. You're truly well informed and very intelligent. You wrote something that people could understand and made the subject intriguing for everyone. Really, great blog you've got here.

3. Thanks for posting this. this is really helpful. All the best for your site

4. patta site eka...therenne nathi eka witharai awula..keep it up.
cheers

5. oooya site eka hondata role karagena puke araganin :) Great work and many thanks :)

6. This comment has been removed by the author.

7. amazing ....

finaly I understand the logic class hhhh

thanx alot

;)

8. Thanks for this post..
Can I add -ve numbers like 1+(-7) by giving 2's compliment as input?
value will be 10 for 1+(-7)