HDLForge learning hub

RTL Design Practice & Interview Preparation

Practice synthesizable RTL design with focused exercises covering combinational logic, sequential logic, counters, FIFOs, arbiters, register files and timing-aware design.

What interviewers usually look for

A strong answer translates the requirement into synthesizable state and combinational logic, states reset and update semantics precisely, and handles boundary conditions rather than only the nominal case.

How to practise this topic

  1. Check reset or initialization before normal operation.
  2. Exercise the nominal sequence cycle by cycle.
  3. Test boundaries such as zero, maximum count, wraparound, full/empty, or simultaneous controls when they apply.

Practice problems

2:1 Multiplexer
Easy · combinational · mux
Design a synthesizable 2:1 multiplexer.
Parameterized Counter
Easy · sequential · counter · parameter
Build a parameterized synchronous up-counter with reset.
Priority Encoder
Medium · combinational · encoder
Design an 8-to-3 priority encoder where bit 7 has the highest priority.
Synchronous FIFO
Hard · fifo · memory · handshake
Implement a synchronous parameterized FIFO with ready/valid-style enqueue and dequeue controls.
Shift Register
Easy · sequential · shift-register
Build a parameterized register that stores multiple bits and can shift its contents by one position on each clock edge.
Rising Edge Detector
Easy · sequential · edge-detection
Generate a one-cycle pulse whenever an input signal transitions from 0 to 1.
4-Request Priority Arbiter
Medium · combinational · arbiter · priority
A priority arbiter chooses one winner when multiple devices request access to a shared resource at the same time.
Small Register File
Medium · register-file · memory · sequential
Implement a 4-entry register file with one synchronous write port and two asynchronous read ports.
8-bit LFSR
Medium · sequential · lfsr · pseudo-random
Implement an 8-bit linear-feedback shift register for pseudo-random sequence generation.
Programmable Clock Divider
Medium · sequential · counter · clock
Create a programmable divide-by-N toggle output.
Ready/Valid Skid Buffer
Hard · ready-valid · pipeline · backpressure · skid-buffer
Build a one-entry skid buffer that preserves data when downstream backpressure arrives.
Elastic Pipeline Register
Medium · pipeline · valid · throughput
Implement a single-stage pipeline register with an aligned valid bit.
Asynchronous-Assert Reset Synchronizer
Medium · reset · cdc · synchronizer
Create a two-flop reset synchronizer with asynchronous assertion and synchronous deassertion.
Binary to Gray Counter
Medium · gray-code · counter · cdc
Build a parameterized binary counter and expose its Gray-code representation.
Simple Dual-Port RAM
Medium · memory · ram · bram · dual-port
Infer a small synchronous-write, asynchronous-read dual-port memory.
One-Hot Traffic-Light FSM
Medium · fsm · one-hot · sequential
Implement a three-state one-hot finite-state machine.
3-to-8 Decoder
Easy · decoder · combinational
Decode a 3-bit input into a one-hot 8-bit output.
4-Way One-Hot Multiplexer
Medium · mux · one-hot
Select one of four 8-bit inputs using a one-hot select vector.
16-bit Magnitude Comparator
Easy · comparator · unsigned
Compare two unsigned 16-bit values.
8-bit Barrel Shifter
Medium · barrel-shifter · shift
Shift an 8-bit word left or right by 0-7 positions in one combinational stage.
Leading-Zero Counter
Medium · leading-zero · priority
Count the number of leading zeros in an 8-bit value.
8-bit Population Count
Medium · popcount · reduction
Count how many bits are set in an 8-bit input.
Four-Input Min/Max
Medium · min · max · comparator-tree
Find the minimum and maximum of four unsigned 8-bit values.
Even-Parity Generator
Easy · parity · reduction-xor
Generate the parity bit required to make an 8-bit word have even parity.
Register with Clock Enable
Easy · register · enable
Build an 8-bit register that updates only when enable is high.
Toggle Flip-Flop
Easy · toggle · flip-flop
Toggle an output bit whenever toggle_en is asserted.
Sticky Status Flag
Easy · sticky-bit · status
Latch an event until software explicitly clears it.
Pulse Stretcher
Medium · pulse · counter
Stretch a one-cycle input pulse into a four-cycle output pulse.
4-Cycle Delay Line
Medium · delay-line · pipeline
Delay an 8-bit sample by exactly four clock cycles.
Serial-to-Parallel Receiver
Medium · serial · shift-register
Collect eight serial bits into one parallel byte.
1011 Sequence Detector
Medium · fsm · sequence-detector
Detect the serial bit pattern 1011 with overlapping matches allowed.
Request/Acknowledge Controller
Medium · fsm · handshake
Control a request/acknowledge transaction.
Pedestrian Crossing FSM
Medium · fsm · controller
Control traffic and pedestrian signals through WAIT, STOP and WALK phases.
Timeout and Retry FSM
Hard · fsm · timeout · retry
Retry a request after a timeout, up to three attempts.
Packet Header Parser FSM
Hard · fsm · packet · parser
Parse a four-byte header followed by payload bytes.
Four-Beat Burst Controller
Medium · fsm · burst · counter
Control a fixed four-beat streaming burst.
Vending Machine FSM
Medium · fsm · controller · coin
Accept 5-unit and 10-unit coins for a 15-unit item.
Start/Busy/Done Controller
Easy · fsm · busy · done
Implement a standard operation-control shell with start, busy and one-cycle done.
Counted Synchronous FIFO
Hard · fifo · count · memory
Build an 8-entry synchronous FIFO with an occupancy count.
FIFO Almost-Full / Almost-Empty Flags
Medium · fifo · threshold · flags
Generate almost_full and almost_empty from an occupancy count for a 16-entry FIFO.
First-Word Fall-Through Buffer
Hard · fifo · fwft · buffer
Implement a two-entry first-word fall-through queue.
FIFO Overflow / Underflow Sticky Flags
Medium · fifo · overflow · underflow
Record illegal FIFO access attempts.
Two-Entry Elastic Buffer
Hard · fifo · elastic · ready-valid
Build a two-entry ready/valid elastic queue.
Packet FIFO Boundary Tracker
Medium · fifo · packet · metadata
Track packet-end metadata alongside FIFO data.
Circular Sample Buffer
Medium · buffer · circular · memory
Continuously retain the most recent eight samples.
Single-Entry Bypass Buffer
Hard · buffer · bypass · ready-valid
Pass data combinationally when empty, but capture it if downstream stalls.
RISC-V Program Counter
Easy · RISC-V · CPU · program-counter
Build the 32-bit program-counter register used by the guided RISC-V CPU project.
RISC-V Instruction Decoder
Easy · RISC-V · decode · instruction-format
Slice the fixed RV32I instruction fields used by the rest of the CPU datapath.
RISC-V Register File
Medium · RISC-V · register-file · datapath
Create the 32 × 32-bit register file with two read ports, one write port and the architectural x0 rule.
RISC-V Immediate Generator
Medium · RISC-V · immediate · decode
Reassemble and sign-extend RV32I immediate fields for the CPU datapath.
RISC-V ALU
Medium · RISC-V · ALU · datapath
Implement the arithmetic and logic unit used by the guided RV32I core.
RISC-V Branch Control
Medium · RISC-V · branch · control-flow
Add the PC-relative target calculation and conditional branch decision logic.
RISC-V Load/Store Control
Medium · RISC-V · load-store · control
Decode memory operations into read, write and register-writeback control signals.
Integrate the 32-bit RISC-V Core
Hard · RISC-V · CPU · integration
Bring the guided CPU blocks together into one single-cycle RV32I top-level datapath.
UART Baud Tick Generator
Easy · UART · counter · timing
Create the timing pulse that advances the UART transmitter and receiver.
UART TX Frame Shifter
Easy · UART · shift-register · framing
Build the shift register that serializes a UART frame.
UART Transmit Controller
Medium · UART · FSM · control
Control when a byte is loaded, shifted, and reported complete.
UART RX Start-Bit Detector
Easy · UART · receiver · edge-detect
Detect the beginning of an incoming UART frame.
UART RX Data Shifter
Medium · UART · receiver · shift-register
Collect eight sampled serial data bits into a byte.
UART Receive Controller
Medium · UART · FSM · receiver
Coordinate start-bit detection, data sampling, and byte completion.
Integrate the UART Controller
Hard · UART · integration · top-level
Combine the UART transmitter and receiver into one reusable controller.
AXI-Lite Register Bank
Easy · AXI4-Lite · registers · SoC
Create the memory-mapped state that the AXI-Lite slave will expose.
AXI-Lite AW Channel Capture
Medium · AXI4-Lite · write-address · handshake
Accept the write address independently from write data.
AXI-Lite W Channel Capture
Medium · AXI4-Lite · write-data · handshake
Accept write data independently from the write address.
AXI-Lite Write Commit
Medium · AXI4-Lite · write · control
Pair independently captured AW and W payloads and commit one write.
AXI-Lite B Response Channel
Medium · AXI4-Lite · write-response · handshake
Return one write response and hold it until the master accepts it.
AXI-Lite AR Channel Capture
Medium · AXI4-Lite · read-address · handshake
Accept one AXI-Lite read address and preserve it while the read response is prepared.
AXI-Lite R Response Channel
Medium · AXI4-Lite · read-data · handshake
Return read data and keep it stable while the master applies backpressure.
Integrate the AXI4-Lite Slave
Hard · AXI4-Lite · integration · SoC
Combine the independent AXI-Lite channels into a complete register-mapped slave.
Async FIFO Dual-Port Memory
Easy · FIFO · CDC · memory
Create storage that can be written and read from different clock domains.
Async FIFO Binary Pointers
Medium · FIFO · pointer · CDC
Track independent write and read positions, including the wrap bit used by full detection.
Binary-to-Gray Pointer Conversion
Easy · CDC · Gray-code · FIFO
Convert a binary pointer to Gray code so only one bit changes per increment.
Synchronize Gray Pointers
Medium · CDC · synchronizer · Gray-code
Move a Gray-coded pointer safely into the opposite clock domain.
Async FIFO Empty Detection
Easy · FIFO · empty · Gray-code
Determine when the read pointer has caught up with the synchronized write pointer.
Async FIFO Full Detection
Hard · FIFO · full · Gray-code
Detect the wraparound relationship that means the write pointer is one complete buffer ahead of the read pointer.
Per-Domain Reset Synchronizer
Medium · CDC · reset · synchronizer
Release reset safely inside each asynchronous clock domain.
Integrate the Asynchronous FIFO
Hard · FIFO · CDC · integration
Combine memory, pointers, Gray conversion, synchronization, and status detection into a complete dual-clock FIFO.
IF/ID Pipeline Register
Medium · RISC-V · pipeline · IF/ID
Create the first stage boundary that preserves fetched PC and instruction.
ID/EX Pipeline Register
Medium · RISC-V · pipeline · ID/EX
Carry decoded operands and control signals into the execute stage.
EX Forwarding Unit
Hard · RISC-V · hazards · forwarding
Resolve common RAW dependencies without stalling when the producer value is already available.
Load-Use Hazard Detector
Hard · RISC-V · hazards · stall
Detect the dependency that forwarding cannot resolve in time: an instruction immediately consuming a load result.
Branch Redirect and Flush
Medium · RISC-V · branch · flush
Redirect fetch and invalidate younger work after a taken branch.
Writeback Result Select
Easy · RISC-V · writeback · mux
Select the value returned to the architectural register file.
Pipeline Hazard Control Integration
Hard · RISC-V · pipeline control · integration
Combine stall and redirect decisions into coherent controls for the PC and stage registers.
Cache Address Decode
Medium · cache · addressing · tag/index/offset
Split a 32-bit byte address into tag, index and word offset fields for a small direct-mapped cache.
Cache Hit Detection
Medium · cache · tags · hit/miss
Determine whether the selected direct-mapped cache line contains the requested address.
Cache Line Store
Hard · cache · memory · dirty bit
Store tag, valid, dirty and four 32-bit words for each direct-mapped cache line.
Cache Miss / Refill FSM
Hard · cache · FSM · refill
Sequence lookup, optional writeback and four-word line refill after a cache miss.
Four-Beat Refill Counter
Medium · cache · refill · counter
Track the four words transferred while refilling a cache line.
Direct-Mapped Cache Controller
Hard · cache · integration · memory controller
Integrate address decode, hit detection and miss handling into a compact direct-mapped cache controller.
2-bit Saturating Counter
Easy · branch predictor · counter · microarchitecture
Implement the classic four-state branch-direction predictor.
Branch History Table
Medium · branch predictor · BHT · table
Scale the two-bit predictor into a small PC-indexed Branch History Table.
Branch Target Buffer
Hard · branch predictor · BTB · tags
Cache branch targets so a taken prediction can redirect fetch immediately.
Predicted Next-PC Select
Easy · branch predictor · fetch · mux
Use direction and target predictions to select the speculative next fetch address.
Misprediction Detection
Medium · branch predictor · recovery · control
Detect when speculative fetch disagrees with the resolved branch outcome or target.
Branch Predictor Top
Hard · branch predictor · BHT · BTB · integration
Combine direction prediction, target lookup and resolved-branch update behavior.
SoC Address Decoder
Medium · SoC · address map · decode
Decode the processor address into ROM, RAM, UART, GPIO and timer chip-selects.
Boot ROM
Easy · SoC · ROM · memory map
Provide a tiny combinational boot ROM addressed by word index.
Word-Addressed Data RAM
Medium · SoC · RAM · byte strobes
Implement a 1 KB data RAM with byte write enables.
Memory-Mapped GPIO
Medium · SoC · GPIO · register interface
Create a memory-mapped GPIO peripheral with an output register and sampled input register.
Machine Timer Peripheral
Medium · SoC · timer · interrupt
Implement a free-running 32-bit timer and programmable compare register.
Interrupt Controller
Medium · SoC · interrupts · priority encoder
Combine UART, GPIO and timer interrupt requests into one CPU interrupt plus a cause code.
Small RISC-V SoC Integration
Hard · SoC · RISC-V · integration
Integrate memory-map decoding and response multiplexing for a small processor system.
Vector Register File
Medium · SIMD · register file · vector
Store eight architectural vector registers, each containing four 32-bit lanes.
SIMD Execute Pipeline Register
Easy · SIMD · pipeline · valid
Pipeline a 128-bit vector result and its validity bit.
DMA Control Registers
Medium · DMA · register map · SoC
Implement programmable source, destination and transfer-length registers.
DMA Address Generator
Medium · DMA · address generation · datapath
Track source and destination word addresses during a transfer.
DMA Read Channel
Hard · DMA · ready-valid · read
Issue one memory read request and hold it until accepted.
DMA Write Channel
Hard · DMA · ready-valid · write
Buffer a read result and hold the write request until the destination accepts it.
DMA Transfer Counter
Medium · DMA · counter · length
Track remaining bytes and detect the final word transfer.
DMA Transfer Controller
Hard · DMA · FSM · control
Sequence one read and one write for each copied word.
AXI Crossbar Address Decoder
Medium · AXI · crossbar · address decode
Decode a 32-bit request address to one of three AXI-Lite slaves.
Two-Master Round-Robin Arbiter
Medium · AXI · arbitration · round robin
Choose one of two requesting AXI masters fairly.
AXI Request Router
Hard · AXI · routing · ready-valid
Route one selected master's address and write data toward one selected slave.
AXI Write Ownership Lock
Hard · AXI · ordering · ownership
Remember which master owns a write transaction until its B response completes.
AXI Response Router
Hard · AXI · responses · routing
Route one slave write response back to the master that owns the transaction.
AXI Decode Error Responder
Medium · AXI · DECERR · error response
Generate an AXI DECERR response for unmapped accesses without contacting a slave.
2x3 AXI-Lite Crossbar Top
Hard · AXI · crossbar · integration
Integrate arbitration, address decode and transaction ownership for a two-master, three-slave AXI-Lite write crossbar.
Peripheral Reset Controller
Medium · SoC · reset · integration
Generate a clean peripheral reset release from an asynchronous active-low external reset.
APB Peripheral Decoder
Medium · APB · SoC · address map
Decode one APB request to GPIO, timer or UART.
APB Read/Response Multiplexer
Medium · APB · mux · SoC
Combine three APB slave responses onto one upstream interface.
APB GPIO Peripheral
Medium · APB · GPIO · MMIO
Implement a 16-bit GPIO output register and sampled input register behind APB.
APB Timer Peripheral
Medium · APB · timer · interrupt
Implement a programmable timer with compare interrupt behind APB.
UART Register Block
Medium · UART · APB · MMIO
Expose transmit data and status as memory-mapped UART registers.
APB Peripheral Subsystem Top
Hard · SoC · APB · integration
Integrate APB decode and interrupt aggregation for GPIO, timer and UART peripherals.
I²C START / STOP Detector
Medium · I2C · START · STOP
Detect I²C START and STOP conditions from synchronized SDA/SCL samples.
I²C Address Matcher
Easy · I2C · address · slave
Decode the first I²C byte into a 7-bit address and R/W bit.
I²C Byte Receiver
Medium · I2C · receive · shift register
Receive one I²C byte by sampling SDA on SCL rising-edge pulses.
I²C ACK / NACK Driver
Medium · I2C · ACK · open drain
Drive ACK using open-drain SDA behavior.
I²C Byte Transmitter
Medium · I2C · transmit · open drain
Transmit one byte MSB-first using open-drain SDA.
I²C Register Pointer
Medium · I2C · register map · pointer
Maintain the internal register address used by an I²C register peripheral.
I²C Clock-Stretch Control
Easy · I2C · clock stretching · open drain
Model clock stretching as an open-drain SCL request.
Memory-Mapped I²C Register Slave
Hard · I2C · slave · register peripheral
Integrate a simplified I²C register peripheral with address matching, ACK generation, register writes and sequential register reads.

How to use this topic

Start with easier problems, implement or reason through the task without looking at a solution, then revisit medium and hard problems. Use the HDLForge roadmap to combine this topic with adjacent skills.

Follow the HDLForge roadmap or browse the complete problem set.

Related implementation guides