Arithmetic Circuit
Arithmetic Circuit
Electronic Science
12. Arithmetic circuits
1. Introduction
Nowadays, computer is the most important part of our life. It consists of three following
important units: (i) Input / Output devices, (ii) Memory and (iii) CPU. CPU is the heart of
computer. It is central processing unit. Its basic element is ALU i.e. Arithmetic Logic Unit. It
performs the arithmetic operations like addition, subtraction, multiplication, division etc. The
logic operations like AND, OR, NOT etc. are performed. But addition and subtraction are basic
operations. These are performed by arithmetic section of ALU.
We are very familiar with decimal addition but computer does not do decimal addition. It
converts the decimal number into binary numbers and then adds them. The other operations are
multiple additions or subtraction. Subtraction is also an addition. Therefore addition is the most
important operation in arithmetic circuits.
In this module, you will learn about the basics of binary addition and subtraction.
2. Half Adder
The most basic arithmetic operation is the addition of two binary digits. This simple addition
consists of four possible elementary operations:
0 + 0 = 0,
0 + 1 = 1,
1 + 0 = 1, and
1 + 1 = 10
A combinational circuit that performs the addition of two bits is called a half adder. One that
performs the addition of three bits (two significant bits and a previous carry) is a full adder. The
names of the circuits stem from the fact that two half adders can be employed to implement a full
adder.
Let us consider x and y as the inputs to the half adder where as Sum and Carry are the outputs.
The Truth table, K-maps for sum and carry along with the logic diagram are shown in figure
Digital Electronics
Electronic Science
12. Arithmetic circuits
Truth table for half adder
x y Sum Carry
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
x’ x x’ x
y’ 1 y’
y 1 y 1
Figure-: Truth table, K-maps for sum and carry along with the logic circuit for half adder
Digital Electronics
Electronic Science
12. Arithmetic circuits
Let us consider the truth table of half adder. There are four possible combinations for the inputs.
When both x and y are at logic ‘0’ then sum as well as carry are at logic ‘0’. If any one of the
input either x or y is ‘1’ the sum is at ‘1’ and carry is ‘0’. When both the inputs are ‘1’ then the
sum is ‘0’ and carry becomes ‘`1’.
The k-map for sum and carry need to be prepared separately. The k-map is of 2-varibles for
sum and carry as shown in figure -1. After plotting the outputs into the k-map the two Boolean
expressions for sum and carry are obtained. These equations can be used to draw the logic
diagram for half adder. The equation for sum indicate, there is a need of an EXOR gate and AND
gate for the carry.
3. Full Adder -
Full adder is a one of the most important blocks of an ALU. One that performs the addition of
three bits (two significant bits and a previous carry) is a full adder. The names of the circuits
stem from the fact that two half adders can be employed to implement a full adder. Let us begin
with the preparation of Truth table for Full adder.
Truth table for Full Adder
x y z Carry Sum
0 0 0 0 0
0 0 1 0 1
0 1 0 0 1
0 1 1 1 0
1 0 0 0 1
1 0 1 1 0
1 1 0 1 0
1 1 1 1 1
Digital Electronics
Electronic Science
12. Arithmetic circuits
K-map for Sum K-map for Carry
x’ 1 1 x’ 1
x 1 1 x 1 1 1
Sum = z (x y) Carry = xy + xz + yz
= z'(xy' + x'y) + z(xy' + x'y}' = xy + xy’z + x’yz
= z'(xy' + x 'y ) + z(xy + x'y') = xy + z (x y)
= xy' z' + x 'yz' + xyz + x 'y' z
Figure-: Truth table, K-maps for sum and carry along with the logic circuit for full adder
Let us consider the truth table of full adder. There are eight possible combinations for the inputs.
When all the inputs are at logic ‘0’ then sum as well as carry are at logic ‘0’. If any one of the
input either x or y or z is ‘1’ the sum is at ‘1’ and carry is ‘0’. When any two of the inputs are ‘1’
then the sum is ‘0’ and carry becomes ‘`1’. When all the inputs are ‘1’ then the sum as well as
carry is at logic ‘1’.
Digital Electronics
Electronic Science
12. Arithmetic circuits
The k-map for sum and carry need to be prepared separately. The k-map is of 3-varibles for
sum and carry as shown in figure -2. After filling the outputs into the k-map and simplification,
the two Boolean expressions for Sum and Carry are obtained. These equations can be used to
draw the logic diagram for full adder. The full adders using two half adders and OR gate is
obtained by expressions of sum and carry. In short, we require two EXOR gates, 2 AND gates
and one OR gate to obtain the logic diagram for Full Adder.
4. Binary Adder
Multiple bits binary adder is obtained by using number of full adders connected in cascade. For
the first full adder the least significant bit of Augend and Addend along with the carry in are the
inputs. Its outputs are sum and carry out. The carry out is used as carry in for the next full adder.
Other inputs for the next full adder are the next significant bits. It again generates the sum and
carry. The process is repeated till the last MSB. Figure – 3 indicates the logic diagram for 4-bit
binary adder.
Digital Electronics
Electronic Science
12. Arithmetic circuits
Let us consider the example of 4-bit binary addition. Let us take the decimal numbers 11 and 3
for the addition.
Augend 11
Addend 3
Sum 14
Note that the result 1110 in binary is equivalent to decimal 14. So the logic circuit performs the
addition of two numbers in binary.
5. Binary subtractor
Let us now begin with process of subtraction. This simple subtraction consists of four possible
elementary operations:
0 - 0 = 0,
0 - 1 = 1 with borrow 1,
1 - 0 = 1,
1-1=0
A combinational circuit that performs the subtraction of two bits is called a half subtractor.
One that performs the subtraction of three bits (two significant bits and a previous borrow) is a
Digital Electronics
Electronic Science
12. Arithmetic circuits
full subtractor. The names of the circuits stem from the fact that two half subtractors can be
employed to implement a full subtractor.
Half Subtractor
Let us consider the truth table of half subtractor. There are four possible combinations for the
inputs. When both x and y are at logic ‘0’ then difference as well as borrow are at logic ‘0’. If
A=0 and B=1 then difference is ‘1’ and borrow is also at ‘1’. When A=1 and B=0 then the
difference is 1 and borrow is 0. When both the inputs are ‘1’ then the both difference and borrow
are at logic ‘0’.
From the truth table it is clear that, we need additional NOT gate while implementing the borrow
output. There is a need of an EXOR gate and AND gate for implementation.
B
D
Bo
A B Difference Borrow
(D) (Bo)
0 0 0 0
0 1 1 1
1 0 1 0
1 1 0 0
Digital Electronics
Electronic Science
12. Arithmetic circuits
Full Subtractor
One that performs the subtraction of three bits (two significant bits and a previous borrow) is a
full subtractor. The names of the circuits stem from the fact that two half subtractors can be
employed to implement a full subtractor.
There are two ways to perform binary subtraction. One way is to use the full subtractor and the other
way is to implement 2’s complement addition with discarding the carry (if generated). Normally, in
ALU the subtraction is obtained by using 2’s complement addition. 2’s complement of the binary the
number is obtained by first finding the 1’s complement and adding binary ‘1’ to it
For example,
Decimal Binary 2’s complement addition
Minuend 11 1011 1011
Subtrahend - 3 - 0011 + 1101
Digital Electronics
Electronic Science
12. Arithmetic circuits
10
In 2’s complement addition we need to convert the subtrahend in 2’s complement form before
addition. It is obtained by first obtaining the 1’s complement and then addition binary’1’ to it.
In this example, subtrahend is 3. Its binary is 0011. Its 1’c complement is 1100 and 2’s
complement is 1101 ( obtained by adding 1100 +1).
Figure 6 indicates the universal adder/subtractor circuit. It acts as adder when M=0 and provides
subtraction when M=1.
Let us understand the working of this universal adder / subtractor. If control input M=’0’, all the
XOR gates receives logic ‘0’ as one of the inputs. This acts as an enble input and the gate
transfers the data on other input as it is at the output. If control input M=’1’, all the XOR gates
receives logic ‘1’ as one of the inputs. This makes the gates to act like an inverters. This will
generate 1’s complement of the input. Furhter the M’1’ is also added, as it is given as carry
input to the LSB adder.
Digital Electronics
Electronic Science
12. Arithmetic circuits
11
The parallel adder accepts the data to be added at the same instant but the carries are not
generated instantly. It takes time for the carry to propagate from LSB Full adder to MSB Full
adder. The total propagation time is equal to propagation delay of a typical gate multiplied by
the number of gates in the circuit. Inputs A3 and B3 are available as soon as input signals are
applied to the adder. However, input carry C3 does not settle to its final value until C2 is
available from the previous stage. Similarly, C2 has to wait for C1 and soon down to C0. Thus,
only after the carry propagates and ripples through all stages will the last output S3 and carry C4
settle to their final correct value. This is called as carry propagation.
The carry propagation time is the limiting factor on the speed of addition. The adder will always
have some value at its output terminals. The correct value will be provided only when the signal
propagates from inputs to outputs. Most of the arithmetic operations (subtraction, multiplication,
division) are based on addition. The time consumed during addition is very critical. One solution
for reducing the carry propagation delay time is to employ faster gates with reduced delays.
Another solution is to increase the complexity of the circuit in such a way that the carry delay
time is reduced. There are several techniques for reducing the carry propagation time in a parallel
adder. The most widely used technique employs the principle of carry look ahead logic. The
technique is used with the help of Full Adder obtained using Ex-OR, AND & OR gate.
Digital Electronics
Electronic Science
12. Arithmetic circuits
12
Gi called a carry generate. And it produces a carry of 1 when both Ai and Bi are 1. Regardless of
the input carry Ci. Pi is called carry propagate, because it determines whether a carry into stage i
will propagate into stage i+1
We write the Boolean equations for the carry outputs of each stage
C0 = input carry
C1 = G0 + P0 C0
C2 = G1 + P1 C1 = G1 + P1 G0 + P1 P0 C0
C3 = G2 + P2 C2 = G2 + P2 G1 + P2 P1 G0 + P2 P1 P0 C0
and
S0 = P0 XOR C0
S1 = P1 XOR C1
S2 = P2 XOR C2
S3 = P3 XOR C3
Since the Boolean function for each output carry is expressed in sum-of-products form, each
function can be implemented with one level of AND gates followed by an OR gate. All three
Boolean functions for C1, C2 and C3 are implemented in the carry look ahead as shown in
figure-7.
Digital Electronics
Electronic Science
12. Arithmetic circuits
Each sum output requires two XOR gates. The carries are propagated through the carry 13
look ahead generator and applied as inputs to the second XOR gates as shown in figure-
8. All output carries are generated after a delay through two levels of gates. Thus,
outputs S1 through S3 have equal propagation delay times. Hence, the speed of addition
is more.
MULTIPLEXER
Digital Electronics
Electronic Science
12. Arithmetic circuits
Block Diagram :
14
The circuit has n input signals, m select signals and 1 output signal.
Note that, m control signals can select at the most 2m input signals thus n
<=2m 4x1 Multiplexer
Let us write the logic equation of this circuit. Clearly, it will give a
SOP representation, each AND gate generating a product term, which
finally are summed by OR gate. Thus,
Digital Electronics
Electronic Science
12. Arithmetic circuits
Y=0′ 0′ D0 + 0′ 0 D1 + 0 0′ D2 + 0 0 D3
Y=1.1 D0 + 1.0 D1 + 0.1 D2 + 0.0 D3 (0’=1) 15
Y= D0
In other words, for S1S0 = 00, the first AND gate to which D0 is
connected remains active and equal to D0 and all other AND gate are
inactive with output held at logic 0.
Thus, multiplexer output Y is same as D0.
If D0 =0, Y=0 and if D0 = 1, Y= 1.
Control Output
Signals
S1 S0 Y
0 0 D0
0 1 D1
1 0 D2
1 1 D3
A logic diagram of 4-line to 1-line multiplexer is shown in figure 3
Each of the four input lines, D0 to D3, is applied to one input of an
AND gate. Selection lines s1 and s0 are decoded to select a particular AND
gate. The function table in the figure lists the input-to-output path for each
possible bit combination of the selection lines.
To demonstrate the circuit operation, consider the case when s1s0 =
10. The AND gate associated with input D2 has two of its inputs equal to 1
and the third input connected to D2.
The other three AND gates have at least one input equal to 0,
which makes their output equal to 0.
The OR-gate output is now equal to the value of D 2, thus providing
a path from the selected input to the output.
Digital Electronics
Electronic Science
12. Arithmetic circuits
DEMULTIPLEXER
16
Demultiplex means one into many.
A demultiplexer is a circuit that receives information on a single line
and transmits this information on one of 2n possible output lines.
The selection of a specific output line is controlled by the bit values
of n selection lines.
Select lines
Demultiplexer has single data input (D) and n outputs (Y0 – Yn-1).
While number of Select lines depends on number of outputs.
If ‘n’ is number of outputs and ‘m’ is number of select lines then the
relation between them is given by n = 2m.
1 to 4 Demultiplexer:
Digital Electronics
Electronic Science
12. Arithmetic circuits
From the truth table it is clear that, when S 1=0 and S0= 0, the data
input is connected to output Y 0 and when S1= 0 and S0=1, then the data 17
input is connected to output Y1.
Similarly, other outputs are connected to the input for other two
combinations of select lines.
Y0 S1.S0D
Y1 S1.S0D
Y2 S1.S0D
Y3 S1.S0D
Applications of multiplexers
Multiplexer or data selectors are combinational circuits which transfer data from many
sources to output under the control of data select lines. Multiplexer has many
applications right from data routing, time division multiplexing, function generator to
parallel to serial converter etc. A single multiplexer can replace several logic gates ICs,
saving PCB area, interconnections, design efforts and cost. A list of popular applications
is given below.
1. Data routing
2. Data bussing
3. Switch setting comparator
Digital Electronics
Electronic Science
12. Arithmetic circuits
4. Multiplexer as a function generator
5. Parallel to serial converter 18
Applications of Demultiplexers
1. Data demultiplexing
2. Clock demultiplexing
3. Memory addressing
4. Four phase clock generator
5. Function generation using DMUX
6. Switch encoding
7. Serial to parallel converter
Decoder:
A decoder is similar to a demultiplexer, with one exception-there is
no data input.
The only inputs are the Select signals.
Decoder is a logic circuit that converts n-bit binary input code into m
output lines.
The decoders presented here are called n-to-m line decoders where
m < 2n.
Each output line will be activated for only one of the possible
combination of inputs.
Digital Electronics
Electronic Science
12. Arithmetic circuits
19
2 to 4 Decoder:
The two inputs are decoded into four outputs, each output
representing one of the minterms of the 2-input variables. The two
inverters provide the complement of the inputs, and each one of the four
AND gates generates one of the minterms. A particular application of this
decoder would be a binary-to-octal conversion. The input variables may
represent a binary number, and the outputs will then represent the four
digits. However, a 2-to-4 line decoder can be used for decoding any 2-bit
code to provide four outputs, one for each element of the code.
Y0 S1.S0
Y1 S1.S0
Y2 S1.S0
Y3 S1.S0
Inputs Outputs
S1 S0 Y3 Y2 Y1 Y0
X X 0 0 0 0
0 0 0 0 0 1
0 1 0 0 1 0
1 0 0 1 0 0
1 1 1 0 0 0
Digital Electronics
Electronic Science
12. Arithmetic circuits
20
Encoder:
An Encoder is a combinational circuit that performs the reverse
operation of Decoder.
An encoder converts an active input signal into a coded output signal
There are n input lines, only one of which is active.
Internal logic within the encoder converts this active input to a coded
binary output with m bits.
Decimal-to-BCD Encoder:
Digital Electronics
Electronic Science
12. Arithmetic circuits
21
If button 5 is pressed, the output becomes
ABCD=0101
When switch 9 is pressed,
ABCD= 1001
Encoders Decoders
Encoders may have more than one Decoders may have more than one
input line active and may have input line active at any given time but
more than one output line active at only one output line will be active
any given time
Number of input lines is more than Number of output lines is more than
number of output lines number of input lines
Number of input lines = 2Number Number of output lines = 2Number of
of output lines input lines
Encoder is logic device used to Decoder is logic device used to
create binary code for given decode binary input to give decimal
decimal input output
Digital Electronics
Electronic Science
12. Arithmetic circuits