EE204 Lecture 3
EE204 Lecture 3
Logic Circuits
Combinational Circuits
Avni Morgül
Combinational Logic
INTRODUCTION
• Logic circuits for digital systems may be combinational or sequential.
• A combinational circuit consists of logic gates whose outputs at any
time are determined from only the present combination of inputs.
• Performs an operation that can be specified by a set of Boolean functions.
• Sequential circuits employ storage elements in addition to logic
gates.
• Their outputs are a function of the present inputs and the previous inputs
which are stored in the storage elements.
Combinational Logic
• Consists of an interconnection of logic gates.
• There are several combinational circuits that are used extensively in the design of digital
systems. These circuits are called standard components, such as adders, subtractors,
comparators, decoders, encoders, and multiplexers. These components are available in
integrated circuits as medium-scale integration (MSI) circuits.
ANALYSIS PROCEDURE
• Determination of the function of a given logic diagram. The analysis can be
performed manually by finding the Boolean functions by using truth table or by
using a computer simulation program.
• To obtain the output Boolean functions from a logic diagram:
1. Label all gate outputs that are a function of input variables with arbitrary
symbols with meaningful names. Determine the Boolean functions for each
gate output.
2. Label the gates that are a function of input variables and previously labeled
gates. Find the Boolean functions for these gates.
3. Repeat the process outlined in step 2 until the outputs of the circuit are
obtained.
4. By repeated substitution of previously defined functions, obtain the output
Boolean functions in terms of input variables.
Example
A T2
B
C F1
Step 1:
A T1
F2 = AB + AC + BC B
C T3
T1 = A + B + C F2
T2 = ABC A
B
A
F2
C
B
C
Obtaining the truth table directly from the logic diagram
• To obtain the truth table directly from the logic diagram without going
through the derivations of the Boolean functions, proceed as follows:
1. Determine the number of input variables in the circuit. For n inputs,
form the 2n possible input combinations and list the binary numbers
from 0 to (2n - 1) in a table.
2. Label the outputs of selected gates with arbitrary symbols.
3. Obtain the truth table for the outputs of those gates which are a
function of the input variables only.
4. Proceed to obtain the truth table for the outputs of those gates
which are a function of previously defined values until the columns
A T2
for all outputs are determined. B
C F1
A T1
AB AB B
C T3
C 00 01 11 10 C 00 01 11 10 F2
0 0 1 0 1 0 0 0 1 0 A
B
1 1 0 1 0 1 0 1 1 1 A
F2
C
𝐹1 = 𝐴ҧ 𝐵𝐶
ത F+ 𝐴𝐵ҧ 𝐶ҧ + 𝐴𝐵ത 𝐶ҧ + 𝐴𝐵𝐶
1 = ABC+ABC+ABC+ABC
𝐹F22 =
= AB+AC+BC
𝐴𝐵 + 𝐴𝐶 + 𝐵𝐶 B
C
DESIGN PROCEDURE
The design of combinational circuits means obtaining the logic diagram
of a logic function.
• The procedure involves the following steps:
1. From the specifications of the circuit, determine the required number of
inputs and outputs and assign a symbol to each.
2. Derive the truth table that defines the required relationship between inputs
and outputs.
3. Obtain the simplified Boolean functions for each output as a function of the
input variables.
4. Draw the logic diagram and verify the correctness of the design (manually or
by simulation).
Example: Code Conversion
Different codes are used by different digital systems.
A code conversion circuit may be required to be inserted
between the two systems.
The design procedure will be illustrated by an example that
converts binary coded decimal (BCD) to the excess-3
code (a self-complement code) for the decimal digits.
D z
D CD
ഥ
• 𝑧=𝐷 Common terms C y
• 𝑦 = 𝐶𝐷 + 𝐶ҧ 𝐷
ഥ C+D
C+D
ത + 𝐵𝐷
• 𝑥 = 𝐵𝐶 ത + 𝐵 𝐶ҧ 𝐷
ഥ = 𝐵ത 𝐶 + 𝐷 + 𝐵(𝐶 + 𝐷)
• 𝑤 = 𝐴 + 𝐵𝐶 + 𝐵𝐷 = 𝐴 + 𝐵(𝐶 + 𝐷) B
x
w
A
Adders Subtractors
• The most basic arithmetic operation is the addition of two binary digits.
• Addition consists of four possible elementary operations:
0+0= 0
ADDER
Number A Sum S=A+B
0+1= 1
1+0= 1 Number B Carry C
1 + 1 = 10
• The first three operations produce a sum of one digit, but when both bits are 1, the sum
consists of two digits.
• The higher significant bit of result is called a carry.
• A combinational circuit that performs the addition of two bits is called a half adder .
• The addition of three bits (two significant bits and a previous carry) is performed by a full
adder .
Half-Adder
• The input variables designate the augend and addend bits; the
output variables produce the sum (S) and carry (C). The C
output is 1 only when both inputs are 1.
• The simplified sum-of-products expressions are
Full-Adder
A full-adder is a combinational circuit that forms the arithmetic
sum of three bits. It consists of three inputs and two outputs.
The third input, z , represents the carry from the previous adder
block. So, full-adders can be cascaded!
Addend 0 0 1 1 Bi
A0 B0 A1 B1 A2 B2 A3 B3
Sum 1 1 1 0 Si
Output carry 0 0 1 1 Ci+1
Carry Propagation
• The addition of two binary numbers implies that all the bits of the augend,
addend and carry are available for computation at the same time. But, in any
combinational circuit, the signal must propagate through the Gates.
• The total propagation time is equal to the propagation delay of a typical gate
times the number of gate levels in the circuit. The longest propagation delay is
the time for the carry to propagate.
• For an n-bit adder, there are 2n gate levels for the carry to propagate from
input to output
Half Ader Half Ader
Pi (Pi + Ci)
Ai
Bi Si
Gi PiCi+Gi
Ci+1
Ci
Lookahead Carry Generator
Half Ader Half Ader
Pi (Pi + Ci)
Ai
Bi Si
Gi PiCi+Gi
Ci+1
Ci (2-gate delay)
In the circuit of the full adder shown above we define two new binary variables
Look-ahead Carry Generator
Now lets re-write the Boolean functions for the carry outputs of each stage
Half Ader Half Ader
Pi (Pi + Ci)
Ai
Bi Si
Gi PiCi+Gi
Ci+1
Ci
A0 S0 S1 S2
A1 A2
B0 FA0 B1 FA1 B2
FA1 FA2
C0 = input carry C0 C1 C2 C3
Half
Adder
(A=B) = x3 x2 x1 x0
(A>B) = A3B’3 + x3 A2B’2 + x3 x2 A1B’1 + x3 x2 x1 A0B’0
(A<B) = A’3B3 + x3 A’2B2 + x3 x2 A1B’1 + x3 x2 x1 A0B’0
DECODER/ENCODER
3 to 8 Line Decoder Octal-to-Binary Encoder
𝐷0 = 𝑥ҧ 𝑦ത𝑧ҧ D0
z 𝐷1 = 𝑥ҧ 𝑦ത𝑧
D1
8 to 3
x
. y
ENCODER
. z
𝐷2 = 𝑥ҧ 𝑦𝑧ҧ .
D7
y
𝐷3 = 𝑥ҧ 𝑦𝑧
x 𝐷4 = 𝑥𝑦ത𝑧ҧ
𝐷5 = 𝑥𝑦ത𝑧
𝐷6 = 𝑥𝑦𝑧ҧ
𝐷7 = 𝑥𝑦𝑧
Priority Encoder
The priority encoder identifies a particular input
when several inputs are high (logic 1). Such as: D2 D1 D0 x y
D2 : Highest priority input. Encoded to xy = 01
D1 : Middle priority input. Encoded to xy = 10 0 0 0 0 0 inactive
D0 : Lowest priority input. Encoded to xy = 11 0 0 1 1 1 D0
Inactive state xy = 00
The xy outputs may be selected differently than this example.
0 1 0 1 0
D1
0 1 1 1 0
1 0 0 0 1
1 0 1 0 1
D2
1 1 0 0 1
D0 1 1 1 0 1
D0
D1 D1 y
x
D2 D2
Quiz
Design a 3-input priority encoder such that
• D2: The highest priority xy = 11
• D1: Middle priority xy = 01
• D0: The lowest priority xy = 10
• Inactive State xy = 00
Here D2, D1, D0 are the inputs and xy are the outputs of the encoder.
Lecture 5: MULTIPLEXERS (MUX)
A multiplexer is a combinational circuit that selects binary information from one
of many inputs. The selection of a particular input line is controlled by a set of
selection lines. There are 2n input lines and n selection lines.
00 I0
I0
I1 01 output
Y I1 4x1
I2
10 inputs Y
11 I2 MUX
I3 S1S0
I3
S1 S0
4x1 Multiplexer Circuit
Y = I0 S1 S0 = 00
Y = I1 S1 S0 = 01
Y = I2 S1 S0 = 10
Y = I3 S1 S0 = 11
Boolean Function Implementation
by using a MUX
An n variable logic function may be implemented with a multiplexer that has
n selection inputs and 2n data inputs, one for each minterm.
I0 I1 I2 I3 I0 I1 I2 I3 I4 I5 I6 I7
C=0 0 2 4 6 D=0 0 2 4 6 8 10 12 14
C=1 1 3 5 7 D=1 1 3 5 7 9 11 13 15
D 0 1 D’ 0 0 D’ 1
F2
0 C 1 C’
F1
Implementation with Read-Only-Memory (ROM)
An n input decoder generates 2n minterms. Any of these minterms may be added by using
multy-input OR Gates to sum the minterms and generate any desired function. Any number
(m) of outputs may be obtained simultaneously.
ROM Size = 2n x m
Programmable Logic Array (PLA)
Field Programmable Gate Arrays (FPGA)
• A combinational circuit usually have Don’t Care conditions. These conditions become an
address input that will never ocur. So, it is a waste of available equipment if a ROM is
used when Don’t Care conditions are excessive.
• In that case it is more convenient to use another LSI (Large Scale Integrated circuit)
component called PLA.
• In PLA the decoder of ROM is replaced by a group of AND Gates. The logic function is
generated in SOP form.
• A PLA has n-inputs, m-outputs, k-product terms and m-sum terms.
m
nxk kxm
k-product links m-sum
terms terms m
(AND (OR m outputs
Gates) Gates) links
n-inputs nxk
links
Programming a PLA
• To program a PLA (or FPGA)
1.
The output functions and their complements are obtained using Karnaugh maps.
2.
All product terms and outputs are listed in a table
The minimum number of distinct product terms is found for output F and its invers F’
3.
4.
Necessary connections are done
AB AB
• Example: C 00 01 11 10
0 0 0 1 0
C 00 01 11 10
0 1 1 0 1
1 0 1 1 1 1 0 0 1 0
ABC F2 = AC+BC+ABC
QUIZ
• Write the value of each input of the multiplexer (Ii), to implement
the following function:
F(ABC) = (1,4,5,6) =A’B’C+AB’C’+AB’C+ABC’
C I0
4x1
I1 MUX
Y F
I2
I3 S1 S0
A B