You are on page 1of 23

Decimal Arithmetic Unit and

Operations
Decimal Arithmetic Unit:
A decimal arithmetic unit is a digital function that
performs decimal micro-operations.
It mainly performs two operations: Addition and
Subtraction.
The addition operation is performed with BCD Adder
whereas Subtraction is performed with BCD Subtractor.
Here, BCD stands for binary-coded decimal.
This decimal arithmetic unit first accepts coded decimal
numbers and then generates output in the binary form.
BCD Code:
In this code, each decimal digit (0-9) is represented by a 4-bit
binary number.
example, 374 is a decimal number whereas, 3, 7, and 4 are the
decimal digits.
Henceforth, by using BCD we can represent decimal digits by a 4-
bit binary number.
Positional weights are 8-4-2-1.
And sometimes BCD is known as 8-4-2-1 code.
For example, to represent 10 in BCD, the BCD code for 1
and 0 will be concatenated.
Thus,
(10)10 = 00010000
Let’s convert a decimal number 15 in binary as well as in BCD.
(15)10 = (1111)2 in binary
(15)10 = (00010101) in BCD
BCD Addition
BCD addition is a replica of the binary addition. In BCD
addition, we’ve to deal with three cases which are:
Sum <= 9, final carry = 0, the obtained result is correct.
Sum <= 9, final carry = 1, the obtained result is incorrect. To
correct the answer, we just need to add 6(or 0110) to the
obtained result.
Sum >9, final carry = 0, again the result obtained is incorrect.
To correct the answer the same will be followed, i.e, the
addition of 6( or 0110) to the result

2)2 + (6)2 #BCD Addition


(3)10 + (7)10 #BCD Addition

By adding 6 we can obtain the correct result. Now the question


may arise why 6 only?
We know that we use the 4-bit binary number to represent the
decimal digits which are from (0-9). Also, we know that with 4-
bit there can be 16 (0-15) possibilities. But the valid cases are
only from (0-9), by this, we can calculate the invalid cases, i.e, 15
-9=6
To correct the above answer, let’s add 6 to the sum.

(10)10 = 0001 0000


BCD Adder
The digital system handles the decimal number in the form of binary-coded
decimal numbers (BCD).
A BCD Adder Circuit adds two BCD digits and returns a BCD sum digit. BCD
numbers use digits, ranging from 0 to 9, which are represented in binary as 0000
to 1001, i.e. each BCD digit is a 4-bit binary number.
The maximum value of output will be 19 (i.e.
9(1001)+9(1001)+1(carry =1) = 19).
Here, we will only be obtaining the binary addition of the two
numbers. To convert them into the BCD form by using the BCD
adder.
As a result, in order to build a BCD Adder Circuit, we'll need:
4-bit binary adder for initial addition
Logic circuit to detect sum greater than 9 and
One more 4-bit adder to add 0110(6) in the sum if the sum is
greater than 9 or carry is 1.
The minimum sum we can obtain from the 4-bit adder is zero(0000
with k(final carry) = 0) and the maximum sum is 19 (0011 with k = 1).
The table shows that when the 'Binary Sum' has an output carry K=1,
a correction is required.
First condition = K(output carry) =1, which covers the numbers from
16 to 19.
The remaining six combinations numbered 10 to 15, require
correction, with the bit on the Z8 position set to 1. If we closely look
at table two unrequired cases ( 8 and 9 ) will also be covered. To
overcome this, we can check for the other bits. Herewith Z8, Z4 values
are also 1’s.
Second condition = Z8Z4 = 1, which covers the numbers from 12 to 15.
The leftover will be covered by considering the Z8 and Z2 bits.
Third condition = Z8Z2 = 1, which covers the numbers 10 and 11.
C=K+Z8.Z4+Z8.Z2 will be the boolean expression for the adder circuit.
Henceforth, we are adding “0110” (=6) only to the second half of the
table.
We can also make use of the K-map to find the boolean expression:
The conditions are:
If K = 1 (Satisfies 16-19)
If Z8.Z4 = 1 (Satisfies 12-15)
If Z8.Z2 = 1 (Satisfies 10 and 11)
In the above diagram,
We'll use a 4-bit Binary-Adder as an example, which accepts
addend and augend bits as input and has a 'Carry in' input carry.
The Binary-Adder generates five outputs: Z8, Z4, Z2, Z1, and a
carry K output.
The logical circuit is designed to identify the Cout using the output
carry K and Z8, Z4, Z2, Z1 outputs.
The binary adder's Z8, Z4, Z2, and Z1 outputs are fed into the 2nd
4-bit binary adder as an Augend.
The addend bit of the 2nd 4-bit binary adder is designed in such a
way that the 1st and the 4th bit of the addend number are 0 and
the 2nd and the 3rd bit are the same as Cout. When the value of
Cout is 0, the addend number will be 0000, which generates the
same result as the 1st 4-bit binary number. But when the value of
the Cout is 1, the addend bit will be 0110(6) which adds with the
augend to get the valid BCD number.
For an example,
1001 + 1001
Step 1: Add both the numbers using a 4-bit binary adder and
the input carry Cin = 0.
Step 2: The binary adder produces the result 0010 and the output
carry as 1(k=1).
Step 3: Then, using the expression Cout=K+Z8.Z4+Z8.Z2, find the Cout
value to determine whether the produced BCD is invalid or valid.
K=1
Z8 = 0
Z4 = 0
Z2 = 1
Cout = 1+0*0+0*1
Cout = 1+0+0
Cout = 1
Step 4: The value of Cout is 1, which expresses that the produced
BCD code is invalid. Then, add the output of the 1st 4-bit binary
adder with 0110(6).
= 0010+0110
= 1000
The BCD is represented by the carry output as:
BCD= Cout Z8 Z4 Z2 Z1=1 1 0 0 0 (19).
A subtractor circuit is required to perform a subtraction operation
on two decimal numbers. BCD subtraction is slightly different from
BCD addition. Performing subtraction operation by taking the 9’s
or 10’s complement of the subtrahend and adding it to the
minuend is economical.
It is not possible to obtain the 9’s complement by complementing
every bit in the code because the BCD is not a self- complementing
code. The 9’s complement has to be formed by a circuit that
subtracts Notes every BCD number from 9.
The 9’s complement of a decimal digit that is represented in BCD
can be obtained by complementing the bits in the coded
representation of the digit. There are two methods of correction
are as follows −
First Method − The binary 1010 is added to every complemented
digit. The carry is discarded after performing the addition.
Second Method − The binary 0110 is added before the digit is
complemented.
For instance, the 9’s complement of BCD 0111 is calculated by
complementing every bit to get 1000. The value 0010 is obtained
by adding binary 1010 and ignoring the carry. Using the second
method, 0110 and 0111 can be added to obtain 1101. The required
output, that is, 0010 can be obtained by complementing every bit.
Complementing every bit of a 4-bit binary digit N is the same as
subtracting the digit from 1111. When the decimal equivalent of 10
is added, the value obtained is 15 - N + 10 = 9 - N + 16.
However, the digit 16 signifies the carry that is discarded, hence,
the result equals 9 - N as required. Adding and then
complementing the binary equivalent of decimal 6 provides 15 - (N
+ 6) = 9 - N as needed.
A combination circuit can also be used to obtain the 9’s
complement of a BCD digit. When this combination circuit is
attached to a BCD adder, it results in a BCD adder or subtractor.

You might also like