Digital Logic from Zero: Binary, Gates, Boolean Algebra, Flip-Flops and Counters
Every phone, computer and games console is built from one simple idea: a switch that is either on or off. This course starts there and assumes nothing. You will count in binary, build circuits from logic gates, simplify them with Boolean algebra and K-maps, give them memory with flip-flops, and finish with counters, memory chips and GATE-style problems. Every truth table and circuit in it was checked by a simulator.
Start here
Start with Volume 00. It explains what digital logic is, why computers use only two values and how the course works. It ends with your first circuit: one light controlled by two switches. Then take the volumes in order - each one uses only what came before it.
This course assumes nothing. You do not need to know any electronics or any programming. If you can count and follow a table, you can start.
Every truth table, circuit diagram and timing diagram here was checked by a simulator before it was published, so a table always matches its circuit. Each new word is underlined with dots - point at it (or tap it) to see what it means. Every sub-module ends with a quick check, so you know whether an idea has landed before you move on.
Digital logic is the ground floor of every hardware course on this site. When you finish, go on to Verilog and SystemVerilog to describe circuits in code, or to State Machines from Zero. If you are preparing for GATE, Volume 10 has practice problems in the GATE style.
Full syllabus
Part I - Numbers and gates
- 00 Start Here: What Digital Logic Is What digital logic is, why computers use only two values, how this course works, and a first circuit: one light controlled by two switches. Live
- 01 The Numbers Computers Use Binary, hexadecimal and octal, converting between bases, negative numbers in two's complement, and the codes computers use: BCD, Gray code and ASCII. Live
- 02 Logic Gates The seven basic gates, truth tables and timing diagrams, why NAND and NOR can build anything, and what gates look like on real chips. Live
Part II - Simplifying logic
- 03 Boolean Algebra The rules of Boolean algebra, De Morgan's theorems, sum-of-products and product-of-sums forms, minterms and maxterms, and simplifying a circuit step by step. Live
- 04 K-Maps and Simplification Karnaugh maps for two, three and four variables, don't-care conditions, product of sums from a map, and hazards - the glitches a correct circuit can make. Live
Part III - Building blocks
- 05 Combinational Building Blocks Multiplexers, decoders and demultiplexers, encoders and priority encoders, comparators and seven-segment display decoders - and building any function from a multiplexer or a decoder. Live
- 06 Arithmetic Circuits Half and full adders, the ripple-carry adder, subtraction with two's complement, overflow, and the faster carry look-ahead adder. Live
Part IV - Memory and time
- 07 Latches and Flip-Flops Why circuits need memory, the SR latch, the D latch, the D flip-flop, JK and T flip-flops, and setup time, hold time and clock-to-Q delay. Live
- 08 Registers, Counters and Shift Registers Registers, shift registers, ring and Johnson counters, ripple and synchronous counters, and designing a counter for any sequence. Live
Part V - Real chips and revision
- 09 Memory, ADC/DAC and Logic Families ROM and RAM, programmable logic, digital-to-analogue and analogue-to-digital converters, and the TTL and CMOS logic families. Live
- 10 Digital Logic Problem Vault A formula and fact sheet, GATE-style practice problems written for this course with full solutions, and interview and viva questions. Live
What you need before starting
| What | Why | Free option |
|---|---|---|
| Nothing but curiosity | Volume 00 starts from the very beginning | - |
| Pencil and paper | Most of the work is small tables and drawings you do by hand | - |
| Optional: a circuit simulator | To build the circuits yourself and watch them work | CircuitVerse runs in a web browser; Logisim-evolution runs on your computer |
| Optional: a breadboard kit | To build gates from real chips | A breadboard, a 5 V supply, some LEDs and a few 74HC chips - the course never needs one |