advanced digital logic design – eecs 303 homework...
TRANSCRIPT
Advanced Digital Logic Design – EECS 303
http://ziyang.eecs.northwestern.edu/eecs303/
Teacher: Robert DickOffice: L477 TechEmail: [email protected]: 847–467–2298
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
Today’s topics
Can use today’s class for Q&A
PALs/PLAs
Review, Q&A on MOS transistors
Multiplexers, Demultiplexers
Transmission gates
Perl/Python
3 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
Lab two
Lab two is more substantial than lab one
If you find a problem and figure out the solution, yourself, pleasesend me an email or post to the newsgroup
Don’t think you’ll be able to fully understand the effects all theSIS commands, options, and sequences will have
If you have a basic understanding of how to get reasonably goodresults with the software, that’s good
4 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
Midterm exam
Suggesting 21 or 23 October
5 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
PALs and PLAsCMOS for logic gatesTransmission gates and MUXs
Programmable arrays of logic gates
We have considered implementing Boolean functions usingdiscrete logic gates
NOT, AND, OR, NAND, NOR, XOR, and XNOR
Can arrange AND and OR gates (or NAND and NOR gates) intoa general array structure
Program array to implement logic functions
Two popular variants
Programmable logic arrays (PLA) and programmable array logic(PAL)
8 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
PALs and PLAsCMOS for logic gatesTransmission gates and MUXs
PALs and PLAs
Pre-fabricated building block of many AND and OR (or NANDand NOR) gates
“Personalized” (programmed) by making or breaking connectionsamong the gates
9 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
PALs and PLAsCMOS for logic gatesTransmission gates and MUXs
SOP programmable array block diagram
inputs
productterms
Dense arrayof ANDs
outputs
Dense arrayof ORs
10 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
PALs and PLAsCMOS for logic gatesTransmission gates and MUXs
PLAs efficiency
PLAs can share terms – Share product terms
Consider the following set of functions
f0 = a + b c
f1 = ac + ab
f2 = b c + ab
f3 = b c + a
Personality matrixProduct Input Output
term a b c f0 f1 f2 f3ab 1 1 X 0 1 1 0
b c X 0 1 0 0 0 1ac 1 X 1 0 1 0 0
b c X 0 0 1 0 1 0a 1 X X 1 0 0 1
11 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
PALs and PLAsCMOS for logic gatesTransmission gates and MUXs
PLA programming
All connections available
All exist
Some removed
None exist
Connections made
12 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
PALs and PLAsCMOS for logic gatesTransmission gates and MUXs
PLA programming
abc d +bc d
bc d +abc d
abc d
ab +bc d
abc d
bc d
abc d
ab
ab
b c da
13 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
PALs and PLAsCMOS for logic gatesTransmission gates and MUXs
PLA diagram shorthand
abc d +bc d
bc d +abc d
abc d
ab +bc d
abc d
bc d
abc d
ab
ab
b c da b c da
14 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
PALs and PLAsCMOS for logic gatesTransmission gates and MUXs
Shorthand – Draw subset of wires
abc d +bc d
bc d +abc d
abc d
ab +bc d
abc d
bc d
abc d
ab
ab
b c da
15 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
PALs and PLAsCMOS for logic gatesTransmission gates and MUXs
PAL/PLA differences
PAL
Only the AND array is programmable
A column of the OR array only has access to a subset of theproduct terms
Generally, no sharing of product terms
PLA
A column has access to any desired product terms
Can share product terms
16 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
PALs and PLAsCMOS for logic gatesTransmission gates and MUXs
PAL/PLA differences
b c da
17 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
PALs and PLAsCMOS for logic gatesTransmission gates and MUXs
BCD-Gray code converter
A B C D W X Y Z0 0 0 0 0 0 0 00 0 0 1 0 0 0 10 0 1 0 0 0 1 10 0 1 1 0 0 1 00 1 0 0 0 1 1 00 1 0 1 1 1 1 00 1 1 0 1 0 1 00 1 1 1 1 0 1 11 0 0 0 1 0 0 11 0 0 1 1 0 0 01 0 1 0 X X X X1 0 1 1 X X X X1 1 0 0 X X X X1 1 0 1 X X X X1 1 1 0 X X X X1 1 1 1 X X X X
18 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
PALs and PLAsCMOS for logic gatesTransmission gates and MUXs
BCD-Gray code converter
AB
CD 00 01 11 10
00
01
11
10
D
B
C
A
0 0 X 1
0 1 X 1
0 1 X X
0 1 X X
WAB
CD 00 01 11 10
00
01
11
10
D
B
C
A
A
0 1 X 0
0 1 X 0
0 0 X X
0 0 X X
AB
CD 00 01 11 10
00
01
11
10
D
B
C
A
0 1 X 0
0 1 X 0
1 1 X X
1 1 X X
YAB
CD 00 01 11 10
00
01
11
10
D
B
C
X
0 0 X 1
1 0 X 0
0 1 X X
1 0 X X
Z
19 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
PALs and PLAsCMOS for logic gatesTransmission gates and MUXs
Minimized BCD-Gray functions
W = A + BD + BC
X = BC
Y = B + C
Z = AB C D + BCD + AD + B CD
20 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
PALs and PLAsCMOS for logic gatesTransmission gates and MUXs
BCD-Gray discrete logic
2
2
1
4
4
3
3
5
1
3
2 1
2
1
(2, 5) 7400 four NAND2
(1) 7404 six inverter
(3) 7410 three NAND3
(4) 7420 two NAND4
1
4
2
21 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
PALs and PLAsCMOS for logic gatesTransmission gates and MUXs
BCD-Gray PAL
C DBA
0
00
00
00
00
00
0
W ZYX
22 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
PALs and PLAsCMOS for logic gatesTransmission gates and MUXs
Comparator example
Determine whether a the first two-bit number (AB) is
Equal to (EQ),
Not equal to (NE),
Less than (LT),
Or greater than (GT)
a second two-bit number (CD)
23 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
PALs and PLAsCMOS for logic gatesTransmission gates and MUXs
Comparator Karnaugh map
AB
CD 00 01 11 10
00
01
11
10
D
B
C
A
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
EQAB
CD 00 01 11 10
00
01
11
10
D
B
C
A
0 1 1 1
1 0 1 1
1 1 0 1
1 1 1 0
NE
AB
CD 00 01 11 10
00
01
11
10
D
B
C
A
0 0 0 0
1 0 0 0
1 1 0 1
1 1 0 0
LTAB
CD 00 01 11 10
00
01
11
10
D
B
C
A
0 1 1 1
0 0 1 1
0 0 0 0
0 0 1 0
GT
24 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
PALs and PLAsCMOS for logic gatesTransmission gates and MUXs
Comparator PLA
EQ NE LT GT
25 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
PALs and PLAsCMOS for logic gatesTransmission gates and MUXs
Transistors
Basic device in NMOS and PMOS (CMOS) technologies
Can be used to construct any logic gate
27 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
PALs and PLAsCMOS for logic gatesTransmission gates and MUXs
NMOS transistor
gate
silicon bulk (P)
drain (N)source (N)
oxide
gate
silicon bulk (P)
drain (N)source (N) channel
oxide
28 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
PALs and PLAsCMOS for logic gatesTransmission gates and MUXs
NMOS transistor
Metal–oxide semiconductor (MOS)
Then, it was polysilicon–oxide semiconductor
Now, it is MOS again
P-type bulk silicon doped with positively charged ions
N-type diffusion regions doped with negatively charged ions
Gate can be used to pull a few electrons near the oxide
Forms channel region, conduction from source to drain starts
29 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
PALs and PLAsCMOS for logic gatesTransmission gates and MUXs
CMOS
NMOS turns on when the gate is high
PMOS just like NMOS, with N and P regions swapped
PMOS turns on when the gate is low
NMOS good at conducting low (0s)
PMOS good at conducting high (1s)
Use NMOS and PMOS transistors together to build circuits
Complementary metal oxide silicon (CMOS)
30 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
PALs and PLAsCMOS for logic gatesTransmission gates and MUXs
CMOS NAND gate
VSS
VDD
A B
Z
VSS
VDD
A B
Z
PMOS
NMOS
VSS
VDD
A B
Z
VSS
VDD
A B
Z
pull−up network
pull−down network
31 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
PALs and PLAsCMOS for logic gatesTransmission gates and MUXs
CMOS NAND gate layout
32 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
PALs and PLAsCMOS for logic gatesTransmission gates and MUXs
CMOS inverter operation
VDD
VSS
A B
VDD
VSS
A=0
B=1
A B
VDD
VSS
A B
VDD
VSS
A=1
B=0A B
VDD
VSS
A B
VDD
VSS
A B
A=?
B=?
33 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
PALs and PLAsCMOS for logic gatesTransmission gates and MUXs
NAND operation
VSS
VDD
A B
Z
Z=1
B=0A=0
VSS
VDD
A B
Z
B=1
VSS
VDD
A B
Z
Z=1
A=0
blockedVSS
VDD
A B
Z
A=1
VSS
VDD
A B
Z
Z=1
B=0
blocked
VSS
VDD
A B
Z
Z=0
B=1
A=1
VSS
VDD
A B
Z
VSS
VDD
A B
Z
34 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
PALs and PLAsCMOS for logic gatesTransmission gates and MUXs
NOR operation
VSS
VDD
A B
Z
Z=1
B=0
A=0
VSS
VDD
A B
Z
B=1Z=0
VSS
VDD
A B
Z
blocked
A=0
VSS
VDD
A B
Z
A=1
Z=0
VSS
VDD
A B
Z
B=0
blocked
VSS
VDD
A B
Z
A=1 B=1Z=0
VSS
VDD
A B
Z
VSS
VDD
A B
Z
35 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
PALs and PLAsCMOS for logic gatesTransmission gates and MUXs
CMOS inefficient for ANDs/ORs
Recall that NMOS transmits low values easily. . .
. . . transmits high values poorly
PMOS transmits high values easily. . .
. . . transmits low values poorly
36 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
PALs and PLAsCMOS for logic gatesTransmission gates and MUXs
CMOS inefficient for ANDs/ORs
VT , or threshold voltage, is commonly 0.7 V
NMOS conducts when VGS > VT
PMOS conducts when VGS < −VT
What happens if an NMOS transistor’s source is high?
Or a PMOS transistor’s source is low?
Alternatively, if one states that VTN = 0.7 V and VTP = −0.7 Vthen NMOS conducts when VGS > VTN and PMOS conductswhen VGS < VTP
37 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
PALs and PLAsCMOS for logic gatesTransmission gates and MUXs
NMOS transistor
gate
silicon bulk (P)
drain (N)source (N)
oxide
38 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
PALs and PLAsCMOS for logic gatesTransmission gates and MUXs
CMOS inefficient for ANDs/ORs
If an NMOS transistor’s input were VDD (high), for VGS > VTN ,the gate would require a higher voltage than VDD
If an PMOS transistor’s input were VSS (low), for VGS < VTP ,the gate would require a lower voltage than VSS
39 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
PALs and PLAsCMOS for logic gatesTransmission gates and MUXs
Implications of using CMOS
VSS
VDD
A B
Z
Z=1
B=0A=0
VSS
VDD
A B
Z
B=1
VSS
VDD
A B
Z
Z=1
A=0
blockedVSS
VDD
A B
Z
A=1
VSS
VDD
A B
Z
Z=1
B=0
blocked
VSS
VDD
A B
Z
Z=0
B=1
A=1
VSS
VDD
A B
Z
VSS
VDD
A B
Z
NAND/NOR easy to build in CMOS
40 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
PALs and PLAsCMOS for logic gatesTransmission gates and MUXs
Implications of using CMOS
AND/OR requires more area, power, time
41 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
PALs and PLAsCMOS for logic gatesTransmission gates and MUXs
CMOS transmission gates (switches)
NMOS is good at transmitting 0s
Bad at transmitting 1s
PMOS is good at transmitting 1s
Bad at transmitting 0s
To build a switch, use both: CMOS
42 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
PALs and PLAsCMOS for logic gatesTransmission gates and MUXs
CMOS transmission gate (TG)
B
C
C
A
44 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
PALs and PLAsCMOS for logic gatesTransmission gates and MUXs
Other TG diagram
45 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
PALs and PLAsCMOS for logic gatesTransmission gates and MUXs
Multiplexer (MUX) definitions
Also called selectors
2n inputs
n control lines
One output
46 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
PALs and PLAsCMOS for logic gatesTransmission gates and MUXs
MUX functional table
C Z
0 I01 I1
47 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
PALs and PLAsCMOS for logic gatesTransmission gates and MUXs
MUX truth table
I1 I0 C Z
0 0 0 00 0 1 00 1 0 10 1 1 01 0 0 01 0 1 11 1 0 11 1 1 1
48 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
PALs and PLAsCMOS for logic gatesTransmission gates and MUXs
MUX using logic gates
A B
I0
I1
I2
I3
Z
49 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
PALs and PLAsCMOS for logic gatesTransmission gates and MUXs
MUX using TGs
I3
I0
I2
I1
AA BB
ZZ
50 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
PALs and PLAsCMOS for logic gatesTransmission gates and MUXs
MUX
2:1C
C
C
C
A
B
D
A
B
C C
D
51 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
PALs and PLAsCMOS for logic gatesTransmission gates and MUXs
Hierarchical MUX implementation
4 :1
mux
4 :1
mux
8 :1
mux
2 :1
mux
0
1
2
3
0
1
2
3
S
S1
S0
S1
S0
Z
ACB
I0
I1
I2
I3
I4
I 5
I6
I7
0
1
52 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
PALs and PLAsCMOS for logic gatesTransmission gates and MUXs
Alternative hierarchical MUX implementation
00
11SS
00
11SS
00
11 SS
00
11SS
00
11
S 1
22
33S 0
AA BB
II00
II11
II22
II33
II44
II55
II66
II77
CC
CC
CC
53 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
PALs and PLAsCMOS for logic gatesTransmission gates and MUXs
MUX examples
2:1
m ux
I0
I1
A
Z
Z = A I0 + AI1
54 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
PALs and PLAsCMOS for logic gatesTransmission gates and MUXs
MUX examples
I0
A
I1
I2
I3
B
Z4:1
m ux
Z = AB I0 + A BI1 + AB I2 + ABI3
55 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
PALs and PLAsCMOS for logic gatesTransmission gates and MUXs
MUX examples
I0
A
I1
I2
I3
B
Z8:1
m ux
C
I4
I5
I6
I7
Z = AB C I0 + AB CI1 + A BC I2 + A BCI3+
AB C I4 + AB CI5 + ABC I6 + ABCI7
56 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
PALs and PLAsCMOS for logic gatesTransmission gates and MUXs
MUX properties
A 2n : 1 MUX can implement any function of n variables
A 2n−1 : 1 can also be used
Use remaining variable as an input to the MUX
57 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
PALs and PLAsCMOS for logic gatesTransmission gates and MUXs
MUX example
F (A,B,C ) =∑
(0, 2, 6, 7)
= AB C + A BC + ABC + ABC
58 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
PALs and PLAsCMOS for logic gatesTransmission gates and MUXs
Truth table
A B C F0 0 0 10 0 1 00 1 0 10 1 1 01 0 0 01 0 1 01 1 0 11 1 1 1
59 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
PALs and PLAsCMOS for logic gatesTransmission gates and MUXs
Lookup table implementation
8:1
MUX
1
0
1
0
0
0
1
11
0
1
2
3
4
5
6
77 S2 S1 S0
AA BB CC
FF
60 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
PALs and PLAsCMOS for logic gatesTransmission gates and MUXs
MUX example
F (A,B,C ) =∑
(0, 2, 6, 7)
= AB C + A BC + ABC + ABC
Therefore,
AB → F = C
A B → F = C
AB → F = 0
AB → F = 1
61 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
PALs and PLAsCMOS for logic gatesTransmission gates and MUXs
Truth table
A B C F0 0 0 10 0 1 10 1 0 10 1 1 11 0 0 01 0 1 01 1 0 11 1 1 1
F=C
62 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
PALs and PLAsCMOS for logic gatesTransmission gates and MUXs
Lookup table implementation
S1 S0
AA BB
4:1
MUX
0
1
2
33
00
11
FF
63 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
PALs and PLAsCMOS for logic gatesTransmission gates and MUXs
Demultiplexer (DMUX) definitions
Closely related to decoders
n control signals
Single data input can be routed to one of 2n outputs
64 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
PALs and PLAsCMOS for logic gatesTransmission gates and MUXs
Decoders vs. demultiplexers
Decoders have n inputs and 2n outputs.
They activate only the output indicated by the binary input value.
Demultiplexers have one input, 2n select lines, and 2n outputs.
They route the input to the output indicated by the binary selectvalue, and inactivate the other outputs.
In practice, decoders have an output enable input.
If you treat a decoder output enable as a demultiplexer input andtreat the decoder inputs as demultiplexer select lines, the two areequivalent.
In practice decoders and demultiplexers are interchangeable.
65 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
PALs and PLAsCMOS for logic gatesTransmission gates and MUXs
Active high 1:2 decoder
select
goutput 0
output 1
66 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
Perl/Python
Lab two has a tedious portion
You’ll need to lookup gates in a library
I wrote a perl and python script for you to accelerate this process
. . . and serve as examples
You’ll still need to do this manually once
Can use my scripts afterward
Read and understand it
68 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
Perl/Python
A genius colleague is an ASIC (Application-Specific IntegratedCircuit) design engineer at PMC-Sierra
He glues together standard cells to make high-performancespecial-purpose circuits
When he talks about perl, his eyes get all watery
Why do digital design engineers get so excited about a systemadministrator’s scripting language?
69 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
Commercial CAD tool flows are often a mess
Different tools that don’t quite work together
Translation
Tools that don’t quite finish the job
Pre-post processing
Poor support for complex testing, e.g., comparing a high-levellanguage model’s behavior with circuit simulation
IO processing and command scripting
Perl (python, etc.) allow quick (although sometimes inelegant)solutions to these problems
70 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
Perl code example motivation – Library
GATE "1310:physical" 16 O=!1A;
PIN * INV 1 999 1 .2 1 .2
GATE "1120:physical" 24 O=!(1A+1B);
PIN * INV 1 999 1 .2 1 .2
GATE "1130:physical" 32 O=!(1A+1B+1C);
PIN * INV 1 999 1 .2 1 .2
GATE "1220:physical" 24 O=!(1A*1B);
PIN * INV 1 999 1 .2 1 .2
71 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
Perl code example motivation – Gates
[348] 2310:physical 40.00
{cout} 1970:physical 56.00
[345] 1310:physical 16.00
[364] 1310:physical 16.00
{sum} 1860:physical 40.00
72 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
Perl code example
# Make sure number of args is correct
if (scalar @ARGV != 2) {
die "Usage: lookup-gate.perl " .
"[library] [file]\n";
}
my $lib = $ARGV[0];
my $file = $ARGV[1];
my %lab_op = ();
73 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
Perl code example
# Read in library
open LIB, "< $lib";
while (<LIB>) {
if (m/^GATE\s+"([^"]+)"\s+\d+\s+(.+)$/) {
# Put the data into a hash map
my ($label, $op) = ($1, $2);
$lab_op{$label} = $op;
}
}
close LIB;
74 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
Perl code example
# Loop on input file
open FILE, "< $file";
while (<FILE>) {
# Chop up the line on whitespace
my @ln = split ’ ’, $_;
if (scalar(@ln) == 3) {
# Grab the node and label
my ($node, $lab) = @ln;
75 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
Perl code example
# Look it up in the hash map and
# display the results
print "Node $node implemented with " .
"gate $lab_op{$lab}\n";
}
}
close FILE;
76 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
Perl code output
Node [348] implemented with gate O=!(1A*1B+!1A*!1B);
Node {cout} implemented with gate O=1A*1B+2C*2D;
Node [345] implemented with gate O=!1A;
Node [364] implemented with gate O=!1A;
Node {sum} implemented with gate O=!((1A+1B)*(2C+2D));
77 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
Python code example
# Make sure number of args is correct
if len(sys.argv) < 3:
print ’Usage: lookup-gate.py [library] [file]’
sys.exit(0)
lib, file = sys.argv[1:]
lab_op = dict();
78 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
Python code example
# Read in library
fl = open(lib)
for ln in fl.readlines():
m = re.match(’^GATE\s+"([^"]+)"\s+\d+\s+(.+)$’, ln)
if m:
# Put the data into a hash map
label, op = m.group(1, 2)
lab_op[label] = op
fl.close()
79 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
Python code example
# Loop on input file
fl = open(file)
for ln in fl.readlines():
# Chop up the line on whitespace
ln_ar = ln.split()
if len(ln_ar) == 3:
# Grab the node and label
node, lab = ln_ar[:2]
# Look it up in the hash map and display the results
print ’Node %s implemented with gate %s’ % (node, lab_op[lab])
fl.close()
80 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
Back to implementation technologiesWhat is this?
Output0Se lect
Output1
82 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
What is this?
Output0Se lect
Output1
83 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
Active-high 2:4 decoder/demultiplexer
Se lect0 Se lect1
Output2
Output3
Output0GG
Output1
84 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
Active-low 2:4 decoder/demultiplexer
S e lect0 S e lect1
Output2
Output3
Output0
Output1
G
85 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
Dangers when implementing with TGs
What if an output is not connected to any input?
86 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
Consider undriven inverter inputs
VDD
VSS
A B
VDD
VSS
A=0
B=1
A B
VDD
VSS
A B
VDD
VSS
A=1
B=0A B
VDD
VSS
A B
VDD
VSS
A B
A=?
B=?
87 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
Dangers when implementing with TGs
88 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
Set all outputs
89 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
Demultiplexer
C
C
C
C
A
D
E
90 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
TG decoder/demultiplexer implementation
GG Output00
"0"
"0"
Select11
Select
GG Output11
"0"
"0"
00
GG Output22
"0"
"0"
GG Output33
"0"
"0"
Consider alternative paths
91 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
Demultiplexers as building blocks
3 :8
dec
0
1
2
3
4
5
6
7
A B C
Enb
ABC
ABC
ABC
ABC
ABC
ABC
ABC
ABCS2
S1
S0
Generate minterm based on control signals
92 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
Example function
F1 = AB CD + A BC D + ABCD
F2 = ABC D + ABC = ABC D + ABCD + ABCD
F3 = A + B + C + D = ABCD
93 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
Demultiplexers as building blocks
A B C D
A B C D
A B C D
A B C D
A B C D
A B C D
A B C D
A B C D
A B C D
A B C D
A B C D
A B C D
A B C D
A B C D
A B C D
A B C D
F1
F3
0
1
2
3
4
5
6
7
8
9
10
1 1
12
13
14
15
A
S3
S2
S1
S0
4:16
dec
Enb
B C D
F2
If active-low, use NAND gates
94 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
Implementation of 32:1 MUX
EN
7766554433221100
CCBBAA
151
WW
YY
44332211
11
55
11
44
11
11
11
00
99
66
55
B1B2B3
B0
A3A2A1A0
153GA
GB
YA
YB
S1 SO
66554433
11
10111213
11
551422
77
99
EN
7766554433221100
CCBBAA
151
WW
YY
44332211
11
55
11
44
11
11
11
00
99
66
55EN
7766554433221100
CCBBAA
151
WW
YY
44332211
11
55
11
44
11
33
11
11
11
00
99
66
55EN
7766554433221100
151
WW
YY11 66
55
S2
S1
S0
I7
F(A, B, C, D, E)
I0
I15
I23
I31
I6I5I4I3I2I1
AA BB
C
D
EE
95 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
1:32 demultiplexer
5 :32Decoder
Subs ys tem
\EN
S4 S3 S2 S1 S0
.
.
..
\Y31
\Y0
2Y2
1Y1
1Y0
1Y3
1Y2
2Y1
2Y0
2Y3
1G
1B
1A
139
2G
2B
2A
S4
S3
G1
G2A
G2B
CC
BB
AA
Y7
Y6
Y5
Y4
Y1
Y0
Y3
Y2
138
G1
G2A
G2B
CC
BB
AA
Y7
Y6
Y5
Y4
Y1
Y0
Y3
Y2
138
G1
G2A
G2B
CC
BB
AA
Y7
Y6
Y5
Y4
Y1
Y0
Y3
Y2
138
G1
G2A
G2B
CC
BB
AA
Y7
Y6
Y5
Y4
Y1
Y0
Y3
Y2
138
\EN
S2
S1
S0
S2
S1
S0
S2
S1
S0
S2
S1
S0
31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
\Y
\Y
96 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
Multiple I/O circuit
MUX MUX
DEMUX
AA BB
S um
A0 A1 B0 B1
S a S b
Ss
S 0 S 1
97 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
Summary
Q&A
PALs/PLAs
Review, Q&A on MOS transistors
Multiplexers, Demultiplexers
Transmission gates
Perl/Python
98 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
Homework
Recommended reading
M. Morris Mano and Charles R. Kime. Logic and Computer
Design Fundamentals. Prentice-Hall, NJ, fourth edition, 2008
Chapters 3 and 4
Lab two
Espresso and SIS logic minimization
100 Robert Dick Advanced Digital Logic Design
AdministrationImplementation technologies
Scripting languagesReview of implementation technologies
Homework
Next lecture
ROMs
Multilevel logic minimization
Review: NAND/NOR implementation
101 Robert Dick Advanced Digital Logic Design