Combinational Logic
Combinational Logic
Combinational Logic
Logic
En Amir
gr. Habib
Lecturer
UOM
Pakistan
Department of Software
Engineering
3
Combinational
logic
The logics gate accept signals from the
inputs and signals to the
generate
outputs.
This process transforms binary information
from theinput data to the required output
given
data.
Combination logi
Design Procedures al c
Starts from the verbal outline of the an
problem ends in a logic circuit d
diagram.
The procedure involves the following
step,
The problem is stated.
8
Combinational
Half
logic
Adder
The half-adder accepts two binary digits on its
inputs
and produces two binary digits on its outputs,
a sum bit and a carry bit.
The truth table look like this,
A B Cout S
0 0 0 0
0 1 0 1
1 0 0 1
1 1 1 0
Combinational
Half logic
Adder
A half-adder represente by th logi symb in
is Figur below d e c ol
e ,
Department of Computer 10
Science
Half
Adder
Half-Adder Logic
Notice that the output Carry (Cout) is a 1 only
when
both A and B are 1s; Cout can be
therefore
as the AND of the input expressed
variables.
C out =
11
Related
Example
Half-Adder Logic
The logic implementation required for the half
adder
function can be developed.
The output carry is produced with an AND
gate with
A and B on the inputs.
The sum output is generated with an
exclusive-OR
gate.
Half
Adder
Half-Adder Logic
diagram
Solution
s
Full
Adder
Full
Adder
The second category of adder is the full-adder.
The full-adder accepts two input bits and an
input carry and generates a sum output
and an output carry.
The basic difference between a full-adder
and a half-
adder is that the full-adder accepts an input
carry.
Full
Adder
Logical symbol for full
adder is,
Full Adde
Trut Tabl r
h e
C= xy + xz +
yz
Implementati of Full Adde in SO
on r P
Logic
Diagram
Implementation of Full
Adder
Implementation of a full adder with two half
adders
and an OR Gate
Adder
s
Proble
m
For each of the three full-adders in
Figure
below, determine the outputs for the
inputs
shown.
Solutio
n
Qui
z
Parallel Binary
Adders
Two or more full-adders are connected to
form
parallel binary
adders.
a single full-adder is capable of adding two
1-bit
numbers and an input
carry.
To add binary numbers with more than
one
youbit,
must use additional full-
adders.
When one binary number is added to
another,
each column generates a sum bit and a
1 or 0
carry bit to the next column to the left.
Parallel Binary
Adder
To add two binary numbers, a full-adder is
required for
each bit in the numbers.
So for 2-bit numbers, two adders are needed.
For 4-bit numbers, four adders are used; and
so on.
The carry output of each adder is connected
to the
for the least significant position or the carry a
carry input of the next higher-order adder.
input of is
Notice thatcan
full-adder either a half-adder
be made can bebecause
0 (grounded) used
there
no carry input to the least significant bit
position.
Parallel Binary
Adder
Parallel Binary
Adder
In Figure the least significant bits (LSB)
oftwo
thenumbers are represented by A1 and B1.
The next higher-order bits are
represented
A2 and B2 . by
The three sum bits are Σ1,Σ2 and Σ3.
Notice that the output carry from the left-
most
full-adder becomes the most
significant bit
(MSB) in the sum, Σ3.
Exampl
Determine the sum generated by e
the
3-bit
parallel adder and show the intermediate
carries
when the binary numbers 101 and 011
are
being added.
Four Bit Parallel
Adder
A group of four bits is called a nibble.
A basic 4-bit parallel adder is
implemented with
four full-adder stages as shown in
Figure .
Logical Symbol for 4 bit Parallel
Adder
4 bit parallel
adder
The input labeled Co is the input carry
toleast
the significant bit
adder.
C4 in the case of four bits, is the output carry of
D=x’ y + x
y’
B=x’ y
Proble
m
Draw a circuit diagram against Difference
D Borrow
and
B.
Full
Subtractor
It performs a subtraction between two
bits,
taking in to account that a 1 may have
been borrowed by a lower significant
stage.
It has three inputs and two outputs.
Three inputs x, y and z shows the
minuend,
subtrahend and previous borrow
respectively.
B and D represents the output borrow
and
Full
Subtractor
Truth table is as
under,
Full
Subtractor
The function against B and D
are,
Code
conversion
Some times the output of the one system
asinput
the to
another.
If both the system uses different coding
system,
then code convertor is needed between
them.a code convertor is a circuit that
Thus
makes
the two system
compatible.
To convert from binary code A
to B,Input lines supply the bit combination of by
elements
Code A and the output lines must
generate the corresponding bit
combination for code B.
46
Code conversion BC to Exces 3 is
from
illustrate below D s
d ,
47
Output Simplificati
s on
48
Circui Diagra
t m
49
Binar to Gra cod
y y e
50
Gra to Binar
y y
51
Q?
Related Problem
How many exclusive- gate ar require to conver 8-
binar
OR to Gray s e d t bit
y ?
52
53