Skip to content

Chapter 2: Boolean Algebra and Verilog Basics

Chapter 1 showed that a function can be given as a circuit, an expression or a truth table. This chapter asks what to do with that freedom. The same function has many circuits, and some are smaller, faster or cheaper than others. The first four sections give you the algebra for rewriting an expression into a better one, and the last three turn to SystemVerilog, the language in which the circuits are described and built. The chapter follows Lecture 2.

After the chapter you can:

  • Simplify an expression step by step, naming the law behind each step and checking that nothing changed.
  • Read a truth table as a sum of products or as a product of sums, and convert between them.
  • Compare circuits by gate count, levels and transistor cost, and rebuild a circuit from NAND gates alone or NOR gates alone.
  • Push inversion bubbles through a circuit with DeMorgan's law and say what it computes.
  • Write small SystemVerilog modules with operators, buses and multiplexers, and explain what hardware they describe.
  1. Boolean algebra: the laws, and simplification by derivation.
  2. Sum of products and product of sums: two ways to turn a table into an expression.
  3. Minimization goals and gate cost: what "smaller" means, and universal gates.
  4. DeMorgan's law and bubble pushing: moving inversions through gates.
  5. Modules and signals in SystemVerilog.
  6. Signed numbers, buses, literals and concatenation.
  7. Hierarchy, always_comb and multiplexers.

Sections 1 to 4 are about expressions and gates. Their truth tables are generated from specifications, their circuit drawings are laid out by hand and checked against a specification, and each step of a derivation is checked to leave the function unchanged; which law a step cites is not checked by a program. Sections 5 to 7 show SystemVerilog listings that are real files processed by the book's checking tools, and two block diagrams in Section 2.7 are illustrations that no program checks.