DLD: DATA LOGIC DESIGN - ASSIGNMENT
BCD Adder/ DECIMAL ADDER
BCD binary numbers represent Decimal digits 0 to 9. A 4-bit BCD code is used to
represent the ten numbers 0 to 9. Since the 4-bit Code allows 16 possibilities, therefore the
first 10 4-bit combinations are considered to be valid BCD combinations. The latter six
combinations are invalid and do not occur.
BCD Code has applications in Decimal Number display Systems such as Counters and Digital Clocks.
BCD Numbers can be added together using BCD Addition.
BCD Addition is similar to normal Binary Addition except for the case when sum of two BCD digits exceeds 9 or
a Carry is generated. When the Sum of two BCD numbers exceeds 9 or a Carry is generated
a 6 is added to convert the invalid number into a valid number. The carry generated by adding
a 6 to the invalid BDC digit is passed on to the next BCD digit.
Addition of two BCD digits requires two 4-bit Parallel Adder Circuits. One 4-bit Parallel
Adder adds the two BCD digits. A BCD Adder uses a circuit which checks the result at the
output of the first adder circuit to determine if the result has exceeded 9 or a Carry has been
generated. If the circuit determines any of the two error conditions the circuit adds a 6 to the
original result using the second Adder circuit. The output of the second Adder gives the correct
BCD output. If the circuit finds the result of the first Adder circuit to be a valid BCD number
(between 0 and 9 and no Carry has been generated), the circuit adds a zero to the valid BCD
result using the second Adder. The output of the second Adder gives the same result.
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.
Decimal Adder / BCD Adder:
Decimal Adder – The digital systems handles the decimal number in the form of binary coded decimal numbers (BCD). A BCD adder is a circuit that adds two BCD digits and produces a sum digit also in BCD. BCD numbers use 10 digits, 0 to 9 which are represented in the binary form 0 0 0 0 to 1 0 0 1, i.e. each BCD digit is represented as a 4-bit binary number. When we write BCD number say 526, it can be represented as
Here, we should note that BCD cannot be greater than 9.
The addition of two BCD numbers can be best understood by considering the three cases that occur when two BCD digits are added.
Sum Equals 9 or less with carry 0
Let us consider additions of 3 and 6 in BCD.
The addition is carried out as in normal binary addition and the sum is 1 0 0 1,
which is BCD code for 9.
Sum greater than 9 with carry 0
The sum 1 1 1 0 is an invalid BCD number. This has occurred because the sum of the two digits exceeds 9. Whenever this occurs the sum has to be corrected by the addition of six (0110) in the invalid BCD number, as shown below
After addition of 6 carry is produced into the second decimal position.
Sum equals 9 or less with carry 1
Let us consider addition of 8 and 9 in BCD
In this, case, result (0001 0001) is valid BCD number, but it is incorrect. To get the correct BCD result correction factor of 6 has to be added to the least significant digit sum, as shown below:
Going through these three cases of BCD addition we can summarise the BCD addition procedure as follows :
- Add two BCD numbers using ordina7 binary addition.
- If four-bit sum is equal to or less than 9, no correction is needed. The sum is in proper BCD form.
- If the four-bit sum is greater than 9 or if a carry is generated from the four-bit sum, the sum is invalid.
- To correct the invalid sum, add 01102 to the four-bit sum. If a carry results from this addition, add it to the next higher-order BCD digit.
- Thus to implement BCD adder we require :
- 4-bit binary adder for initial addition
- Logic circuit to detect sum greater than 9 and
- One more 4-bit adder to add 01102 in the sum if sum is greater than 9 or carry is 1.
The logic circuit to detect sum greater than 9 can be determined by simplifying the boolean expression of given truth table.
With this design information we can draw the block diagram of BCD adder, as shown in the Fig. 3.32.
As shown in the Fig. 3.32 , the two BCD numbers, together with input carry, are first added in the top 4-bit binary adder to produce a binary sum. When the output carry is equal to zero (i.e. when sum ≤ 9 and Cout = 0) nothing (zero) is added to the binary sum. When it is equal to one (i.e. when sum > 9 or Cout = 1), binary 0110 is added to the binary sum through the bottom 4-bit binary adder. The output carry generated from the bottom binary adder can be ignored, since it supplies information already available at the output-carry terminal.
Comments
Post a Comment