Tut 4
Tut 4
ELCT201
Tutorial 4
Adders, Subtractors & multipliers
Intro to CircuitVerse
1
Adders
• Half Adder
– no. of i/p(s) = 2 & no. of o/p(s)=2
x y C S
0 0 0 0
0 1 0 1
1 0 0 1
1 1 1 0
– Logic diagram x
C
y
HA
S
2
Problem 1
Design a 4–bit combinational circuit incrementer (a circuit that adds one
to a 4–bit binary number). The circuit can be designed using four half–
adders.
A3 A2 A1 A0
+ 1
A B A B A B A B
HA HA HA HA
S C S C S C S C
3
Adders
• Full Adder
– no. of i/p(s) = 3 & no. of o/p(s)=2
yz yz
x y z C S x x
mo m1
1 m3 m2
1 mo m1 m3
1 m2
0 0 0 0 0 m4
1 m5 m7
1 m6
m4 m5
1 m1
7 m6
1
0 0 1 0 1
0
0
1
1
1
0
0
1
0
0
1
0
1
0
1
𝑪=𝑥𝑦+𝑥𝑦’𝑧+𝑥’𝑦𝑧=
1 0 1 1 0
1 1 0 1 0 HA HA
1 1 1 1 1 x
y S
z
FA
C
4
Four Bit Adder
A3 A2 A1 A0
+B3 B2 B1 B0
5
Subtractor
• Subtractor
– A - B = A + (-B) = A + (2’s complement of B)
1. Get 2’s complement of B
a) Get 1’s complement of B
b) Add 1 A
2. Add 2’s complement of B to A B FA
1
• Adder/Subtractor
– C=0 Adder A
– C=1 Subtractor B FA
C
6
Problem 3
Design a combinational circuit that takes two 4-bit numbers A and B
and a 1-bit input C. The circuit should function as an adder or a
subtractor of the inputs A and B such that based on the input C it toggles
between addition and subtraction. Assume that A > B
7
Problem 4
• Design a binary multiplier that multiplies two 4–bit numbers. Use
AND gates and binary adders
8
Problem 4
A3 B3 A2 B2 A1 B1 A0 B0
Cout Four-Bit Adder Cin
S3 S2 S1 S0
A3 B3 A2 B2 A1 B1 A0 B0
Cout Four-Bit Adder Cin
S3 S2 S1 S0
A3 B3 A2 B2 A1 B1 A0 B0
Cout Four-Bit Adder Cin
S3 S2 S1 S0
9
Problem 5:
Given that 𝑥 is 2-bit binary number (𝑥0, 𝑥1) with subscript 0
corresponding to the least significant bit. Design a circuit that
implements the function 𝑓= 𝑥2+2 using 1 full adder, 1 half adder and 1
AND gate.
10