Professional Documents
Culture Documents
Redundant terms.
Boolean function optimization tools.
2
3 .1
1. Redundant terms (don’t care)
Some combinations of input signal values could never occur, or, when they occur,
the output signal values do not matter (don’t care). The corresponding minterms can be
used, or not, in order to optimize the final circuit.
BCD to
7 segment
3
3 .1
1. Redundant terms (don’t care)
EXAMPLE: BCD to 7-segment decoder.
4
3 .1
1. Redundant terms (don’t care)
All redundant terms = 0:
̅ . ̅ . . . ̅ . ̅
̅ . ̅ ̅ . ̅ ̅ . ̅ . ̅ ̅ . .
̅ . ̅ ̅ . ̅ .
̅ . ̅ . ̅ ̅ . ̅ . + ̅ . . ̅
̅ . . ̅ .
̅ . ̅ . ̅ ̅ . . ̅
̅ . ̅ . ̅ ̅ . . ̅ + ̅ . . ̅ . ̅ . ̅
̅ . ̅ . ̅ . . ̅ + ̅ . . ̅ . ̅ . ̅
5
3 .1
1. Redundant terms (don’t care)
̅ . ̅ ̅ . ̅ ̅ . ̅ . ̅ ̅ . .
x3 x2 x1 x0 b c
0 0 0 0 1 1
0 0 0 1 1 1
0 0 1 0 1 0
0 0 1 1 1 1
0 1 0 0 1 1
0 1 0 1 0 1
0 1 1 0 0 1
0 1 1 1 1 1 ̅ ̅ . ̅ .
1 0 0 0 1 1
1 0 0 1 1 1
1 0 1 0 1 0
1 0 1 1 1 1
1 1 0 0 1 1
1 1 0 1 0 1
1 1 1 0 0 1
1 1 1 1 1 1
6
3 .1
1. Redundant terms (don’t care)
̅ . ̅ ̅ . ̅ .
x3 x2 x1 x0 b c
0 0 0 0 1 1
0 0 0 1 1 1
0 0 1 0 1 0
0 0 1 1 1 1
0 1 0 0 1 1
0 1 0 1 0 1
0 1 1 0 0 1 ̅
0 1 1 1 1 1
1 0 0 0 1 1
1 0 0 1 1 1
1 0 1 0 1 0
1 0 1 1 1 1
1 1 0 0 1 1
1 1 0 1 0 1
1 1 1 0 0 1
1 1 1 1 1 1
7
3 .1
1. Redundant terms (don’t care)
̅ . ̅ . . . ̅ . ̅ .
̅ . ̅ ̅ . ̅ ̅ . ̅ . ̅ ̅ . . ̅ ̅ . ̅ .
̅ . ̅ ̅ . ̅ . ̅
̅ . ̅ . ̅ ̅ . ̅ . + ̅ . . ̅ ̅ . ̅ ̅ . + . ̅ . ̅ .
̅ . . ̅ .
̅ . ̅ . ̅ ̅ . . ̅ ̅ . ̅ . ̅
̅ . ̅ . ̅ ̅ . . ̅ + ̅ . . ̅ . ̅ . ̅ ̅ . ̅ . ̅ + . ̅
̅ . ̅ . ̅ . . ̅ + ̅ . . ̅ . ̅ . ̅ ̅ . ̅ . ̅ + . ̅
35 total 26
24 AND 15
7 OR 7
4 INV 26 8
3 .1
2. Synthesis tools
Software tools that optimize switching function representations from
a logic expression,
a table,
and generate the corresponding circuit.
9
3 .1
2. Synthesis tools
10
3 .1
2. Synthesis tools
11
3 .1
2. Synthesis tools
Cube representation:
Define a variable order, for example n-1, n-2, ··· , 1, 0; then a cube is represented by a sequence
of n characters belonging to {0, 1, x}.
Examples (n = 4):
1x01 represents {(x3, x2, x1, x0) ∈ {0, 1}4, x3 = 1, x1 = 0, x0 = 1}; corresponding product: x3·x1· x0.
x1x0 represents {(x3, x2, x1, x0) ∈ {0, 1}4, x2 = 1, x0 = 0}; corresponding product: x2·x0.
Consider the set of 5-variable switching functions f(e, d, c, b, a). Variable order: e, d, c, b, a.
What cube is represented by 1x01x ?
1. . ̅.
2. . . ̅
3. .
4. . ̅.
5. ̅. .
13
3 .1
2. Synthesis tools
2) Adjacency
Consider two cubes (n = 4) 1x11 and 1x01. Assume that the corresponding products
x3· x1· x0 and x3·x1· x0
belong to the representation of some function f:
f = x3· x1· x0 + x3·x1· x0 + ···
As they differ in only one variable (x1 andx1) the representation of f can be simplified:
f = x3· x0 + ···
In terms of cubes: 0x11 ∪ 0x01 = 0xx1.
14
3 .1
2. Synthesis tools
EXAMPLE: f(a,b,c,d) defined by a list of cubes
0010, 0011, 0101, 0110, 0111, 1000
(actually a list of minterms of f)
0010 ∪ 0011 = 001x,
0110 ∪ 0111 = 011x,
0101 ∪ 0111 = 01x1,
15
3 .1
(quiz)
16
3 .1
2. Synthesis tools
LogiSim, Combinational Analysis:
17
2. Synthesis tools 3 .1
̅ ̅ . ̅ .
̅
18
f =a + b ·c + a · b · c + a · d · e
19
3 .1
SUMMARY
Redundant terms and corresponding optimization problem.
Relation between cubes and products of literals.
Tools that minimize Boolean expressions and that optimize circuits.
20
3 .2 Propagation time
Jean-Pierre Deschamps
University Rovira i Virgili, Tarragona, Spain
3 .2
1. Propagation time
Logic gates are electronic components characterized by their propagation time, from
their inputs to their outputs.
22
3 .2
1. Propagation time
Logic gates are electronic components characterized by their propagation time, from
their inputs to their outputs.
a) Logic gate:
a
z
b
23
3 .2
1. Propagation time
b) Combinational circuit (“worst case”)
τ
τ
τ
a = 0, b = x, c = 1 → 0, d = 1, e = 0
24
3 .2
1. Propagation time
To different implementations of the same function correspond different delays. Example:
f=[(a+b).(c+d).e]+[(k+g).(h+i).j] f=e.a.c+e.a.d+e.b.c+e.b.d+j.k.h+j.k.i+j.g.h+j.g.i
25
3 .2
1. Propagation time
To different implementations of the same function correspond different delays. Example:
f=[(a+b).(c+d).e]+[(k+g).(h+i).j] f=e.a.c+e.a.d+e.b.c+e.b.d+j.k.h+j.k.i+j.g.h+j.g.i
26
3 .2
1. Propagation time
To different implementations of the same function correspond different delays. Example:
f=[(a+b).(c+d).e]+[(k+g).(h+i).j] f=e.a.c+e.a.d+e.b.c+e.b.d+j.k.h+j.k.i+j.g.h+j.g.i
# gates = 7 # gates = 9
tp ≈ 3·τ tp ≈ 2·τ
27
3 .2
2. Example: n-bit comparator
xn-1 xn-2 … x1 x0 X n G
yn-1 yn-2 … y1 y0 n Comparator L
Y E
28
3 .2
2. Example: n-bit comparator
xi yi
Gi+1 1-bit
Gi
Li+1 comparator Li
X: 1 0 1 1 0 … 0 0
Y: 1 0 1 0 1 … 1 0
Gn=0
Ln=0
29
3 .2
2. Example: n-bit comparator
xi yi
Gi+1 1-bit
Gi
Li+1 comparator Li
X: 1 0 1 1 0 … 0 0
Y: 1 0 1 0 1 … 1 0
Gn=0 0 0 0 1 1 1 1
Ln=0 0 0 0 0 0 0 0
30
3 .2
2. Example: n-bit comparator
xi yi
X n G
Gi+1 1-bit
Gi
n Comparator L
Li+1 comparator Li Y E
31
3 .2
(Exercise)
Implement a 1-bit comparator
xi yi
Gi+1 1-bit
Gi
Li+1 comparator Li
32
3 .2
(Solution)
Implement a 1-bit comparator
xi yi
Gi+1 Li+1 xi yi Gi Li
0 0 0 0
Gi+1 1-bit
Gi 0 0 0 1
Li+1 comparator Li 0 0 1 0
0 0 1 1
0 1 x x
1 0 x x
1 1 x x
33
3 .2
(Solution)
Implement a 1-bit comparator
xi yi
Gi+1 Li+1 xi yi Gi Li
0 0 0 0 0 0
Gi+1 1-bit
Gi 0 0 0 1 0 1
Li+1 comparator Li 0 0 1 0 1 0
0 0 1 1 0 0
0 1 x x 0 1
1 0 x x 1 0
1 1 x x x x
. .
̅ . ̅.
34
3 .2
2.1. Component: 1-bit comparator
. .
̅ . ̅.
Gi+1 2-bit
Gi
Li+1 comparator Li
36
3 .2
(Solution)
Design a 2-bit comparator
xi xi-1 yi yi-1
Gi+1 2-bit
Gi
Li+1 comparator Li
37
3 .2
(Solution)
Design a 2-bit comparator
xi xi-1 yi yi-1
Gi+1 2-bit
Gi
Li+1 comparator Li
. . . . . . . .
̅ . ̅. ̅ . ̅ . ̅. ̅ . ̅ . .
38
3 .2
2.2. Component: 2-bit comparator
39
3 .2
2.3. n-bit comparator
1bit 2-bit
comparator comparator
#gates 8 14
tp 3 3
40
3 .2
SUMMARY
Propagation time.
Speed vs. Cost.
n-bit comparator: two implementations have been compared.
41
42
3 .3 OTHER LOGIC BLOCKS
Jean-Pierre Deschamps
University Rovira i Virgili, Tarragona, Spain
1. Multiplexers.
3 .3
MUX2-1 control y
(2-to-1 multiplexer ) 0 x0
1 x1
44
1. Multiplexers.
3 .3
typical application:
45
1. Multiplexers.
3 .3
Other multiplexers:
46
1. Multiplexers.
3 .3
c1 c0 y
MUX4-1 00 x0
(4-to-1 multiplexer, 01 x1
2 control signals) 10 x2
11 x3
47
3 .3
(Exercise)
Design a 2-bit 4-to-1 multiplexer using 1-bit 2-to-1 multiplexers.
48
3 .3
(Solution)
Design a 2-bit 4-to-1 multiplexer using 1-bit 2-to-1 multiplexers.
49
3 .3
(Quiz)
Mark the correct statements (MUX=multiplexer)
50
1. Multiplexers.
3 .3
Multiplexers can also be used to implement functions
defined by tables.
Example:
x2 x1 x0 y1 y0
0 0 0 0 0
0 0 1 0 1
0 1 0 0 1
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
51
1. Multiplexers.
3 .3
Example of (trivial) optimization rules:
52
(Exercise) 3 .3
Optimize the preceding circuit.
53
(Solution) 3 .3
Optimize the preceding circuit.
54
1. Multiplexers.
3 .3
Comment
55
2. Multiplexers and memory blocks. 3 .3
Read Only Memory (ROM) blocks have been used to
implement functions defined by a table.
56
2. Multiplexers and memory blocks. 3 .3
Example: 8-variable function
x6
x0x1x2x3x4x5 LUT
1
0 x7
LUT
1
f(x0, x1, ···,x7)
LUT 0
1
0
LUT
57
2. Multiplexers and memory blocks. 3 .3
Example: 8-variable function (with LUTs)
58
2. Multiplexers and memory blocks. 3 .3
Comment
59
3 .3
(Quiz)
How many 6-input LUTs are necessary to synthesize any 10-variable switching
function?
1. 21
2. 32
3. 64
4. 128
60
X9 X8 X7 X6 X5 X4
6
LUT
X3 X2
3 .3
Circuit implementing the 10
variables switching function LUT
LUT
(this slide is not included in the video) LUT
LUT X3 X2
X9 X8 X7 X6 X5 X4 6
LUT
LUT
LUT
LUT X1 X0
LUT
X3 X2
6 LUT
LUT
X9 X8 X7 X6 X5 X4
LUT
LUT
LUT
LUT X3 X2
X9 X8 X7 X6 X5 X4 6
LUT
LUT
LUT
LUT
61
LUT
3. Planes. 3 .3
(n, p) AND-plane: implements
p n-variable functions yj;
62
3. Planes. 3 .3
(p, s) OR-plane: implements
s p-variable functions zj;
Functions zj can be
predefined
defined by the user (field programmable).
63
3. Planes. 3 .3
Any set of s Boolean functions that can be
expressed as Boolean sums of at most p products
of at most n literals can be implemented by a
circuit made up of
an (n, p) AND plane,
a (p, s) OR plane.
64
4. Address decoders and 3-state buffers.
3 .3
x1 x0 y0 y1 y2 y3
0 0 1 0 0 0
0 1 0 1 0 0
1 0 0 0 1 0
1 1 0 0 0 1
65
4. Address decoders and 3-state buffers.
3 .3
Comments Example: 2-variable functions.
An address decoder implements
the same function as an (n, 2n)
AND plane that generates the 2n
n-variable minterms
≡
mj = wj,0wj,1 ··· wj,n-1
66
4. Address decoders and 3-state buffers.
3 .3
Address decoders can be used to
control 3-state buffers.
67
4. Address decoders and 3-state buffers.
3 .3
When x1 x0 =
= example of BUS
Symbol:
68
3 .3
SUMMARY
Multiplexers implement controllable connections.
Multiplexers can also be used to implement Boolean functions.
Small memory blocks (Look Up Tables) are used to implement Boolean functions.
Predefined or field programmable planes are used to implement Boolean functions.
Address decoders and 3-state buffers implement buses.
69
3 .4 PROGRAMMING LANGUAGE
STRUCTURES
Jean-Pierre Deschamps
University Rovira i Virgili, Tarragona, Spain
3 .4
Some classical programming language instructions have a straightforward translation
in terms of digital components. Examples:
71
3 .4
1. If ··· then ··· else ···
Example: a binary decision algorithm.
if x1 = 0 then
if x0 = 0 then f <= y0;
else f <= y1;
end if;
else
if x0 = 0 then f <= y2;
else f <= y3;
end if;
end if;
72
3 .4
2. Case ··· is ···
case x is
when "00" => f <= y0;
when "01" => f <= y1;
when "10" => f <= y2;
when "11" => f <= y3;
end case;
73
3. For ··· loop ··· 3 .4
74
3. For ··· loop ··· 3 .4
cy(0) <= 0;
for i in 0 to 3 loop
-------- loop body --------------------------------
s(i) <= x(i) + y(i) + cy(i);
if s(i) > 9 then z(i) <= s(i) - 10; cy(i+1) <= 1;
else z(i) <= s(i); cy(i+1) <= 0;
end if;
--------------------------------------------------------
end loop;
z(4) <= cy(4);
75
3. For ··· loop ··· 3 .4
Comments.
76
4. Procedure call
3 .4
z = w + x·y.
77
4. Procedure call
3 .4
w(1) <= 0;
for i in 1 to 8 loop
MAC(w(i), x(i), y(i), w(i+1));
end loop;
z <= w(9);
Conclusion:
78
3 .4
5. COMMENTS
79
3 .4
SUMMARY
Binary decision algorithm can be implemented with multiplexers.
Case constructs can also been implemented by multiplexers.
Loops correspond to iterative structures.
Procedure calls correspond to hierarchical descriptions
A conclusion about Hardware Description Languages and Synthesis tools.
80