LEARNING TRACK

RTL Design and Hardware Defense

Start with signals, modules and testbenches. Follow data through AES/SHA cores, then study how faults can change decisions and authorization in anti-tampering RTL.

Start with RTL Foundations if RTL is new to you. With synchronous RTL basics, continue to SHA-256, AES and the Anti-Tampering series.

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

Course series in this track

Browse the RTL element encyclopedia

RTL Elements Encyclopedia

Each entry starts from working RTL. Begin by routing a sensor reading through a multiplexer, then use a register to keep the reading across clock cycles.

26 of 26 entries are available.

Combinational logic and routing

  • Basic logic gates

    Available

    Map the truth tables for AND, OR, NOT, NAND, NOR and XOR to gates. Then use four-bit inputs to work out the output width of a bitwise operation, a logical test and a reduction.

  • Multiplexer (mux)

    Available

    Use a select signal to route one of several inputs to a shared output. Three channels need two select bits, so what should the fourth code produce? Specify that case before testing for swapped inputs and missing assignments.

  • Demultiplexer (demux)

    Available

    Route a data input to one selected output and assign an idle value to the others. When the data equals that idle value, what signal tells a receiver that it was selected?

  • Decoder

    Available

    Expand a binary index into one enable bit per channel. For three channels, check that each legal index enables exactly one output. Specify the unused index and the global disable case separately.

  • Priority encoder

    Available

    When several requests are active, apply a specified priority order and return the winner’s index. Index 0 can occur both with no request and when request 0 wins, so use valid to indicate when the index can be used.

Arithmetic and bit operations

  • Adder

    Available

    Start with a full adder and follow its carry into the next bit. With four-bit inputs, 15 plus 1 yields 16 with the fifth bit kept and 0 with a four-bit result. Use the example to set the output width and distinguish unsigned carry from signed overflow.

  • Subtractor

    Available

    Use two’s complement to express subtraction with an adder, then trace a negative result and the borrow. For four-bit 3 minus 5, the interface’s numeric range determines whether the result bits mean 14 or −2.

  • Comparator

    Available

    Compare the same bit patterns for equality and magnitude. In four bits, 1111 is above 0001 under unsigned interpretation and below it under signed interpretation. For mixed types, check how the operands are extended before interpreting the result.

  • Fixed shift

    Available

    Draw a fixed left or right shift as bit wiring, marking discarded bits and fill positions. Apply a logical right shift and a signed arithmetic right shift to a negative value and check what zero fill and sign fill produce.

  • Variable shift

    Available

    Drive the shift amount from an input and trace how its bits select distances through mux stages. For an unsigned logical right shift, test zero, the last in-range distance and a distance at least as large as the data width. Then inspect the structure the tool synthesizes.

Storage, sampling and counting

  • D flip-flop

    Available

    Line up D, Q and the sampling edges in a waveform. If D changes several times between rising edges, Q keeps the previous sample and updates at the next rising edge. Use the trace to distinguish the values before sampling and after the update.

  • Register

    Available

    Use one enable signal to control when a word of storage updates. Change the input with enable inactive and read the previous word back from Q. Add reset and check the specified priority when reset and enable are both active.

  • Synchronous reset

    Available

    Use an active-low reset to compare a pulse that overlaps a sampling edge with one that falls entirely between edges. Mark when Q takes the reset value and when the first data word can be written after release.

  • Asynchronous reset

    Available

    Assert reset between two clock edges and observe how Q updates in RTL. Then examine recovery and removal requirements at release and how to synchronize that release separately in each clock domain.

  • Shift register

    Available

    Wire each stage’s Q to the next stage’s D and track distinct input values one clock edge at a time. Predict how many sampling edges the first value needs to reach the final stage, then use the waveform to diagnose an off-by-one count.

  • Wrapping counter

    Available

    Increment on the specified event and return to zero on the next event at the limit. Verify the 5-to-0 transition of a modulo-6 counter and add idle cycles near the limit to check that the count holds.

  • Saturating counter

    Available

    Hold the count at its limit even as more events arrive. Compare saturation and wraparound with the same event sequence, and specify how a completion signal behaves on reaching the limit and on later events.

  • Edge detector

    Available

    Compare a synchronous input with its previous sample to turn a low-to-high transition into a one-cycle event. Trace the first sample after reset and examine a short pulse crossing clock domains that the receiver can miss entirely.

  • Latch

    Available

    Show how an intentional latch passes its input while enabled and holds the value when disabled. Then test combinational logic with a missing assignment, explain why its output holds, and check what the tool infers.

Addressable storage

  • Register array

    Available

    Use an index to select a register for reading or writing, and draw the read mux and write enables separately. With three registers, test legal and out-of-range indices, then document the RTL interface policy and the structure the tool synthesizes.

  • Read-only memory (ROM)

    Available

    Look up fixed table values by address and compare combinational reads with reads that return data after a sampling edge. Use the synthesis report to identify the target’s implementation in logic or memory resources and document the coding patterns that tool supports.

  • Random-access memory (RAM)

    Available

    Set the write edge and read latency, then specify whether a same-cycle read and write at the same address should return old or new data. Check which access patterns infer the target’s memory blocks and retain the tool version, target device and report.

Data flow, control and clock-domain crossings

  • Single-entry buffer

    Available

    When the receiver stalls, trace how a valid/ready interface holds one word until transfer. Then check how the stored word and its valid flag update when an old word leaves and a new word arrives on the same edge.

  • First-in, first-out queue (FIFO)

    Available

    Trace the read pointer, write pointer and occupancy of a single-clock FIFO. Specify which transfers are allowed when empty or full and when enqueue and dequeue coincide. Use an independent reference queue to check output ordering after the pointers wrap.

  • Finite state machine (FSM)

    Available

    Draw waiting, collection and reporting as states, each transition labeled with the event it samples. Compare outputs based on current state alone with outputs that also depend on inputs, and test reset, holds and every transition.

  • Two-flop CDC synchronizer

    Available

    Sample a sustained one-bit level with two flip-flops on the destination clock and trace the synchronization latency. Compare the needs of short pulses and multi-bit words, and state what the digital waveform shows and what physical evidence is needed to assess metastability risk.