Upload
others
View
0
Download
0
Embed Size (px)
Citation preview
8-1Logic System Design I
More Digital Design
ECGR2181
�������� ���������������������
Logic System Design I 8-2
Block Diagram
Logic System Design I 8-3
Flat schematic structure
Logic System Design I 8-4
Hierarchichalschematic structure
Logic System Design I 8-5
Other Documentation
Timing diagrams– Output from simulator– Specialized timing-diagram drawing tools
Circuit descriptions– Text (word processing)– Can be as big as a book– Typically incorporate other elements (block diagrams, timing
diagrams, etc.)
Logic System Design I 8-6
Signal names and active levels
Signal names are chosen to be descriptive.Active levels -- HIGH or LOW
– named condition or action occurs in either the HIGH or the LOW state, according to the active-level designation in the name.
Logic System Design I 8-7
Example
LogicCircuit
HIGH when error occurs
ERROROK_L
LogicCircuit
LOW when error occurs
ERROR_L ERROR
ERROR1_L
Logic System Design I 8-8
Microprocessor
A15A14A13A12A11A10
A9A8A7A6A5A4A3A2A1A0
ALE
ADDR15
ADDR14
ADDR13
ADDR12
ADDR11
ADDR10
ADDR9
ADDR8
ADDR8
ADDR7
ADDR6
ADDR5
ADDR4
ADDR3
ADDR2
ADDR1
ADDR0
ALE
ALE
ADDR15 LA15
LA14
LA13
LA12
LA11
LA10
LA7
LA8
ADDR14
ADDR13
ADDR12
ADDR11
ADDR10
ADDR9
D7DATA7
DATA6
DATA5
DATA4
DATA3
DATA2
DATA1
DATA0
D6D5D4D3D2D1D0
MIORDYMEMIO
RD_LREAD
WR_L
RD_L
WR_LWRITE
CONTROL
DATA[7:0]
ADDR[15:0]
LA[15:0]
DB[7:0]
DATA7
DATA6
DATA5
DATA4
DATA3
DATA2
DATA1
DATA0
DB7
DB6
DB5
DB4
DB3
DB2
DB1
DB0
READY
LA7
LA6
LA5
LA4
LA3
LA2
LA1
LA0
ADDR7
ADDR6
ADDR5
ADDR4
ADDR3
ADDR2
ADDR1
ADDR0
2,3
2
2
Copyright © 2000 by Prentice Hall, Inc.Digital Design Principles and Practices, 3/e
Logic System Design I 8-9
GO
READY
DAT
(b)
GO
READY
DAT
(c)(a)
t
GO
ENB
READY
DAT
DAT
RDY
RDYmin
DATmax
DATmin
RDYmax
DAT
RDY
t
t
t
t
t t
t
Copyright © 2000 by Prentice Hall, Inc.Digital Design Principles and Practices, 3/e
Logic System Design I 8-10
tOUTmax
WRITE_L
DATAIN
DATAOUT
(a)
STEP[7:0]
(b)
tOUTmin
must be stable
tsetup thold
new dataold
00FF 01 02 03
COUNT
CLEAR
Copyright © 2000 by Prentice Hall, Inc.Digital Design Principles and Practices, 3/e
Logic System Design I 8-11
Programmable Logic Arrays (PLAs)
Any combinational logic function can be realized as a sum of products.
Idea: Build a large AND-OR array with lots of inputs and product terms, and programmable connections.– n inputs
• AND gates have 2n inputs -- true and complement of each variable.
– m outputs, driven by large OR gates• Each AND gate is programmably connected to each output’s
OR gate.– p AND gates (p
Logic System Design I 8-12
Example: 4x3 PLA, 6 product terms
Logic System Design I 8-13
Programmable Array Logic (PALs)
How beneficial is product sharing?– Not enough to justify the extra AND array
PALs ==> fixed OR array– Each AND gate is permanently connected to a certain OR gate.
Example: PAL16L8
Logic System Design I 8-14
10 primary inputs8 outputs, with 7 ANDs per
output1 AND for 3-state enable6 outputs available as inputs
– more inputs, at expense of outputs
– two-pass logic, helper terms
Note inversion on outputs– output is complement of sum-of-
products– newer PALs have selectable
inversion
Logic System Design I 8-15
Designing with PALs
Compare number of inputs and outputs of the problem with available resources in the PAL.
Write equations for each output using HDL.Compile the HDL program, determine whether minimized
equations fit in the available AND terms.If no fit, try modifying equations.
Logic System Design I 8-16
Documentation Standards
Block diagrams– first step in hierarchical design
Schematic diagramsHDL programs (ABEL, Verilog, VHDL)Timing diagramsCircuit descriptions
Logic System Design I 8-17
Multiplexers
Logic System Design I 8-18
74x1518-input multiplexer
Logic System Design I 8-19
74x151 truth table
Logic System Design I 8-20
CMOS transmission gates
2-input multiplexer
Logic System Design I 8-21
Other multiplexer varieties
2-input, 4-bit-wide– 74x157
4-input, 2-bit-wide– 74x153
Logic System Design I 8-22
Barrel shifter design example
n data inputs, n data outputsControl inputs specify number of positions to rotate or shift
data inputsExample: n = 16
– DIN[15:0], DOUT[15:0], S[3:0] (shift amount)
Many possible solutions, all based on multiplexers
Logic System Design I 8-23
16 16-to-1 muxes
16-to-1 mux = 2 x 74x151 8-to-1 mux+ NAND gate
Logic System Design I 8-24
4 16-bit 2-to-1 muxes
16-bit 2-to-1 mux = 4 x 74x157 4-bit 2-to-1 mux
Logic System Design I 8-25
Properties of different approaches
Logic System Design I 8-26
2-input XOR gates
Like an OR gate, but excludes the case where both inputs are 1.
XNOR: complement of XOR
Logic System Design I 8-27
XOR and XNOR symbols
Logic System Design I 8-28
Gate-level XOR circuits
No direct realization with just a few transistors.
Logic System Design I 8-29
Equality Comparators1-bit comparator
4-bit comparator
EQ_L
Logic System Design I 8-30
8-bit Magnitude Comparator
Logic System Design I 8-31
Other conditions
Logic System Design I 8-32
Adders
Basic building block is “full adder”– 1-bit-wide adder, produces sum and carry outputs
Truth table:
X Y Cin S Cout
0 0 0 0 00 0 1 1 00 1 0 1 00 1 1 0 11 0 0 1 01 0 1 0 11 1 0 0 11 1 1 1 1
Logic System Design I 8-33
Full-adder circuit
Logic System Design I 8-34
Ripple adder
Speed limited by carry chainFaster adders eliminate or limit carry chain
– 2-level AND-OR logic ==> 2n product terms– 3 or 4 levels of logic, carry lookahead
Logic System Design I 8-35
74x2834-bit adder
Uses carry lookaheadinternally
Logic System Design I 8-36
“generate”
“propagate”
“half sum”
carry-in from previous stage
Logic System Design I 8-37
Ripple carry between groups
Logic System Design I 8-38
Lookahead carry between groups
Logic System Design I 8-39
Subtraction
Subtraction is the same as addition of the two’s complement.The two’s complement is the bit-by-bit complement plus 1.Therefore, X – Y = X + Y + 1 .
– Complement Y inputs to adder, set Cin to 1.– For a borrow, set Cin to 0.
Logic System Design I 8-40
Full subtractor = full adder, almost
Logic System Design I 8-41
Multipliers
8x8 multiplier
Logic System Design I 8-42
Full-adder array
Logic System Design I 8-43
Faster carry chain
Logic System Design I 8-44
Memory Hierarchy
���������
�����
���
����
�������
������
��������
� ��
���������
���!"#���
Logic System Design I 8-45
View of Computer System
���$����� %�
� ��&���
'������%�
�#���(
)���&���
���*�� ���*��
Logic System Design I 8-46
Memory
To build a memory -- a logical k × m array of stored bits.
++++++++++++
,��
$ ���� %�
"���
�������������-�������������-�������������-�������������-
%.("��� ��$ ���� %��.�.�$$#���� &��� ���
��������"�$��#-��������"�$��#-��������"�$��#-��������"�$��#-
%.("��� ��"��������$ ���� %�����"#��!��������"$��
Logic System Design I 8-47
A1
WE
A0 D2 D1 D0
Q2 Q1 Q0
22 x 3 Memory
����������������������������
��� ������ ������ ������ ���
& �����$���& �����$���& �����$���& �����$��� & ���/0& ���/0& ���/0& ���/0����������������������������
&����&����&����&����
�%�"$��%�"$��%�"$��%�"$�
�%�.��"����%�.��"����%�.��"����%�.��"���
.��.��"��� .��.��"��� .��.��"��� .��.��"���
Logic System Design I 8-48
More Memory Details
This is a not the way actual memory is implemented.– fewer transistors, much more dense, relies on electrical properties
But the logical structure is very similar.– address decoder– word select line– word write enable
Two basic kinds of memory (RAM = Random Access Memory)
Static RAM (SRAM)– fast, maintains data without power refresh
Dynamic RAM (DRAM)– slower but denser, bit storage must be periodically refreshed
Logic System Design I 8-49
Even More Memory Details
There are other types of “non-volatile” memory devices:• ROM• PROM• EPROM• EEPROM• Flash
Can you think of other memory devices?
Logic System Design I 8-50
Electronics Packaging– There are several packaging technologies available that an
engineer can use to create electronic devices. – Some are suitable for inexpensive toys but not miniature consumer
products, and some are suitable for miniature consumer products but not inexpensive toys.
– These packages have metal leads that are the conductive wire that connect electricity from the outside world to the silicon inside the package.
– Leads between packages are connected with small copper traces on a printed circuit board (PCB), and the package leads are soldered to the PCB.
Logic System Design I 8-51
Examples of Electronics Packages
Dual In-line Package (DIP) Older technology, requires the metal leads to go through a hole in the printed circuit board.
Dual Flat Pack (DFP) - A fairly recent technology, metal leads solder to the surface of the printed circuit board.
Logic System Design I 8-52
Examples of Electronics Packages
Quad Flat Pack (QFP) - like the Dual Flat Pack, except here are metal leads are on four sides.
Ball Grid Array (BGA) - The connections to the component are on the bottom of the chip, and have balls of solder on these connections.
Logic System Design I 8-53
Driving Force: The Clock
The clock is a signal that keeps the control unit moving.– At each clock “tick,” control unit moves to the next
machine cycle -- may be next instruction ornext phase of current instruction.
Clock generator circuit:– Based on crystal oscillator– Generates regular sequence of “0” and “1” logic levels– Clock cycle (or machine cycle) -- rising edge to rising edge
1�2
1�2
���→�����%��#�$�
Logic System Design I 8-54
Read-Only Memories
Logic System Design I 8-55
Why “ROM”?
Program storage– Boot ROM for personal computers– Complete application storage for embedded systems.
Actually, a ROM is a combinational circuit, basically a truth-table lookup.– Can perform any combinational logic function– Address inputs = function inputs– Data outputs = function outputs
Logic System Design I 8-56
Logic-in-ROM example
Logic System Design I 8-57
4x4 multiplier example
Logic System Design I 8-58
Internal ROM structure
PDP-11 boot ROM(64 words, 1024 diodes)
Logic System Design I 8-59
Two-dimensional decoding
?
Logic System Design I 8-60
Larger example, 32Kx8 ROM
Logic System Design I 8-61
Today’s ROMs
256K bytes, 1M byte, or largerUse MOS transistors
Logic System Design I 8-62
EEPROMs, Flash PROMs
Programmable and erasableusing floating-gate MOS transistors
Logic System Design I 8-63
Typical commercial EEPROMs
Logic System Design I 8-64
EEPROM programming
Apply a higher voltage to force bit change– E.g., VPP = 12 V– On-chip high-voltage “charge pump” in newer chips
Erase bits– Byte-byte– Entire chip (“flash”)– One block (typically 32K - 66K bytes) at a time
Programming and erasing are a lot slower than reading (milliseconds vs. 10’s of nanoseconds)
Logic System Design I 8-65
Microprocessor EPROM application
Logic System Design I 8-66
ROM control and I/O signals
Logic System Design I 8-67
ROM timing