Skip to content
Tutorials Center
My learning

Topics

Digital Logic Tutorial

Learn Digital Logic step by step: 57 lessons in 13 chapters with examples, quizzes, diagrams and projects.

Start learning →

of lessons completed

Digital Foundations

  1. 1 Digital vs Analog Signals Learn why computers use digital signals: analog versus digital, logic levels, noise margins, bits and timing diagrams, with live Python and matplotlib examples.
  2. 2 Binary, Octal and Hexadecimal Learn positional notation and how to convert between binary, octal, decimal and hexadecimal by hand and in Python, plus bits, nibbles and bytes.
  3. 3 Signed Numbers and Two's Complement Learn sign-magnitude, ones' complement and two's complement, number ranges, overflow detection and sign extension, with live Python tables you can run.
  4. 4 BCD, Gray Code and ASCII Learn why we use BCD, Excess-3, Gray code and ASCII or UTF-8, how each code works and where it is used, with live Python encoders and decoders.
  5. 5 Complement Arithmetic: 1's Complement, BCD and Excess-3 Addition Subtract with complements and an end-around carry, then add and subtract decimal digits in BCD and excess-3 with runnable Python models of the correction logic.
  6. 6 Binary Fractions and IEEE 754 Floating-Point Convert fractions between decimal and binary, learn fixed-point versus floating-point, and decode IEEE 754 single and double precision (sign, exponent, mantissa) in Python.
  7. 7 Operational Amplifiers, Comparators and Schmitt Triggers Learn the ideal op-amp rules, inverting, non-inverting and summing amplifiers, the comparator and Schmitt trigger, and key specs such as CMRR and slew rate, with Python models.

Logic Gates

  1. 8 AND, OR and NOT Gates Learn the AND, OR and NOT logic gates: symbols, truth tables, Boolean notation, multi-input gates and switch analogies, with a live Python truth-table generator.
  2. 9 NAND, NOR, XOR and XNOR Learn NAND, NOR, XOR and XNOR gates: truth tables, symbols, XOR as parity and difference, XNOR as equality, and IEC symbol variants, with live Python tables.
  3. 10 Universal Gates and Gate Counts Learn why NAND and NOR are universal gates, build NOT, AND, OR and XOR from NAND only and NOR only, and compare gate and transistor counts with live Python checks.
  4. 11 Functional Completeness and Post's Theorem Learn which sets of gates can build every Boolean function. Apply Post's five classes (0-preserving, 1-preserving, monotone, self-dual, affine) with a Python checker.
  5. 12 Tri-State Buffers, Open-Collector Outputs and Buses Learn how tri-state buffers share a bus using the high-impedance state, what bus contention does, and how open-collector outputs make a wired-AND, with Python models.
  6. 13 Logic Families: TTL vs CMOS, Fan-out and Propagation Delay Compare TTL and CMOS logic families: voltage levels, noise margin, fan-in and fan-out, propagation delay and power, with Python calculators for each rule.
  7. 14 CMOS Gate Circuits, Logic Families and IC Scales See how CMOS NAND, NOR, AOI and OAI gates are built from series and parallel transistors, compare RTL, DTL, TTL, ECL and CMOS logic families, and learn SSI to ULSI.

Boolean Algebra

  1. 15 Boolean Algebra Laws Learn the laws of Boolean algebra: identity, null, complement, distributive, absorption and duality, and prove each one with a truth-table checker in Python.
  2. 16 De Morgan's Theorems and Bubble Pushing Learn De Morgan's theorems, prove them by exhaustive check in Python, use bubble pushing to redraw circuits, and convert AND-OR logic to NAND-only form.
  3. 17 Sum of Products and Product of Sums Turn any truth table into a Boolean expression: learn minterms, maxterms and canonical SOP and POS forms, with a Python expression generator you can run live.
  4. 18 Two-Level Logic and NAND-NAND Implementations Understand two-level logic: AND-OR, OR-AND, NAND-NAND and NOR-NOR forms, which of the 16 gate pairings are degenerate, and how to convert SOP to NAND-only with Python checks.

