A good site for the basics of digital logic: All About Circuits. Look up Volume IV - Digital of its free textbook, Lessons In Electric Circuits, which walks from number systems and logic gates all the way to memories and microprocessors.
What the book is
Lessons In Electric Circuits is a free textbook series written by Tony R. Kuphaldt and hosted on All About Circuits. Volume IV covers digital electronics. It is written for people learning on their own or in a technician or early engineering course, so it explains each idea with plain words, small circuits and truth tables before it adds any algebra. The author's own copy states that it is released under a Creative Commons CC BY license, so it is free to read, print and share with credit.
Why it is worth your time
- It starts from zero. Binary numbers, then gates, then Boolean algebra, then circuits built from gates. Nothing is assumed.
- It shows real hardware. Unlike many logic texts, it explains how TTL and CMOS gates are built inside, what logic voltage levels mean, and why switches bounce. That context helps when a circuit on the bench does not behave like the truth table.
- It covers the whole path. Combinational logic, latches and flip-flops, counters and state machines, shift registers, converters, communication, memory and a simple microprocessor are all in one volume.
- It is free and stable. You can read it online, download it as a PDF from the author's archive, and send a student a link without worrying about a paywall.
Who should read it
- Students starting a first digital electronics course, as a second explanation alongside the course textbook.
- Engineers from software, mechanical or analog backgrounds who need digital logic basics quickly.
- Candidates preparing for a first digital design interview who want to refresh number systems, gates, flip-flops and counters.
It is not a VLSI or HDL book. It does not teach Verilog or VHDL, static timing analysis or chip design flows. Read it for the foundations, then move to an HDL text.
A suggested study path
- Chapters 1 to 3: numbers, binary arithmetic and gates. One evening each.
- Chapters 7 to 9: Boolean algebra, Karnaugh maps and combinational blocks. Work every example by hand.
- Chapters 10 to 12: latches, flip-flops, counters and shift registers. This is where most interview questions come from.
- Chapters 13, 15 and 16 when you need them: converters, memory and how a simple processor fits together.
- Chapters 4 to 6 (switches, relays, ladder logic) are useful for industrial control and can be skipped for chip design.
Deep dive: the numbers and details
This part holds a chapter-by-chapter guide with direct links and a few worked examples to test yourself with. Skip it if the overview is all you need.
Chapter-by-chapter guide
Each link below goes to that chapter in the author's own online copy of the book, which lists every section on one page. The section names are taken from those pages.
| Chapter | What it covers |
|---|---|
| 1: Numeration systems | Decimal versus binary, octal and hexadecimal, and conversion in both directions |
| 2: Binary arithmetic | Binary addition, negative numbers, subtraction, overflow and bit groupings |
| 3: Logic gates | NOT, buffer and multiple-input gates, TTL and CMOS gate circuitry, special outputs, gate universality, logic voltage levels and DIP packaging |
| 4: Switches | Switch types, contact design, normal states and contact bounce |
| 5: Electromechanical relays | Relay construction, contactors, time-delay, protective and solid-state relays |
| 6: Ladder logic | Ladder diagrams, interlocks, motor control, fail-safe design and PLCs |
| 7: Boolean algebra | Identities, properties, simplification rules and examples, XOR, DeMorgan's theorems, truth tables to expressions |
| 8: Karnaugh mapping | Venn diagrams, Karnaugh maps up to four variables, minterm versus maxterm solutions and sum and product notation |
| 9: Combinational logic functions | Half and full adders, decoders, encoders, demultiplexers and multiplexers |
| 10: Multivibrators | Feedback, S-R and D latches, edge-triggered flip-flops, J-K flip-flops, asynchronous inputs and monostables |
| 11: Counters | Asynchronous and synchronous counters, counter modulus and finite state machines |
| 12: Shift registers | Serial and parallel in and out, universal shift registers and ring counters |
| 13: Digital-analog conversion | Binary-weighted and R/2R DACs; flash, digital ramp, successive approximation, tracking, slope and delta-sigma ADCs |
| 14: Digital communication | Networks and buses, data flow, electrical and optical signals, topologies and protocols |
| 15: Digital storage (memory) | Memory terms, modern and historical memory technologies, ROM and drives |
| 16: Principles of digital computing | A binary adder, look-up tables, finite-state machines, microprocessors and programming |
Check yourself: four worked examples
These short problems match the chapters above. If you can do them without looking anything up, you have the basics that the book teaches.
Number systems (chapters 1 and 2). Convert decimal 200 to binary and hexadecimal. 200 = 128 + 64 + 8 = 1100 1000 in binary, which is 0xC8. In 8-bit two's complement, the same bit pattern means 200 - 256 = -56, which is why overflow matters when you add signed numbers.
Boolean simplification (chapters 7 and 8). Simplify F = A'B'C + A'BC + AB'C + ABC. Every term contains C, and the four terms cover all combinations of A and B, so F = C. On a three-variable Karnaugh map the four ones form a single group of four in the C = 1 half of the map, giving the same answer.
Counters (chapter 11). How many flip-flops does a mod-12 counter need? Three flip-flops give 2^3 = 8 states, too few; four give 16, enough. So four flip-flops, with logic to reset or reload the count after state 11. A ripple (asynchronous) version is simpler but its outputs settle one flip-flop delay after another, so with four stages of 10 ns each (illustrative), the last bit settles 40 ns after the clock edge. A synchronous counter updates all bits on the same edge.
DAC output (chapter 13). An ideal n-bit DAC gives V_out = V_ref x D / 2^n for input code D. For an 8-bit R/2R DAC with V_ref = 5.12 V, one step (1 LSB) is 5.12 / 256 = 20 mV, and code 0x80 (128) gives 2.56 V, half scale.
What to read next
- For interview preparation that builds on these basics, see the digital logic design interview essentials reading list on this blog.
- For a classic exercise that tests whether you really understand gate universality from chapter 3, try the puzzle can you build a mux out of XOR gates?


Your comments will be moderated before it appears here.