Chapter 3: Simulation, Hazards and Karnaugh Maps
This chapter follows Lecture 3. It has two halves that meet in the middle. The first half is about finding out what a circuit does: you write a testbench, run a simulator, and read the waveform it produces. The second half is about making a circuit smaller: you turn a truth table into a Karnaugh map, circle groups of 1s, and read off a short sum of products. The bridge between them is timing. Gates are not instantaneous, so a circuit that is logically correct can still show a brief wrong output, and the cure for that comes from the map.
Chapter 1 gave you gates and truth tables, and Chapter 2 gave you Boolean algebra and the first SystemVerilog. This chapter is where you start to check your work with a simulator, and it is the last chapter before registers and state machines.
What you will be able to do
Section titled “What you will be able to do”After this chapter you can:
- write a testbench that exercises a combinational module with every input you care about, and read the waveform it produces;
- find where a wrong output comes from by adding internal signals, and tell the three kinds of unknown value apart;
- work out, for a circuit whose gates each have a delay, when each signal changes, when the output is first known, and whether the output glitches;
- minimize a function of up to four variables with a Karnaugh map, including functions with don't-care inputs;
- avoid a glitch by adding a redundant group, and say what it costs;
- design the logic for a small decoder or game judge from a description, and check it in a simulator.
Sections
Section titled “Sections”- 3.1 Testbenches
- 3.2 Reading waveforms and debugging
- 3.3 Gate delays and glitches
- 3.4 On sets, off sets and the uniting theorem
- 3.5 Building K-maps
- 3.6 Grouping and reading terms
- 3.7 Don't cares
- 3.8 Hazards and how to avoid them
- 3.9 Design examples
- 3.10 Review for Quiz 1
The first three sections stand apart from the rest. If you only have time for the Karnaugh map half before a lab, start at 3.4. Sections 3.4 to 3.7 build the map, and 3.8 uses it to cure the glitch that 3.3 found. Section 3.9 puts everything to work on three design problems, and 3.10 reviews this chapter and the two before it.