Simplification

  1. 19 Karnaugh Maps Learn Karnaugh maps step by step: Gray code order, grouping rules, wrap-around, prime implicants and simplification of 2 to 4 variable functions, with live Python.
  2. 20 Don't-Cares and Hazards Use don't-care conditions to shrink K-map results, derive product-of-sums forms, and learn static and dynamic hazards, glitches and the redundant terms that fix them.
  3. 21 The Quine-McCluskey Method Minimize Boolean functions with the Quine-McCluskey tabular method: group minterms, find prime implicants, use the chart, and run a full Python implementation.
  4. 22 Variable Entrant Maps (VEM) Learn variable entrant maps: fold one variable into the cells of a smaller K-map, then simplify with a step-by-step method and a Python checker.

Combinational Building Blocks

  1. 23 Half Adders and Full Adders Build binary adders from logic gates: half adder, full adder and ripple-carry adder, with sum and carry equations, an overflow flag and a runnable Python model.
  2. 24 Carry-Lookahead and Faster Adders Why ripple-carry adders are slow and how carry-lookahead, carry-select and carry-skip adders speed them up, with propagate and generate signals and a Python delay model.
  3. 25 Subtractors and Comparators Design half and full subtractors, turn an adder into an adder-subtractor with two's complement, and build 1-bit and n-bit magnitude comparators in runnable Python.
  4. 26 Binary Multipliers: Shift-and-Add, Array and Booth Build binary multipliers from AND gates and adders: partial products, the combinational array multiplier, the sequential shift-and-add unit and Booth's signed algorithm.
  5. 27 Multiplexers and Demultiplexers Learn multiplexers and demultiplexers: 2:1 to 8:1 MUX equations, building big muxes from small ones, implementing any Boolean function with a MUX, and Python models.
  6. 28 Decoders, Encoders and Priority Encoders Understand 2:4 and 3:8 decoders with enable inputs, decoders as minterm generators, encoders, priority encoders and the seven-segment display idea, with Python models.
  7. 29 Parity and Error Detection Build parity generators and checkers from XOR gates, learn the checksum idea, and encode and correct single-bit errors with a Hamming(7,4) code in Python.

Latches and Flip-Flops

  1. 30 SR Latches and Feedback See how two cross-coupled NOR or NAND gates remember a bit. Learn set, reset, hold, the forbidden state and the gated latch, and simulate feedback in Python.
  2. 31 D Latches and D Flip-Flops Learn the D latch, why edge-triggered D flip-flops are safer, how master-slave design works, and what setup and hold times mean, with Python simulations.
  3. 32 JK and T Flip-Flops Learn SR, JK, T and D flip-flops side by side: characteristic tables and equations, excitation tables, conversions between types, and toggling in Python.
  4. 33 Timing, Clock Skew and Metastability Calculate maximum clock frequency from propagation delays, see how clock skew affects setup and hold, and learn how synchronizers tame metastability.

Registers and Counters

  1. 34 Registers and Shift Registers Learn parallel registers, the four shift register types, universal shift registers, and ring and Johnson counters, with Python models of serial transfers.
  2. 35 Asynchronous and Synchronous Counters Build ripple (asynchronous) and synchronous counters from T flip-flops, make up/down and modulo-N counters, and see clock division in live Python waveforms.
  3. 36 Counter Design: Arbitrary Sequences, Lock-Out and Modulus Design a counter for any state sequence with excitation tables and K-map minimization, using D or JK flip-flops, then test for lock-out and make it self-starting.

