Module

Module 1: Foundations of Digital Logic

25 lessons
Start

Where digital design starts

In 1947 three physicists at Bell Labs got a small piece of germanium to act as a switch, with no moving parts, controlled by a small voltage. That was the first transistor. A transistor in a modern processor switches billions of times a second, and there are billions of them on one chip. Everything digital, from a video stream to a message on your phone, comes down to that one idea: a switch that is either on or off, 1 or 0.

Before you write Verilog to tell those switches what to do, you need the mathematics and logic that describe them. That is what this module covers.

I have seen many people skip this and go straight to Verilog syntax. In my experience it does not save time. Without a working grasp of digital logic you end up spending days debugging hardware problems that ten minutes of Boolean algebra would have prevented.

What the module covers

There are five sections, and each builds on the previous one, so I recommend taking them in order.

  1. Number systems and binary arithmetic. How hardware represents numbers, how it handles negative values, and what goes wrong when a result does not fit.
  2. Boolean algebra. The algebra of logic. A small set of rules that let you simplify circuits on paper.
  3. Logic gates. How Boolean expressions become physical devices, what they cost, and how fast they are.
  4. Karnaugh maps. A graphical way of simplifying logic expressions before you write any HDL.
  5. Combinational building blocks. Multiplexers, decoders, encoders, comparators: the standard parts that appear in almost every design.

What you will be able to do afterwards

By the end of the module a few things should feel natural:

  • Read a logic diagram in a datasheet and see what it does without reading the accompanying text.
  • Spot redundant logic in an expression and simplify it in your head.
  • Understand a synthesis report. When the tool infers a ripple-carry adder, you will know what gates it has put on the chip.
  • Reason about arithmetic bugs, in particular why an addition overflows and how to detect it.

The sections

1.1 Number Systems and Binary Arithmetic

Bits, bytes and hex, then two’s complement for signed numbers, then binary addition, subtraction and overflow. By the end you should be reading hex as easily as decimal.

1.2 Boolean Algebra

Boole published his algebra in 1854, a century before the first electronic computer. We cover the axioms and theorems, De Morgan’s laws and canonical forms, and practise simplifying expressions by hand.

1.3 Logic Gates

The seven basic gates, the compound cells found in real libraries, why NAND and NOR are universal, and what a CMOS gate looks like at transistor level.

1.4 Karnaugh Maps

Two-, three- and four-variable maps, grouping rules, don’t-care conditions, and a look at the Quine-McCluskey method that tools use when maps get too big.

1.5 Combinational Building Blocks

Multiplexers, decoders, encoders, priority encoders and comparators, designed from scratch and then written in Verilog.

The first article asks the obvious question: why do computers use only two digits?

In this module

01 Why Computers Use Only Two Digits 6 min 02 Binary, Octal and Hexadecimal 6 min 03 Converting Between Bases Without a Calculator 4 min 04 Negative Numbers in Hardware: Two's Complement 5 min 05 Binary Addition, Subtraction and Overflow 6 min 06 Boolean Algebra: Two Values, Three Operations 8 min 07 Boolean Axioms and Theorems 8 min 08 De Morgan's Laws and Bubble Pushing 8 min 09 Canonical Forms: Sum of Products and Product of Sums 8 min 10 Algebraic Simplification 8 min 11 What a Logic Gate Really Is 8 min 12 The Seven Basic Gates 8 min 13 Multi-Input Gates, Compound Cells, Tri-State and Transmission Gates 9 min 14 Universal Gates: Building Everything from NAND or NOR 7 min 15 How CMOS Actually Works 11 min 16 Why Karnaugh Maps Work 6 min 17 Two- and Three-Variable Karnaugh Maps 7 min 18 The Four-Variable Karnaugh Map 7 min 19 Don't-Care Conditions 7 min 20 The Quine-McCluskey Method 8 min 21 Multiplexers 7 min 22 Decoders and Demultiplexers 6 min 23 Encoders and Priority Encoders 7 min 24 Comparators 7 min 25 Designing with Building Blocks 7 min