Download as pdf or txt
Download as pdf or txt
You are on page 1of 36

University Of Gondar

Institute of Technology
Department of Electrical and Computer
Engineering
Digital Logic Design
Instructor: Enanwo W.
Chapter Five
Combinational Logic
Combinational logic
A combinational circuit is the digital logic circuit in which
the output depends on the combination of inputs at that point
of time with total disregard to the past state of the inputs.
The digital logic gate is the building block of combinational
circuits.
On the other hand, sequential logic circuits, consists of both
logic gates and memory elements such as flip-flops

UOG, Department of
Electrical and Computer 2
Engineering
Adders
◼ Addition is an important process in digital
systems, especially computers.
◼ There are two types of basic adders:
❑ Half Adder
Simple Binary Addition
❑ Full Adder
0+0= 0
0+1= 1
1+0= 1
1 + 1 = 10

UOG, Department of
Electrical and Computer 3
Engineering
Half Adders
◼ Half adder: Is a circuit that add two binary digits
and produce a sum bit and a carry bit.

A A B

+ B
Half Adder
CoS Circuit

Carry Sum CO S

UOG, Department of
Electrical and Computer 4
Engineering
A half-adder is represented by the
logic symbol in Figure below

Logic symbol for a half-adder


Half Adders
Truth table: Equation:
A B CO S
S =A B
0 0 0 0
0 1 0 1 CO=AB
1 0 0 1
1 1 1 0
A
S
B

Logic Circuit:
CO

UOG, Department of
Electrical and Computer 6
Engineering
Full Adders
◼ Since half adder cannot handle crisis when there
is an input carry from previous bit, we need to use
a full adder.
◼ Full adder: circuit that adds two binary numbers
with the existence of a carry in bit. It produces a
sum and a carry out. A B
Cin
A Full Adder
+ B Circuit Cin

Co S
Carry Sum CO S
UOG, Department of
Electrical and Computer 7
Engineering
Full Adders
Truth table: Equation:
A B Cin CO S
0 0 0 0 0 S = ABC i n + ABC i n + A B C i n + ABC i n
= A B  C
0 0 1 0 1
C o = ABC i n + ABC i n + ABC i n + ABC i n
0 1 0 0 1 = AB + Cin ( A  B)

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 Logic symbol for a full-adder.
UOG, Department of
Electrical and Computer 8
Engineering
Complete logic circuit for a full-adder (each
half-adder is enclosed by a shaded area)

UOG, Department of
Electrical and Computer
Engineering
Full Adders
◼ Full adder circuit can also be implemented using 2
half adders.

UOG, Department of
Electrical and Computer 10
Engineering
Full Adders

UOG, Department of
Electrical and Computer 11
Engineering
Parallel BinaryAdder
◼ Two bit adder

UOG, Department of
Electrical and Computer 12
Engineering
Parallel BinaryAdder
◼ A group of 4 bits is called a Nibble.
◼ Four bit parallel adder.

UOG, Department of
Electrical and Computer 13
Engineering
Parallel BinaryAdder

UOG, Department of
Electrical and Computer 14
Engineering
Parallel BinaryAdder
◼ Parallel adders can be placed in to two categories
based on the way in which the internal carries
from stage to stage are handled.
❑ Ripple carry adder
❑ Look-ahead carry adder
◼ Externally, both types of adders are the same in
terms of inputs and outputs.
◼ The difference is the speed at which they can add
numbers. The look-ahead carry adder is much
faster than ripple carry adder.
UOG, Department of
Electrical and Computer 15
Engineering
Ripple Carry Adder
◼ In ripple carry adder, the second full adder (FA2) needs to
wait for the input carry (Cin), coming from the output carry
(Cout) from first adder (FA1).
◼ Assume one adder has a delay of 8 ns. 4 adders will
contribute to 32 ns delay in adding up the 4 bits number .

UOG, Department of
Electrical and Computer 16
Engineering
Look-Ahead Carry Adder
◼ The objective of the adder is to reduce the adder’s delay in
performing the addition. This is because, the input carry
and output carry is dependent on the input’s value of the
adder itself.
◼ No propagation delay from one adder to the other.

UOG, Department of
Electrical and Computer 17
Engineering
4 Bit 2’s ComplementerCircuit

UOG, Department of
Electrical and Computer 18
Engineering
4 Bit Adder Subtractor

UOG, Department of
Electrical and Computer 19
Engineering
Comparator
◼ Comparator is a device that compares two digital
quantities to determine the relationship of those
quantities.
◼ Comparison is made in terms of:
❑ Equal to ‘=’
❑ Less than ‘<’
❑ Greater than ‘>’
◼ The function of a comparator is to compare either
the input bit is the same as the reference bit or
not.
◼ It can be a 1-bit, 2-bit or 4-bit comparator.
UOG, Department of
Electrical and Computer 20
Engineering
Comparator
◼ 1 bit comparator

The output is 1 when the inputs are equal.

A B X
0 0 1
0 1 0 Equals to X-NOR

1 0 0
1 1 1
UOG, Department of
Electrical and Computer 21
Engineering
Comparator
◼ 2 bit comparator
The output is 1 when A0 = B0 AND A1 = B1.

UOG, Department of
Electrical and Computer 22
Engineering
Comparator
◼ 4 bit comparator.

