Professional Documents
Culture Documents
Chapter – Functions
IPSUM Logic
of Combinational
Dr. Muhammad Hanif
Contents
◦ 6–1 Adders
◦ Half and Full Adder
◦ Parallel Binary Adders
◦ Ripple Carry and Look-Ahead Carry Adders
◦ 6–4 Comparators
◦ 6–5 Decoders
◦ 6–6 Encoders
◦ 6–7 Code Converters
◦ 6–8 Multiplexers (Data Selectors)
◦ 6–9 Demultiplexers
◦ 6–10 Parity Generators/Checkers
Adders
◦ Adders are important in computers and also in other types of digital systems in which
numerical data are processed.
◦ A basic Binary Adder circuit can be made from standard AND and Ex-OR gates.
◦ The addition of two digits produces an output called the SUM of the addition and a
second output called the CARRY or Carry-out, ( COUT ) bit
◦ An understanding of the basic adder operation is fundamental to the study of
digital systems
◦ Goal of this section is to understand different types of adders
1. Half-Adder
2. Full-Adder
3. Parallel Multi-bit Adder
4. Ripple Carry Adder
5. Look Ahead Adder
Adder: Half Adder
Basic rules of binary addition are performed by a half adder,
which has two binary inputs (A and B) and two binary
outputs:
Carry out and Sum .
Inputs Outputs
The inputs and outputs can be summarized on a truth table. A B Cout S
The logic symbol and equivalent circuit are: 0 0 0 0
S S 0 1 0 1
A S
1 0 0 1
1 1 1 0
A
B Cout Cout
B
Adder: Half Adder
◦ Addition rules of two binary numbers:
0 0 1 1
+0 +1 +0 +1
(carry) 1←
0 1 1
0
Adder: Half Adder
◦ The SUM part in the half adder is similar to the output of a two inputs Ex-OR gate.
B A S
0 0 0
0 1 1
2-input Ex-OR Gate
1 0 1
1 1 0
Adder: Half Adder
◦ The carry bit is similar to the two inputs AND gate operation:
B A C
0 0 0
0 1 0
2-input AND Gate
1 0 0
1 1 1
Adder: Half Adder
◦ The half adder can be implemented uing Ex-OR and AND Gate:
CARR
B A SUM
Y
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
Adder: Half Adder
◦ The Boolean Expression for the half adder Sum and Carry are:
◦ For the SUM bit:
◦ SUM = A XOR B = A ⊕ B
◦ For the CARRY bit:
◦ CARRY = A AND B = A.B
Adder: Half Adder
◦ One major disadvantage of the Half Adder circuit is that there is no provision
for a “Carry-in” from the previous circuit when adding together multiple data
bits.
◦ The most complicated operation the half adder can do is “1 + 1” .
◦ One simple way to overcome this problem is to use a Full Adder type binary
adder circuit.
Adder: Full Adder
◦ The main difference between the Full Adder and the Half Adder is that a full
adder has three inputs.
◦ Two single bit data inputs A and B plus an additional Carry-in (C-in) input to
receive the carry from a previous stage.
A full-adder can be constructed from two half adders as shown: Inputs Outputs
A B Cin Cout S
S S 0 0 0 0 0
A A S A S Sum
0 0 1 0 1
A S 0 1 0 0 1
B 0 1 1 1 0
B Cout B Cout B
Cin 1 0 0 0 1
Cout Cin Cout
1 0 1 1 0
1 1 0 1 0
Cout 1 1 1 1 1
Adder: Full Adder
Symbol Truth Table
◦ Truth Table
C-in B A Sum C-out
0 0 0 0 0
0 0 1 1 0
0 1 0 1 0
0 1 1 0 1
1 0 0 1 0
1 0 1 0 1
1 1 0 0 1
1 1 1 1 1
Adder: Full Adder
◦ The Boolean expression for a full adder is as follows.
◦ For the SUM (S) bit:
◦ SUM = (A XOR B) XOR Cin = (A ⊕ B) ⊕ Cin
◦ For the CARRY-OUT (Cout) bit:
◦ CARRY-OUT = A AND B OR Cin (A XOR B) = A.B + Cin.(A ⊕ B)
Adder: Full Adder
S S
1 A S 1 A S 0
For the given inputs, determine
the intermediate and final outputs 0 B Cout 0 B Cout
of the full adder. 1
1
The first half-adder has inputs of 1 and 0;
therefore the Sum =1 and the Carry out = 0. 1
A4 B4 A3 B3 A2 B2 A1 B1
C0
C4
C3 C2 C1
S4 S3 S2 S1
Adder: Parallel Adder
The logic symbol for a 4-bit parallel adder is shown. This 4-bit adder includes a
carry in (labeled (C0) and a Carry out (labeled C4).
S
1 1
2 2
Binary 4-bit sum
3 3
number A 4 4
1
Binary 2
3
number B
4
Input Output
carry C0 C4 carry
Adder: Parallel Adder
Cascading to add more number of bits by using 4-bit adders
• LHS adder for addition of most significant 4 bits addition
• RHS adder for addition of least significant 4 bits addition
Adder: Example
• Input carry to the least significant stage has to ripple through all the adders
before a final sum is produced
Look Ahead Adder
◦ In ripple adder, speed of addition limited by the time required for the
carries to ripple through all the adder stages
◦ One method of speeding up Look-ahead Adder
◦ anticipates the output carry of each stage
◦ produces the output carry by either carry generation or carry propagation