Chapter #3
Chapter #3
Chapter #3
1
Logic gates types
Logic circuits for digital systems may be:
1- Combinational circuits
2- Sequential circuits
Combinational circuits
3
Sequential circuits
Sequential circuits employ storage elements in
addition to logic gates. Their outputs are a function of
the inputs and the state of the storage elements.
The state of storage elements, in turn, is a function of
previous inputs.
As a consequence, the outputs of a sequential circuit
depend not only on present values of inputs, but also
on past inputs, and the circuit behavior must be
specified by a time sequence of inputs and internal
state.
4
Examples of combinational circuits
5
Examples of combinational circuits
6
More basic gates – Very popular
NAND – Not AND
NOR – Not OR
7
Complex Logic Gates
XOR – Exclusive OR
F = XY’ + X’Y
= X Y
8
Complex Logic Gates
XNOR – Exclusive NOR
F = XY + X’Y’
= X Y
9
More complex logic gates
AND-OR-INVERT (AOI)
F=(AB+CD)’
OR-AND-INVERT (OAI)
F = ( (W+X)(Y+Z) )’ W
F=((W+X)(Y+Z))’
X
Y
Z 10
And some more complex gates
AND-OR
F = AB + CD
OR-AND
F = (W+X)(Y+Z) W
X
F=(W+X)(Y+Z)
Y
Z
11
Identities of the XOR operation
The following identities apply to the XOR
operation:
X 0 = X X 1 = X’
X X = 0 X X’ = 1
X Y’ = (X Y)’
X’ Y = (X Y)’
3-variable map
Z=X Y Z
14
XOR K-maps (continued)
4-variable map
Z=W X Y Z
15
Iterative Circuits
The concept – Create a functional block and
create the circuit for doing the multiple bit
operation by simply repeating it.
Iterative connection.
17
Iterative circuit area
A lot in arithmetic area of application.
Adders
Subtractors
Incrementors
Decrementors
Multiplication circuits
18
Half Adder
Design procedure: Design circuit to calculate 1+0
1) State Problem
Example: Build a Half Adder to add two bits
2) Determine and label the inputs & outputs of circuit.
Example: Two inputs and two outputs labeled, as
follows:
X Y C S
X Half S 0 0 0 0
0 1 0 1
Y Adder C 1 0 0 1
(X + Y) 1 1 1 0
20
Half Adder
The half adder is an example of a simple, functional
digital circuit built from two logic gates.
A half adder adds two one-bit binary numbers A
and B (two inputs). It has two outputs ,S and C (the
value theoretically carried on to the next addition);
The simplest half-adder design, shown in fig. 3,
incorporates an XOR gate for S and an AND gate for
C. S Sum, C carry
Half adders cannot be used compositely, given their
incapacity for a carry-in bit.
21
Half Adder
C=xy S=x’y+xy’=
X AND y
x XOR y
22
Half-Adder
23
Full Adder
Half-adder adds up only two bits.
To add two binary numbers, we need to add 3 bits
(including the carry).
Example: 1
0
1
0
1
1 1
carry
X
+ 0 1 1 1 Y
1 0 1 0 S
form: YZ
S
X
00 01 11 10
C = X.Y + X.Z + Y.Z 0 1 1
S = X'.Y'.Z + X'.Y.Z'+X.Y'.Z'+X.Y.Z
1 1 1
25
Full Adder
Alternative formulae using algebraic manipulation:
C = X.Y + X.Z + Y.Z
= X.Y + (X + Y).Z
= X.Y + ((XY) + X.Y).Z
= X.Y + (XY).Z + X.Y.Z
= X.Y + (XY).Z
26
Full Adder
Circuit for above formulae:
C = X.Y + (XY).Z
S = (XY)Z
X (XY)
Y S
(XY)
Z
Full Adder made from two Half-Adders (+ OR gate).
27
Full Adder
Circuit for above formulae:
C = X.Y + (XY).Z
Block diagrams.
S = (XY)Z
X (XY)
X Sum X
Y Y Sum S
Y
Half Half
Adder Adder
(X.Y)
Carry Carry
C
Z
Full Adder made from two Half-Adders (+ OR gate).
28
The full adder
Have just seen a full adder implemented from the
structural connection of two half adders and an OR
gate.
Can do a direct implementation. It will end up with
the same number and type of gates.
For a multibit implementation need a symbol for the
unit.
29
Multibit use
And then can use that symbol in multibit or
hierarchical representations.
1 0 1 1
A 2 bit example 0
1 11 (A)
0 1 01 (B)
------
0 0 1 00
In this adder the final output carry is
generated in the final stage after the carry
inputs to all the previous stages has settled.
30
Carry ripple
So the carry ripples from the lsb to msb A
ripple carry adder.
34
Overflow
When adding 2 n-bit numbers it is possible to
get a n+1 bit result if there is a carry out.
On paper it is easy just add another bit.
In 2’s complement add a msb 0 for a positive
or a msb 1 for a negative.
.
37
Incrementer
Often just want to increment the value by 1
and that is the only operation needed.
An incrementer is a circuit that is much
simpler than an adder.
Start with the equations:
SUM = A xor B xor Cin
Cout = AB +Cin (A xor B )
38
Incrementer
Often we just want a circuit to create the value
+1 each time.
The circuit is a significant simplification.
Start with the equations for general addition
Sum = A B Cin
Cout = AB +Cin (A xor B )
Now if B = 0 these reduce to
IncSum = A Cin
Inc Carry= Cout = A*0 +Cin (A xor 0 )= ACin
A Half Adder!!!
39
Implementation
A increment unit
41
The circuit
And again, can do a dedicated circuit
42