combinatorial logic design practices - personal web pages...
TRANSCRIPT
![Page 1: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/1.jpg)
7-1Logic System Design I
Combinatorial Logic Design Practices
ECGR2181
�������� ��������
![Page 2: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/2.jpg)
Logic System Design I 7-2
Documentation Standards
Block diagrams– first step in hierarchical design
Schematic diagramsHDL programs (ABEL, Verilog, VHDL)Timing diagramsCircuit descriptions
![Page 3: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/3.jpg)
Logic System Design I 7-3
Block Diagram
![Page 4: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/4.jpg)
Logic System Design I 7-4
Flat schematic structure
![Page 5: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/5.jpg)
Logic System Design I 7-5
Hierarchichalschematic structure
![Page 6: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/6.jpg)
Logic System Design I 7-6
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.)
![Page 7: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/7.jpg)
Logic System Design I 7-7
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.
![Page 8: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/8.jpg)
Logic System Design I 7-8
Example
LogicCircuit
HIGH when error occurs
ERROROK_L
LogicCircuit
LOW when error occurs
ERROR_L ERROR
ERROR1_L
![Page 9: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/9.jpg)
Logic System Design I 7-9
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
![Page 10: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/10.jpg)
Logic System Design I 7-10
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
![Page 11: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/11.jpg)
Logic System Design I 7-11
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
![Page 12: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/12.jpg)
Logic System Design I 7-12
Example – Timing Diagram
![Page 13: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/13.jpg)
Logic System Design I 7-13
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<<2n)
![Page 14: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/14.jpg)
Logic System Design I 7-14
Example: 4x3 PLA, 6 product terms
![Page 15: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/15.jpg)
Logic System Design I 7-15
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
![Page 16: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/16.jpg)
Logic System Design I 7-16
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
![Page 17: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/17.jpg)
Logic System Design I 7-17
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.
![Page 18: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/18.jpg)
Logic System Design I 7-18
Decoders
General decoder structure
Typically n inputs, 2n outputs– 2-to-4, 3-to-8, 4-to-16, etc.
![Page 19: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/19.jpg)
Logic System Design I 7-19
Binary 2-to-4 decoder
Note “x” (don’t care) notation.
![Page 20: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/20.jpg)
Logic System Design I 7-20
2-to-4-decoder logic diagram
![Page 21: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/21.jpg)
Logic System Design I 7-21
Architecture
built-in librarycomponents
positionalcorrespondencewith entity definition
Example: 2-to-4 decoder
![Page 22: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/22.jpg)
Logic System Design I 7-22
Decoder Symbol
![Page 23: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/23.jpg)
Logic System Design I 7-23
MSI 2-to-4 decoder
Input buffering (less load)NAND gates (faster)
![Page 24: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/24.jpg)
Logic System Design I 7-24
Complete 74x139 Decoder
![Page 25: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/25.jpg)
Logic System Design I 7-25
3-to-8 decoder
![Page 26: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/26.jpg)
Logic System Design I 7-26
74x138 3-to-8-decoder symbol
![Page 27: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/27.jpg)
Logic System Design I 7-27
Dataflow-style program for 3-to-8 decoder
![Page 28: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/28.jpg)
Logic System Design I 7-28
Dataflow-style program for 3-to-8 decoder
![Page 29: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/29.jpg)
Logic System Design I 7-29
Decoder cascading
4-to-16 decoder
![Page 30: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/30.jpg)
Logic System Design I 7-30
More cascading
5-to-32 decoder
![Page 31: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/31.jpg)
Logic System Design I 7-31
Decoder applications
Microprocessor memory systems– selecting different banks of memory
Microprocessor input/output systems– selecting different devices
Microprocessor instruction decoding– enabling different functional units
Memory chips– enabling different rows of memory depending on address
![Page 32: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/32.jpg)
Logic System Design I 7-32
Example – Microprocessor ApplicationMicroprocessor
A15A14A13A12A11A10A9A8A7A6A5A4A3A2A1A0
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
![Page 33: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/33.jpg)
Logic System Design I 7-33
Encoders vs. Decoders
Decoder Encoder
![Page 34: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/34.jpg)
Logic System Design I 7-34
Binary encoders
![Page 35: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/35.jpg)
Logic System Design I 7-35
Need priority in most applications
![Page 36: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/36.jpg)
Logic System Design I 7-36
8-input priority encoder
![Page 37: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/37.jpg)
Logic System Design I 7-37
Priority-encoder logic equations
![Page 38: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/38.jpg)
Logic System Design I 7-38
74x148 8-input priority encoder
– Active-low I/O– Enable Input– “Got Something”– Enable Output
![Page 39: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/39.jpg)
Logic System Design I 7-39
74x148 circuit
![Page 40: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/40.jpg)
Logic System Design I 7-40
74x148 Truth Table
![Page 41: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/41.jpg)
Logic System Design I 7-41
Cascading priority encoders
32-inputpriority encoder
![Page 42: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/42.jpg)
Logic System Design I 7-42
Multiplexers
![Page 43: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/43.jpg)
Logic System Design I 7-43
Multiplexer - Gate-Level Modeling - Verilog
2-to-1 Multiplexer
// 2-to-1 Multiplexer modulemodule mux_2 (out, i0, i1, sel); // headerinput i0, i1, sel; // input & output portsoutput out;wire x1, x2, x3; // internal netsor (out, x2, x3); // form outputand (x2, i0, x1); // i0 • sel’and (x3, i1, sel); // i1 • selnot (x1, sel); // invert selendmodule
![Page 44: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/44.jpg)
Logic System Design I 7-44
Multiplexer - Dataflow Modeling - Verilog
4-bit Multiplexer
// Four-bit 2-to-1 multiplexermodule mux_4bit (Out, A, B, sel);input [3:0] A, B;input sel;output [3:0] Out;assign Out = sel ? B, A;endmodule
![Page 45: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/45.jpg)
Logic System Design I 7-45
Multiplexer - Behavioral Modeling - Verilog
Conditional Statementsmodule mux4_to_1 (A, B, C, D, OUT, select);input [7:0] A, B, C, D;input [1:0] select;output [7:0] OUT;reg [7:0] OUT;always @ (A or B or C or D or select)case (select)
2’d0: OUT = A;2’d1: OUT = B;2’d2: OUT = C;2’d3: OUT = D;
endcaseend
![Page 46: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/46.jpg)
Logic System Design I 7-46
74x1518-input multiplexer
![Page 47: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/47.jpg)
Logic System Design I 7-47
74x151 truth table
![Page 48: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/48.jpg)
Logic System Design I 7-48
CMOS transmission gates
2-input multiplexer
![Page 49: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/49.jpg)
Logic System Design I 7-49
Other multiplexer varieties
2-input, 4-bit-wide– 74x157
4-input, 2-bit-wide– 74x153
![Page 50: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/50.jpg)
Logic System Design I 7-50
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
![Page 51: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/51.jpg)
Logic System Design I 7-51
16 16-to-1 muxes
16-to-1 mux = 2 x 74x151 8-to-1 mux+ NAND gate
![Page 52: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/52.jpg)
Logic System Design I 7-52
4 16-bit 2-to-1 muxes
16-bit 2-to-1 mux = 4 x 74x157 4-bit 2-to-1 mux
![Page 53: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/53.jpg)
Logic System Design I 7-53
Properties of different approaches
![Page 54: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/54.jpg)
Logic System Design I 7-54
2-input XOR gates
Like an OR gate, but excludes the case where both inputs are 1.
XNOR: complement of XOR
![Page 55: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/55.jpg)
Logic System Design I 7-55
XOR and XNOR symbols
![Page 56: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/56.jpg)
Logic System Design I 7-56
Gate-level XOR circuits
No direct realization with just a few transistors.
![Page 57: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/57.jpg)
Logic System Design I 7-57
Equality Comparators1-bit comparator
4-bit comparator
EQ_L
![Page 58: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/58.jpg)
Logic System Design I 7-58
8-bit Magnitude Comparator
![Page 59: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/59.jpg)
Logic System Design I 7-59
Other conditions
![Page 60: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/60.jpg)
Logic System Design I 7-60
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
![Page 61: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/61.jpg)
Logic System Design I 7-61
Full-adder circuit
![Page 62: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/62.jpg)
Logic System Design I 7-62
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
![Page 63: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/63.jpg)
Logic System Design I 7-63
74x2834-bit adder
Uses carry lookaheadinternally
![Page 64: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/64.jpg)
Logic System Design I 7-64
“generate”
“propagate”
“half sum”
carry-in from previous stage
![Page 65: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/65.jpg)
Logic System Design I 7-65
Ripple carry between groups
![Page 66: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/66.jpg)
Logic System Design I 7-66
Lookahead carry between groups
![Page 67: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/67.jpg)
Logic System Design I 7-67
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.
![Page 68: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/68.jpg)
Logic System Design I 7-68
Full subtractor = full adder, almost
![Page 69: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/69.jpg)
Logic System Design I 7-69
Multipliers
8x8 multiplier
![Page 70: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/70.jpg)
Logic System Design I 7-70
Full-adder array
![Page 71: Combinatorial Logic Design Practices - Personal Web Pages ...jmconrad/ECGR2181-2006-01/notes/ECG… · available resources in the PAL. ... Decoder Encoder. Logic System Design I 7-34](https://reader031.vdocuments.net/reader031/viewer/2022021512/5af9e7567f8b9a32348cfc73/html5/thumbnails/71.jpg)
Logic System Design I 7-71
Faster carry chain