UOG, Department of
Electrical and Computer 23
Engineering
Decoder
◼ Circuit that:
❑ Accepts a set of inputs (binary number /code) and
❑ Activates the only output that corresponds to that
particular input.
◼ Types of decoders:
❑ Binary decoder
❑ 3-bit decoder
❑ 4-bit decoder
❑ BCD-to-decimal decoder
❑ BCD-to-7-segment decoder
UOG, Department of
Electrical and Computer 24
Engineering
Binary Decoder
◼ Is used to determine if a specific binary number
occurs or not in a digital circuitry.

The output is 1 only when:


A0 =1
A1 =0
A2 =0
A3 =1

Decoding logic for the binary code 1001 with an active-HIGH output.
UOG, Department of
Electrical and Computer 25
Engineering
3-Bit/Binary to Octal Decoder
◼ The decoder converts standard 3-bit binary into one octal
high output at a time.
Enable Data input Active high data outputs
EN2 EN1 C B A X0 X1 X2 X3 X4 X5 X6 X7
1 1 0 0 0 1 0 0 0 0 0 0 0
1 1 0 0 1 0 1 0 0 0 0 0 0
1 1 0 1 0 0 0 1 0 0 0 0 0
1 1 0 1 1 0 0 0 1 0 0 0 0
1 1 1 0 0 0 0 0 0 1 0 0 0
1 1 1 0 1 0 0 0 0 0 1 0 0
1 1 1 1 0 0 0 0 0 0 0 1 0
1 1 1 1 1 0 0 0 0 0 0 0 1
0 X X X X 0 0 0 0 0 0 0 0
X 0 X X X 0 0 0 0 0 0 0 0

UOG, Department of
Electrical and Computer 26
Engineering
3-Bit/Binary to Octal Decoder

UOG, Department of
Electrical and Computer 27
Engineering
3-Bit Active-LowDecoder
Enable Data input Active high data outputs
EN2 EN1 C B A X0 X1 X2 X3 X4 X5 X6 X7
0 0 0 0 0 0 1 1 1 1 1 1 1
0 0 0 0 1 1 0 1 1 1 1 1 1
0 0 0 1 0 1 1 0 1 1 1 1 1
0 0 0 1 1 1 1 1 0 1 1 1 1
0 0 1 0 0 1 1 1 1 0 1 1 1
0 0 1 0 1 1 1 1 1 1 0 1 1
0 0 1 1 0 1 1 1 1 1 1 0 1
0 0 1 1 1 1 1 1 1 1 1 1 0
1 X X X X 1 1 1 1 1 1 1 1
X 1 X X X 1 1 1 1 1 1 1 1

UOG, Department of
Electrical and Computer 28
Engineering
3-Bit Active-LowDecoder

UOG, Department of
Electrical and Computer 29
Engineering
4-Bit Decoder
Input Output
D C B A X
0 0 0 0 X0
0 0 0 1 X1

Also called 0 0 1 0 X2
0 0 1 1 X3
binary to 0 1 0 0 X4
hexadecimal 0 1 0 1 X5

decoder. 0 1 1 0 X6
0 1 1 1 X7
1 0 0 0 X8
1 0 0 1 X9
1 0 1 0 X10
1 0 1 1 X11
1 1 0 0 X12
1 1 0 1 X13
1 1 1 0 X14
1 1 1 1 X15

UOG, Department of
Electrical and Computer 30
Engineering
BCD to Decimal Decoder
◼ Act the same as a 4-bit decoder but limited to 10 decimal
digits only

Input Output
D C B A X0 X1 X2 X3 X4 X5 X6 X7 X8 X9

0 0 0 0 1 0 0 0 0 0 0 0 0 0
0 0 0 1 0 1 0 0 0 0 0 0 0 0
0 0 1 0 0 0 1 0 0 0 0 0 0 0
0 0 1 1 0 0 0 1 0 0 0 0 0 0
0 1 0 0 0 0 0 0 1 0 0 0 0 0
0 1 0 1 0 0 0 0 0 1 0 0 0 0
0 1 1 0 0 0 0 0 0 0 1 0 0 0
0 1 1 1 0 0 0 0 0 0 0 1 0 0
1 0 0 0 0 0 0 0 0 0 0 0 1 0
1 0 0 1 0 0 0 0 0 0 0 0 0 1

UOG, Department of
Electrical and Computer 31
Engineering
BCD-to-7 Segment Decoder
◼ Output of the decoder is active Low, therefore, common
anode 7-segment display is used.

UOG, Department of
Electrical and Computer 32
Engineering
BCD-to-7 Segment Decoder
◼ If Active High;

UOG, Department of
Electrical and Computer 33
Engineering
Encoder
◼ It works opposite ways from decoders.
◼ Circuit that allows only one input to be activated,
and produces an N-bit output code, depending on
which input is activated.
◼ Common encoders:
❑ 8-line-to-3-line encoder
❑ Decimal-to-BCD encoder

UOG, Department of
Electrical and Computer 34
Engineering
8-Line-to-3-Line Encoder
◼ Octal to binary converter: Octal input is applied by pressing
one of the push buttons at a time. Circuit converts the applied
input to a binary at the output, X.

UOG, Department of
Electrical and Computer 35
Engineering
Decimal-to-BCD Encoder
◼ Also called 10-Line-to-4-Line converter.

UOG, Department of 36
Electrical and Computer
Engineering

You might also like