Preface |
|
xix | |
Features |
|
xx | |
Online Supplements |
|
xxi | |
How to Use the Software Tools in a Course |
|
xxii | |
Labs |
|
xxiii | |
RVfpga |
|
xxiii | |
Bugs |
|
xxiv | |
Acknowledgments |
|
xxiv | |
About the Authors |
|
xxv | |
|
Chapter 1 From Zero to One |
|
|
1 | (52) |
|
|
1 | (1) |
|
1.2 The Art of Managing Complexity |
|
|
2 | (3) |
|
|
2 | (1) |
|
|
3 | (1) |
|
|
4 | (1) |
|
1.3 The Digital Abstraction |
|
|
5 | (2) |
|
|
7 | (10) |
|
|
7 | (1) |
|
|
7 | (2) |
|
1.4.3 Hexadecimal Numbers |
|
|
9 | (2) |
|
1.4.4 Bytes, Nibbles, and All That Jazz |
|
|
11 | (1) |
|
|
12 | (1) |
|
1.4.6 Signed Binary Numbers |
|
|
13 | (4) |
|
|
17 | (3) |
|
|
18 | (1) |
|
|
18 | (1) |
|
|
18 | (1) |
|
|
19 | (1) |
|
1.5.5 Other Two-Input Gates |
|
|
19 | (1) |
|
1.5.6 Multiple-Input Gates |
|
|
19 | (1) |
|
1.6 Beneath the Digital Abstraction |
|
|
20 | (4) |
|
|
20 | (1) |
|
|
20 | (1) |
|
|
21 | (1) |
|
1.6.4 DC Transfer Characteristics |
|
|
22 | (1) |
|
1.6.5 The Static Discipline |
|
|
22 | (2) |
|
|
24 | (8) |
|
|
25 | (1) |
|
|
25 | (1) |
|
|
26 | (1) |
|
1.7.4 nMOS and pMOS Transistors |
|
|
26 | (3) |
|
|
29 | (1) |
|
1.7.6 Other CMOS Logic Gates |
|
|
29 | (2) |
|
|
31 | (1) |
|
|
31 | (1) |
|
|
32 | (2) |
|
1.9 Summary and a Look Ahead |
|
|
34 | (19) |
|
|
36 | (14) |
|
|
50 | (3) |
|
Chapter 2 Combinational Logic Design |
|
|
53 | (54) |
|
|
53 | (3) |
|
|
56 | (2) |
|
|
56 | (1) |
|
2.2.2 Sum-of-Products Form |
|
|
56 | (2) |
|
2.2.3 Product-of-Sums Form |
|
|
58 | (1) |
|
|
58 | (6) |
|
|
59 | (1) |
|
2.3.2 Theorems of One Variable |
|
|
59 | (1) |
|
2.3.3 Theorems of Several Variables |
|
|
60 | (2) |
|
2.3.4 The Truth Behind It All |
|
|
62 | (1) |
|
2.3.5 Simplifying Equations |
|
|
63 | (1) |
|
|
64 | (3) |
|
2.5 Multilevel Combinational Logic |
|
|
67 | (4) |
|
|
68 | (1) |
|
|
69 | (2) |
|
|
71 | (2) |
|
|
71 | (1) |
|
|
72 | (1) |
|
|
73 | (8) |
|
|
74 | (1) |
|
2.7.2 Logic Minimization with K-Maps |
|
|
75 | (4) |
|
|
79 | (1) |
|
|
80 | (1) |
|
2.8 Combinational Building Blocks |
|
|
81 | (5) |
|
|
81 | (3) |
|
|
84 | (2) |
|
|
86 | (7) |
|
2.9.1 Propagation and Contamination Delay |
|
|
86 | (4) |
|
|
90 | (3) |
|
|
93 | (14) |
|
|
95 | (9) |
|
|
104 | (3) |
|
Chapter 3 Sequential Logic Design |
|
|
107 | (64) |
|
|
107 | (1) |
|
3.2 Latches and Flip-Flops |
|
|
107 | (10) |
|
|
109 | (2) |
|
|
111 | (1) |
|
|
112 | (1) |
|
|
112 | (1) |
|
|
113 | (1) |
|
3.2.6 Resettable Flip-Flop |
|
|
114 | (1) |
|
3.2.7 Transistor-Level Latch and Flip-Flop Designs |
|
|
114 | (2) |
|
3.2.8 Putting It All Together |
|
|
116 | (1) |
|
3.3 Synchronous Logic Design |
|
|
117 | (4) |
|
3.3.1 Some Problematic Circuits |
|
|
117 | (1) |
|
3.3.2 Synchronous Sequential Circuits |
|
|
118 | (2) |
|
3.3.3 Synchronous and Asynchronous Circuits |
|
|
120 | (1) |
|
3.4 Finite State Machines |
|
|
121 | (18) |
|
|
121 | (6) |
|
|
127 | (3) |
|
3.4.3 Moore and Mealy Machines |
|
|
130 | (2) |
|
3.4.4 Factoring State Machines |
|
|
132 | (3) |
|
3.4.5 Deriving an FSM from a Schematic |
|
|
135 | (3) |
|
|
138 | (1) |
|
3.5 Timing of Sequential Logic |
|
|
139 | (16) |
|
3.5.1 The Dynamic Discipline |
|
|
140 | (1) |
|
|
140 | (6) |
|
|
146 | (3) |
|
|
149 | (1) |
|
|
150 | (2) |
|
3.5.6 Derivation of Resolution Time |
|
|
152 | (3) |
|
|
155 | (4) |
|
|
159 | (12) |
|
|
160 | (9) |
|
|
169 | (2) |
|
Chapter 4 Hardware Description Languages |
|
|
171 | (66) |
|
|
171 | (4) |
|
|
171 | (1) |
|
|
172 | (1) |
|
4.1.3 Simulation and Synthesis |
|
|
173 | (2) |
|
|
175 | (13) |
|
|
175 | (3) |
|
4.2.2 Comments and White Space |
|
|
178 | (1) |
|
4.2.3 Reduction Operators |
|
|
178 | (1) |
|
4.2.4 Conditional Assignment |
|
|
179 | (1) |
|
|
180 | (2) |
|
|
182 | (1) |
|
|
183 | (1) |
|
|
184 | (2) |
|
|
186 | (1) |
|
|
186 | (2) |
|
|
188 | (3) |
|
|
191 | (5) |
|
|
191 | (1) |
|
4.4.2 Resettable Registers |
|
|
192 | (2) |
|
|
194 | (1) |
|
|
195 | (1) |
|
|
196 | (1) |
|
4.5 More Combinational Logic |
|
|
196 | (11) |
|
|
199 | (1) |
|
|
200 | (3) |
|
4.5.3 Truth Tables with Don't Cares |
|
|
203 | (1) |
|
4.5.4 Blocking and Nonblocking Assignments |
|
|
203 | (4) |
|
4.6 Finite State Machines |
|
|
207 | (4) |
|
|
211 | (4) |
|
|
212 | (1) |
|
|
213 | (2) |
|
4.8 Parameterized Modules |
|
|
215 | (3) |
|
|
218 | (4) |
|
|
222 | (15) |
|
|
224 | (11) |
|
|
235 | (2) |
|
Chapter 5 Digital Building Blocks |
|
|
237 | (62) |
|
|
237 | (1) |
|
|
237 | (19) |
|
|
237 | (7) |
|
|
244 | (1) |
|
|
245 | (2) |
|
|
247 | (4) |
|
5.2.5 Shifters and Rotators |
|
|
251 | (2) |
|
|
253 | (1) |
|
|
254 | (1) |
|
|
255 | (1) |
|
|
256 | (5) |
|
5.3.1 Fixed-Point Number Systems |
|
|
256 | (1) |
|
5.3.2 Floating-Point Number Systems |
|
|
257 | (4) |
|
5.4 Sequential Building Blocks |
|
|
261 | (4) |
|
|
261 | (1) |
|
|
262 | (3) |
|
|
265 | (7) |
|
|
265 | (2) |
|
5.5.2 Dynamic Random Access Memory (DRAM) |
|
|
267 | (1) |
|
5.5.3 Static Random Access Memory (SRAM) |
|
|
268 | (1) |
|
|
268 | (1) |
|
|
269 | (1) |
|
5.5.6 Read Only Memory (ROM) |
|
|
269 | (2) |
|
5.5.7 Logic Using Memory Arrays |
|
|
271 | (1) |
|
|
272 | (1) |
|
|
272 | (11) |
|
5.6.1 Programmable Logic Array (PLA) |
|
|
275 | (1) |
|
5.6.2 Field Programmable Gate Array (FPGA) |
|
|
276 | (6) |
|
5.6.3 Array Implementations |
|
|
282 | (1) |
|
|
283 | (16) |
|
|
285 | (12) |
|
|
297 | (2) |
|
|
299 | (94) |
|
|
299 | (1) |
|
|
300 | (8) |
|
|
301 | (1) |
|
6.2.2 Operands: Registers, Memory, and Constants |
|
|
302 | (6) |
|
|
308 | (24) |
|
|
308 | (1) |
|
6.3.2 Logical, Shift, and Multiply Instructions |
|
|
308 | (3) |
|
|
311 | (2) |
|
6.3.4 Conditional Statements |
|
|
313 | (2) |
|
|
315 | (2) |
|
|
317 | (3) |
|
|
320 | (10) |
|
|
330 | (2) |
|
|
332 | (12) |
|
6.4.1 R-Type Instructions |
|
|
332 | (2) |
|
6.4.2 /-Type Instructions |
|
|
334 | (2) |
|
6.4.3 S/B-Type Instructions |
|
|
336 | (2) |
|
6.4.4 U/J-Type Instructions |
|
|
338 | (2) |
|
6.4.5 Immediate Encodings |
|
|
340 | (1) |
|
|
341 | (1) |
|
6.4.7 Interpreting Machine Language Code |
|
|
342 | (1) |
|
6.4.8 The Power of the Stored Program |
|
|
343 | (1) |
|
6.5 Lights, Camera, Action: Compiling, Assembling, and Loading |
|
|
344 | (11) |
|
|
344 | (2) |
|
6.5.2 Assembler Directives |
|
|
346 | (2) |
|
|
348 | (2) |
|
|
350 | (3) |
|
|
353 | (2) |
|
|
355 | (1) |
|
|
355 | (8) |
|
|
355 | (1) |
|
|
356 | (4) |
|
6.6.3 Signed and Unsigned Instructions |
|
|
360 | (1) |
|
6.6.4 Floating-Point Instructions |
|
|
361 | (1) |
|
6.6.5 Compressed Instructions |
|
|
362 | (1) |
|
6.7 Evolution of the RISC-V Architecture |
|
|
363 | (3) |
|
6.7.1 RISC-V Base Instruction Sets and Extensions |
|
|
364 | (1) |
|
6.7.2 Comparison of RISC-V and MIPS Architectures |
|
|
365 | (1) |
|
6.7.3 Comparison of RISC-V and ARM Architectures |
|
|
365 | (1) |
|
6.8 Another Perspective: x86 Architecture |
|
|
366 | (8) |
|
|
366 | (1) |
|
|
367 | (2) |
|
|
369 | (1) |
|
|
369 | (2) |
|
6.8.5 x86 Instruction Encoding |
|
|
371 | (1) |
|
6.8.6 Other x86 Peculiarities |
|
|
372 | (1) |
|
|
373 | (1) |
|
|
374 | (19) |
|
|
375 | (15) |
|
|
390 | (3) |
|
Chapter 7 Microarchitecture |
|
|
393 | (106) |
|
|
393 | (4) |
|
7.1.1 Architectural State and Instruction Set |
|
|
393 | (1) |
|
|
394 | (2) |
|
|
396 | (1) |
|
|
397 | (1) |
|
7.3 Single-Cycle Processor |
|
|
398 | (17) |
|
|
399 | (1) |
|
7.3.2 Single-Cycle Datapath |
|
|
399 | (8) |
|
7.3.3 Single-Cycle Control |
|
|
407 | (3) |
|
|
410 | (2) |
|
7.3.5 Performance Analysis |
|
|
412 | (3) |
|
|
415 | (24) |
|
7.4.1 Multicycle Datapath |
|
|
416 | (6) |
|
|
422 | (10) |
|
7.4.3 More Instructions i |
|
|
432 | (3) |
|
7.4.4 Performance Analysis |
|
|
435 | (4) |
|
|
439 | (17) |
|
|
441 | (2) |
|
|
443 | (1) |
|
|
443 | (11) |
|
7.5.4 Performance Analysis |
|
|
454 | (2) |
|
|
456 | (12) |
|
7.6.1 Single-Cycle Processor |
|
|
457 | (4) |
|
7.6.2 Generic Building Blocks |
|
|
461 | (3) |
|
|
464 | (4) |
|
7.7 Advanced Microarchitecture |
|
|
468 | (14) |
|
|
468 | (1) |
|
|
469 | (1) |
|
|
470 | (2) |
|
7.7.4 Superscalar Processors |
|
|
472 | (1) |
|
7.7.5 Out-of-Order Processor |
|
|
473 | (3) |
|
|
476 | (2) |
|
|
478 | (1) |
|
|
479 | (3) |
|
7.8 Real-World Perspective: Evolution of RISC-V Microarchitecture |
|
|
482 | (4) |
|
|
486 | (13) |
|
|
488 | (9) |
|
|
497 | (2) |
|
|
499 | (43) |
|
|
499 | (4) |
|
8.2 Memory System Performance Analysis |
|
|
503 | (2) |
|
|
505 | (14) |
|
8.3.1 What Data is Held in the Cache? |
|
|
505 | (1) |
|
|
506 | (8) |
|
8.3.3 What Data is Replaced? |
|
|
514 | (1) |
|
8.3.4 Advanced Cache Design |
|
|
515 | (4) |
|
|
519 | (11) |
|
8.4.1 Address Translation |
|
|
522 | (1) |
|
|
523 | (2) |
|
8.4.3 The Translation Lookaside Buffer |
|
|
525 | (1) |
|
|
526 | (1) |
|
8.4.5 Replacement Policies |
|
|
527 | (1) |
|
8.4.6 Multilevel Page Tables |
|
|
527 | (3) |
|
|
530 | (12) |
|
|
530 | (2) |
|
|
532 | (9) |
|
|
541 | (1) |
|
Chapter 9 Embedded I/O Systems |
|
|
542 | (1) |
|
|
542 | (1) |
|
Chapter 9 Is Available as an online supplement |
|
|
542 | (1) |
|
|
542 | (1) |
|
|
542 | (1) |
|
|
542 | (1) |
|
|
542 | (1) |
|
9.3.2 FE310-G002 System-on-Chip |
|
|
542 | (1) |
|
9.3.3 General-Purpose Digital I/O |
|
|
542 | (1) |
|
|
542 | (1) |
|
|
542 | (1) |
|
|
542 | (1) |
|
|
542 | (1) |
|
|
542 | (1) |
|
9.4 Other Microcontroller Peripherals |
|
|
542 | (1) |
|
|
542 | (1) |
|
|
542 | (1) |
|
9.4.3 Bluetooth Wireless Communication |
|
|
542 | (1) |
|
|
542 | (1) |
|
|
542 | (1) |
|
Appendix A Digital System Implementation |
|
|
543 | (1) |
|
|
543 | (1) |
|
Appendix A is available as an online supplement |
|
|
543 | (1) |
|
|
543 | (1) |
|
|
543 | (1) |
|
|
543 | (1) |
|
|
543 | (1) |
|
|
543 | (1) |
|
|
543 | (1) |
|
|
543 | (1) |
|
|
543 | (1) |
|
A.4 Application-Specific Integrated Circuits |
|
|
543 | (1) |
|
|
543 | (1) |
|
|
543 | (1) |
|
A.7 Switches and Light-Emitting Diodes |
|
|
543 | (1) |
|
|
543 | (1) |
|
|
543 | (1) |
|
A.8 Packaging and Assembly |
|
|
543 | (1) |
|
|
543 | (1) |
|
|
543 | (1) |
|
A.8.3 Printed Circuit Boards |
|
|
543 | (1) |
|
A.8.4 Putting It All Together |
|
|
543 | (1) |
|
|
543 | (1) |
|
A.9.1 Matched Termination |
|
|
543 | (1) |
|
|
543 | (1) |
|
|
543 | (1) |
|
A.9.4 Mismatched Termination |
|
|
543 | (1) |
|
A.9.5 When to Use Transmission Line Models |
|
|
543 | (1) |
|
A.9.6 Proper Transmission Line Terminations |
|
|
543 | (1) |
|
|
543 | (1) |
|
A.9.8 Derivation of the Reflection Coefficient |
|
|
543 | (1) |
|
A.9.9 Putting It All Together |
|
|
543 | (1) |
|
|
543 | (1) |
|
Appendix B RISC-V Instruction Set Summary |
|
|
544 | (1) |
|
|
545 | (1) |
|
|
545 | (1) |
|
Appendix C Is Available as an online supplement |
|
|
545 | (2) |
|
|
545 | (1) |
|
|
545 | (1) |
|
C.2.1 C Program Dissection |
|
|
545 | (1) |
|
C.2.2 Running a C Program |
|
|
545 | (1) |
|
|
545 | (1) |
|
|
545 | (1) |
|
|
545 | (1) |
|
|
545 | (1) |
|
|
545 | (1) |
|
C.4.1 Primitive Data Types |
|
|
545 | (1) |
|
C.4.2 Global and Local Variables |
|
|
545 | (1) |
|
C.4.3 Initializing Variables |
|
|
545 | (1) |
|
|
545 | (1) |
|
|
545 | (1) |
|
C.7 Control-Flow Statements |
|
|
545 | (1) |
|
C.7.1 Conditional Statements |
|
|
545 | (1) |
|
|
545 | (1) |
|
|
545 | (1) |
|
|
545 | (1) |
|
|
545 | (1) |
|
|
545 | (1) |
|
|
545 | (1) |
|
|
545 | (1) |
|
|
545 | (1) |
|
C.8.7 Dynamic Memory Allocation |
|
|
545 | (1) |
|
|
545 | (1) |
|
|
545 | (1) |
|
|
545 | (1) |
|
|
545 | (1) |
|
|
545 | (1) |
|
|
545 | (1) |
|
C.10 Compiler and Command Line Options |
|
|
545 | (1) |
|
C.10.1 Compiling Multiple C Source Files |
|
|
545 | (1) |
|
|
545 | (1) |
|
C.10.3 Command Line Arguments |
|
|
545 | (1) |
|
|
545 | (2) |
Further Reading |
|
547 | (2) |
Index |
|
549 | |