COURSE SERIES

RTL Foundations: From Digital Logic to Testable Designs

A complete 17-lesson plan, from an RTL syntax primer, digital signals, combinational circuits and testbenches to timing, FSMs, delivery interfaces and reproducible verification. Bilingual articles, films and practical work are published in sequence.

17 published, 17 lessons planned

Conceptual RTL logic modules, selection and a protection boundary, not a photograph of a fabricated chip.

The complete 17-lesson roadmap

Start with two sensors sharing one output, then build a small circuit that collects, retains and delivers data. The same example develops throughout the course, with independent examples so you can return to an earlier idea.

  1. F00: RTL syntax primer and the circuit behind each construct
  2. F01–F04: signals and combinational circuits
  3. F05–F08: values, dimensions and stored samples
  4. F09–F12: collection, delivery and automated tests
  5. F13–F16: timing, properties and reproducible delivery

Each lesson includes an article and film in both languages, circuit diagrams, an interactive lab, five questions with explanations, and downloadable RTL and testbenches. The final lesson has two projects. You deliver a data collector first, then a controller for check results.

17 of 17 lessons published.

  1. F00
    Published

    RTL Syntax Primer: What Circuit Does Each Line Build?

    No Verilog background. Read binary values and simple conditions; the register, reset, counter and FSM sections only ask you to recognize the pattern.

    Content steps and practical work
    1. Separate RTL from software: a line describes circuit, and the same code must pass simulation and synthesis.
    2. Read modules, ports and data types, and state every width; a missing width leaves a one-bit signal.
    3. Compare assign with always_comb, then read literals: width, base and truncation.
    4. Read the operators, and answer a one-bit question with a comparison or logical operator.
    5. Trace arithmetic widths and sign extension to find where a carry is lost.
    6. Write combinational if and case with an output on every path; a missing default infers a latch. Then check drivers and loops.
    7. Organize repeated circuit with function, parameter and generate; keep tasks and delays in the testbench.
    8. Recognize always_ff, nonblocking assignment, reset, enable, counters and FSMs, then list constructs that only hold in simulation.

    A 57-file package in which every good version passes simulation and every bad version shows a mismatch or a compiler or Yosys report, plus a lab that switches code, cells, circuit and outputs together.

  2. F01
    Published

    RTL and Hardware Thinking: How Does a Description Become a Circuit?

    Reading simple conditions; no Verilog or register knowledge required.

    Content steps and practical work
    1. Start with two digital sensor flags and one display output; identify the inputs and output before showing syntax.
    2. Write the one-bit input table and check the required selection for both values of sel.
    3. Package the circuit as a module and explain ports and instance connections as signal relationships.
    4. Read a continuous assign as an ongoing relationship, rather than a CPU instruction executed once.
    5. Connect two instances to the same inputs; separate their parallel behavior from physical propagation delay.
    6. Run a small testbench that compares actual outputs with independently specified expectations.
    7. Swap the input connections deliberately and trace a failing row back through the ports and waveforms.
    8. Separate compilation, simulation and synthesis, then inspect the actual mux structure and prepare for wider data.

    A one-bit channel selector, a minimal testbench, a swapped-input counterexample and a live selection model.

  3. F02
    Published

    Bits, Signals and Values: What Does a Bit Pattern Mean?

    F01.

    Content steps and practical work
    1. Expand the one-bit sensor path to eight bits and explain bit positions, byte size, buses and [7:0].
    2. Relate hexadecimal F0 to binary 1111_0000 without changing the transmitted pattern.
    3. Assign a nine-bit value to eight bits and identify exactly which information is discarded.
    4. Derive unsigned 240 and signed two’s complement −16 from the same pattern using position weights.
    5. Separate data types, net/variable objects and their drivers; reg and logic do not determine physical storage.
    6. Observe uninitialized four-state logic and an undriven net as X and Z, with clear limits on physical interpretation.
    7. Use explicit data literals; put unsized-width and signedness probes in an optional runnable experiment.
    8. Record width, signedness, purpose and driver in a signal table before the next lesson uses conditions.

    An eight-bit value inspector, complete numeric and truncation experiments, and a signed-widening bug caught by a testbench.

  4. F03
    Published

    Boolean Decisions: What Does Each Operator Compute?

    F02.

    Content steps and practical work
    1. Define a collector that accepts data only when its channel is enabled and its format is valid.
    2. Build the four-row truth table and map AND, OR and NOT to circuit relationships.
    3. Compare bitwise AND with logical AND using 0010 and 0100, including their different result widths.
    4. Compare bitwise inversion with logical negation on the same multi-bit input.
    5. Calculate a four-bit XOR reduction and explain which errors parity can miss, without calling it authentication.
    6. Read equality, ordering and parentheses, then compare ordinary equality with four-state testbench comparisons.
    7. Replace exact legal-code recognition with a nonzero test and enumerate the invalid inputs that slip through.
    8. Write an independent expected table and carry the decision into the following selection lesson.

    A format checker, four-bit parity model, complete small input tables and a condition inspector.

  5. F04
    Published

    Muxes and Combinational Logic: What Happens When a Branch Is Missing?

    F03.

    Content steps and practical work
    1. Return to channel selection and map if/else and case branches onto the mux control line.
    2. Specify the outputs for legal selector values and an explicit default that matches the product requirement.
    3. Introduce overlapping conditions and work out their priority instead of relying on indentation.
    4. Use always_comb with complete output assignments and a clear procedural driver for every output.
    5. Remove one branch, observe retained output behavior and inspect the tool’s actual latch diagnosis.
    6. Trace a read-before-write example and sensitivity issues; do not invent a rule that a block has only one left-hand signal.
    7. Inspect a combinational feedback mistake with bounded tool execution, without promising every simulator reports X.
    8. Restore complete assignments, rerun the same inputs and check the resulting structure for unintended storage.

    A channel decoder, missing-branch and read-before-write examples, and repaired synthesis results.

  6. F05
    Published

    Arithmetic and Widths: Where Did the Carry and Sign Go?

    F02–F04.

    Content steps and practical work
    1. Add two four-bit sensor values and decide whether the interface preserves carry or deliberately uses modulo arithmetic.
    2. Extend the operands explicitly and compare four-bit and five-bit results, including 15+1.
    3. Trace one addition inside a concatenation; leave the full expression-sizing taxonomy in optional material.
    4. Introduce a negative offset and follow operand widths and signedness before choosing casts or extensions.
    5. Use a signed negative value to compare arithmetic right shift with integer division and their different rounding.
    6. View a fixed shift as bit reconnection; discuss variable shifts and out-of-range selections separately.
    7. Repair a concrete counterexample with tool diagnostics, keeping multiplication and division costs in extensions.
    8. Deliver a numerical range, width and overflow policy so discarded carry is an explicit decision.

    A width-controlled adder, a signed-offset comparison and one short shift experiment.

  7. F06
    Published

    Reuse and Parameters: What Changes When There Are Three Channels?

    F05.

    Content steps and practical work
    1. Change the collector from two channels to three and list the legal selectors and required data width.
    2. Use parameters for module dimensions and localparams for internal constants determined at elaboration.
    3. Distinguish packed data bits from an unpacked channel array, and show the indexed part-select used for the flattened alternative.
    4. Choose a selector width with the supplied minimum-width helper; define selector=3 when CHANNELS=3 and handle the single-channel corner case explicitly.
    5. Use a small pure combinational function for repeated calculation; a call does not imply storage, elapsed cycles or one physically shared hardware unit.
    6. Compare instantiated hardware with procedural work; place generate and detailed loop forms in optional examples.
    7. Test minimum dimensions, three channels, the last legal channel and invalid selector behavior.
    8. Record elaborated sizes and legal parameter values; prepare for the next lesson’s explicit storage requirement.

    A parameterized three-channel selector, minimal-size tests and an elaboration-versus-runtime comparison.

  8. F07
    Published

    Registers: How Do We Keep a Result?

    F04; use F02 for numerical interpretation.

    Content steps and practical work
    1. Show why a finished sensor result disappears if the source changes before the receiver can use it.
    2. Introduce D, Q and the clock edge as the input, retained output and agreed sampling event.
    3. Trace what the register keeps between edges and what changes at the next sampling event.
    4. Use enable to distinguish an update event from a cycle in which Q holds its existing value.
    5. Define the reset value and priority so simultaneous reset and enable have an unambiguous result.
    6. Match the timing table to a small clocked RTL description with active-low synchronous reset; the _ni suffix specifies polarity, not asynchronous behavior.
    7. Drive the testbench away from the sampling edge and verify updates and holds without creating a race.
    8. Keep asynchronous-reset timing as an introduction; detailed deassertion and clock-domain handling arrive in F14.

    A result register with explicit enable and reset priority, plus an edge-by-edge data table.

  9. F08
    Published

    Clock-Edge Sampling: Which Value Does Each Register Read?

    F07.

    Content steps and practical work
    1. Draw two physical storage stages and follow how many clock edges a new sample needs to reach stage two.
    2. Separate values before the edge, right-hand evaluations and values after nonblocking updates.
    3. Trace three distinct samples through q1 <= din and q2 <= q1 using the same sampling table.
    4. Compare a deliberate blocking-assignment version in one block and identify its different dataflow.
    5. Explain blocking for ordered combinational calculation and nonblocking for this series’ clocked storage.
    6. Drive inputs at the falling edge and observe after the rising edge using a stated ten-nanosecond testbench clock.
    7. Keep a snapshot when an event depends on pre-update data, preparing for the fire event in F11.
    8. Repair the expected cycle count and distinguish standard-permitted cross-block races from repeatable tool observations.

    A two-stage register path, two testbench sampling strategies and a before-edge/after-update table.

  10. F09
    Published

    Counters: How Do Four Clock Cycles Differ from Four Completed Operations?

    F05 and F08.

    Content steps and practical work
    1. Specify four completed samples and distinguish a synchronous work event from an idle clock cycle.
    2. Trace current and next counts from zero and identify exactly which event completes the job.
    3. Update only on sample_take, then compare a deliberately wrong counter that increments every cycle.
    4. Distinguish an index ranging from zero to three from a completion count ranging from zero to four.
    5. Use the pre-edge count to recognize the fourth event without introducing a one-cycle error.
    6. Choose stopping, saturation or wraparound behavior at the limit and update the expected table accordingly.
    7. Define a timeout’s first counted edge and the priority of simultaneous completion and expiration in optional material.
    8. Replay the same event sequence with idle cycles and reconcile the counter against the actual work log.

    An event-counting sample counter with boundary tests and a separate timeout extension.

  11. F10
    Published

    Finite State Machines: How Do We Organize a Job into Stages?

    F04, F08 and F09.

    Content steps and practical work
    1. Describe waiting, collecting and reporting as stages with different accepted events.
    2. Draw IDLE, COLLECT and REPORT, putting the transition conditions on the connecting lines.
    3. Write a complete transition table including holds, completion and reset, with outputs for every legal state.
    4. Separate the state register, next-state value and combinational decision logic.
    5. Make the fourth sample event cause the collection-to-report transition rather than merely counting elapsed cycles.
    6. Compare one output based on current state with one based on immediate conditions before naming machine categories.
    7. Test every legal transition and an invalid-state RTL scenario; inspect synthesis before making encoding claims.
    8. Use an explicit synchronous report_taken event, then ask whether the downstream receiver has really taken the result.

    A collector state diagram, complete transition table and runnable FSM with explicit report acceptance.

  12. F11
    Published

    Valid/Ready: Where Does the Result Wait During a Stall?

    F08–F10.

    Content steps and practical work
    1. Pause the receiver for three cycles and distinguish computation completion from delivery completion.
    2. Define valid, ready and fire at the shared sampling edge, where fire is valid && ready.
    3. Allow the source to present valid without waiting for ready and hold valid/data until transfer.
    4. Specify empty/full behavior, input acceptance, output acceptance and replacing an old result on the same edge.
    5. Record pre-edge fire/data separately from post-update buffer contents.
    6. Compare two independent bugs: overwriting data during a stall and pulsing valid for only one cycle.
    7. Inspect combinational dependencies between ready and valid so connected modules do not form a loop.
    8. Use accepted transfers to update progress and leave REPORT; cancel pending data and scoreboard state under the stated reset policy.

    A one-entry result buffer, stall traces and accepted-transfer records, including simultaneous receive and send.

  13. F12
    Published

    Testbenches: How Can a Test Detect the Error for Us?

    F11; previous lessons supply the minimal testbench examples.

    Content steps and practical work
    1. Start from a missing-transfer waveform and identify why printed signals or an ungrounded PASS message are insufficient.
    2. Separate driver, DUT, monitor and scoreboard; observe accepted interface events rather than internal completion claims.
    3. Queue expected transactions and compare each output’s data and ordering, not just the total count.
    4. Retain the single-clock drive/observe phases and separate pre-edge acceptance from post-update state.
    5. Use testbench tasks to organize repeated timed actions without placing them in the synthesizable DUT.
    6. Run directed boundaries before seeded stall variation and retain the seed and shortest failing trace.
    7. Use explicit four-state checks so X cannot quietly become a successful binary comparison.
    8. Remove a real RTL update condition, verify that the test detects it, repair it and rerun the same counterexample.

    A collector testbench, independent reference queue, reproducible seeds and targeted negative cases.

  14. F13
    Published

    Timing and Pipelines: What If the Work Does Not Fit in One Cycle?

    F06–F12.

    Content steps and practical work
    1. Draw a register-to-register path whose arithmetic is logically correct but may not settle before the next edge.
    2. Build an illustrative timing budget from clock-to-Q, combinational delay and setup, labeling invented teaching numbers as assumptions.
    3. Explain the separate minimum-path hold requirement and why a longer period does not repair that hold check.
    4. Insert a pipeline register and trace the extra sample latency alongside steady-state throughput.
    5. Move valid and related fields with the data, then expose a version that delays only the data.
    6. Fix the main example’s receiver as always ready; explain the additional storage/control required for stalls.
    7. Inspect actual arithmetic, mux, variable-shift and register structures; require libraries and constraints before claiming physical frequency.
    8. Choose stages using latency, throughput and resource requirements rather than treating more pipeline stages as always better.

    An always-ready sample-processing pipeline, aligned data/valid traces and separately labeled structure/timing reports.

  15. F14
    Published

    Reset and Clock Domains: Why Can Another Clock Miss the Event?

    F07, F08, F11 and F13.

    Content steps and practical work
    1. Give the collector and manager different clocks and identify where the shared-edge assumption stops applying.
    2. Place a short pulse between destination sampling edges and work out how it can be missed completely.
    3. Introduce physical sampling uncertainty and the conditions under which synchronizers reduce risk, without promising zero risk.
    4. Distinguish a sustained one-bit level, a short event pulse and a multi-bit data word.
    5. Hold a request and its data until acknowledgement in a conceptual handshake; put the complete multi-clock RTL in extensions.
    6. Separate asserting reset (driving it active, not an F15 property assertion) from deasserting it, including active-low polarity and domain-specific synchronized release.
    7. Explain why independently synchronizing each bit does not establish a coherent word; choose a suitable handshake, FIFO or encoding.
    8. Record the crossing type, assumed protocol and still-needed tool/physical evidence without calling the digital example a metastability measurement.

    An ideal two-clock pulse-sampling experiment, independent timing table and a clock-domain signal inventory.

  16. F15
    Published

    Assertions and Reachability: Did the Required Scenario Occur?

    F08, F11 and F12.

    Content steps and practical work
    1. Keep valid low throughout a test and ask what a never-failing stall-stability check has actually exercised.
    2. Write a timed natural-language stability contract and draw at least two sampling edges.
    3. Match a minimal runnable check to sampled values; leave concurrent SVA operators and reset cancellation in guided extensions.
    4. Use cover to ask whether a stall and later delivery are reachable, separating an example from universal correctness.
    5. Read actual assertion, assumption and cover results; provide a supported immediate/history harness separately from concurrent-SVA reading examples.
    6. State initial reset, past_valid and environmental protocol assumptions so missing history or overconstraint cannot hide a bug.
    7. Clear valid too early in a wrong version, obtain a counterexample and trace it cycle by cycle.
    8. Distinguish no counterexample within a bound from a completed proof; avoid properties that merely repeat an output’s definition.

    A readable property set, actual counterexample/cover results and an optional bounded-formal harness.

  17. F16
    Published

    Delivering a Small IP Block: Can Another Engineer Reproduce the Result?

    F01–F13 and F15. F14 can follow because the main integration has one clock. F16A and F16B are separate teaching sessions.

    Content steps and practical work
    1. Integrate the collector’s data path, counter, state machine, result buffer and tests into one independent package.
    2. Exercise normal, idle, boundary, stall and reset behavior plus specified wrong versions before claiming integration success.
    3. Adapt storage and delivery to one outstanding check; the trusted checker and controller share a synchronous reset that cancels both sides’ old work. The checker never replies for cancelled work, and the controller ignores done when no job is outstanding.
    4. Keep checked and verified separate: a failed completed check can be checked without being verified.
    5. Derive the true accept event from the interface and an independent request/checker history; reset blocks grant, done acceptance and delivery at the same edge.
    6. Inspect actual registers, muxes, counters and FSM synthesis, including recoding or merging before making physical-copy claims.
    7. Package interface rules, tool versions, hashes, commands, expected outputs, actual evidence and limits so another reader can reproduce the result.
    8. Use a checker that violates reset cancellation to demonstrate stale replies during new work; explain the need for generation identity if shared cancellation is unavailable, then connect to anti-tampering.

    A complete collector, a checker-result controller and conforming/violating checker models, with reproducible evidence and explicit trust/reset assumptions.

Where the foundations lead

Continue to the existing AES and SHA-256 RTL introductions for cryptographic applications, using the corresponding concept lessons for algorithm background. The anti-tampering route adds fault models and authorization provenance to the numerical, storage, delivery and verification methods learned here. Advanced cryptanalysis, statistics and physical analysis still require additional background.