State Machines

  1. 37 Finite State Machines: Moore and Mealy Learn finite state machines: states, transitions, outputs and state diagrams. Compare Moore and Mealy machines and run both with a table-driven Python simulator.
  2. 38 Designing a Sequential Circuit Design a sequential circuit step by step: state diagram, state table, state assignment, excitation tables and gates, with a 1011 sequence detector checked in Python.
  3. 39 State Reduction and State Assignment Remove redundant states from a finite state machine with the implication table and partition refinement, then pick binary, Gray or one-hot codes. Includes Python tools.
  4. 40 State Machine Patterns and Pitfalls Learn the practical side of state machines: one-hot versus binary encoding, unreachable states, reset, debouncing, edge detectors and synchronized, glitch-free outputs.
  5. 41 Asynchronous Sequential Circuits and Races Learn asynchronous sequential circuits: fundamental mode, flow tables, stable states, critical and non-critical races, with runnable Python simulations.

Memory and Programmable Logic

  1. 42 ROM, RAM and Memory Organization Understand how memory is built from latches and decoders: ROM as a lookup table, RAM read and write, SRAM versus DRAM, register files and a memory map, with Python models.
  2. 43 PLAs, FPGAs and Lookup Tables See how programmable logic works: PLA and PAL AND-OR planes, lookup tables, FPGA logic elements and routing, plus a Python LUT mapper that implements any 4-input function.
  3. 44 Hardware Description Languages (Verilog and VHDL) Learn what a hardware description language is. Read Verilog modules, assign statements, always blocks and testbenches, and see each one modeled in Python.

Data Communication

  1. 45 Line Coding, Block Coding and Scrambling Learn how digital data becomes voltage levels on a wire: NRZ, RZ, Manchester, AMI, block codes like 4B/5B and scrambling like B8ZS, with Python waveforms.
  2. 46 Modulation and Transmission Impairments Learn how bits travel on a real channel: baseband vs broadband, ASK/FSK/PSK and AM/FM/PM modulation, attenuation, distortion, noise, SNR, Nyquist and Shannon limits.

Toward a Processor

  1. 47 Designing an ALU Design an arithmetic logic unit step by step. Combine an adder, logic gates and a multiplexer, add Z, C, N and V flags, and model an n-bit ALU in Python.
  2. 48 From Gates to a Tiny CPU See how registers, an ALU and a control unit form a CPU. Learn the program counter, instruction register and fetch-decode-execute cycle with an 8-instruction toy CPU.
  3. 49 Microcontrollers and Embedded Digital Systems Learn what a microcontroller contains, how Harvard and von Neumann designs differ, how microcontrollers are classified, and how timers, ADC and PWM work, with Python models.

Projects

  1. 50 Project: Seven-Segment Display Decoder Design a BCD to seven-segment decoder from scratch. Build the truth table, simplify each segment with K-maps and don't-cares, then test it in Python with ASCII art.
  2. 51 Project: A Logic Circuit Simulator Build a gate-level logic simulator in Python. Store a circuit as a netlist, evaluate it in topological order, print truth tables and simulate a full adder.
  3. 52 Project: Vending Machine Controller Design a vending machine controller as a finite state machine. Build the state diagram and table, add change and refund, then test it with sequences in Python.
  4. 53 Project: A 4-bit ALU with Register File Combine a ripple-carry adder, a multiplexer, status flags and a register file into a tiny 4-bit datapath, run a program on it and test it against a reference model.

Practice and Review

  1. 54 Practice: Combinational Logic Ten worked exercises on number conversion, Boolean simplification, K-maps, adders, multiplexers, decoders and comparators, each solution checked by live Python.
  2. 55 Practice: Sequential Logic Solve exercises on flip-flop inputs, counters, shift registers, a 101 sequence detector and clock-period timing, with every answer checked by runnable Python.
  3. 56 Digital Logic Interview Questions Sixteen common digital logic interview questions with short, precise answers: latch vs flip-flop, hazards, metastability, Mealy vs Moore, K-maps and more, with live checks.
  4. 57 Digital Logic Cheat Sheet A one-page digital logic reference: gate truth tables, Boolean laws, flip-flop equations, adder and counter formulas, code tables and timing rules, all verified.