RTL Design & Computer Architecture — Installation
What You're Setting Up
This guide reuses HDL — Verilog & VHDL's exact iverilog/vvp/GTKWave toolchain — no new tools to install. This section compiles and simulates Overview's seq_detector_101 FSM for real, confirming the bit-stream trace against an actual simulator rather than only a hand-traced table.
Confirm Your Toolchain (from HDL — Verilog & VHDL)
If these aren't installed yet, revisit HDL — Verilog & VHDL's Installation section first — this guide assumes that toolchain is already working.
Compile and Simulate Overview's FSM — the seq_detector_101 Module
Verify Everything Works
This is Overview's exact 0,0,1,0,0,1,0 output sequence, now confirmed by an actual compiled simulation rather than only a hand-traced state table. If every line reads MATCH, your FSM simulation setup is working correctly and you're ready for Functional Verification, which builds a proper self-checking testbench for this same exact module rather than the manual $display comparison used here.
A Second Check — the Try It Bit Streams
Reproducing Overview's Try It exercise (10100 and 10010) as an independent check, using the same testbench structure with different bit_stream/expected values:
Verified programmatically (simulating the exact FSM logic in Python as a cross-check against the Verilog simulation): both sequences match Overview's Try It answer exactly — 10100 produces a single detection at the 3rd bit, 10010 produces no detections at all.
Common Setup Issues
Testbench reports MISMATCH on every bit, not just one
Check the bit-ordering convention — bit_stream[6:0] with i counting down from 6 to 0 feeds the MSB first, matching Overview's left-to-right reading of "1011010." If your expected value's bit ordering doesn't match this same convention, every comparison will appear to fail even though the underlying FSM logic is correct — this is a testbench-indexing bug, not an FSM bug, and worth checking before assuming the design itself is wrong.
detected shows x (unknown) instead of 0 or 1 on the first bit
Confirm the reset sequence actually completes (two @(posedge clk) cycles with rst = 1) before the first bit is applied — an FSM that hasn't been properly reset starts in an unknown state, and case statement outputs for an unknown state are themselves unknown, propagating x forward until a valid reset actually occurs.
Simulation runs but never terminates
Confirm the for loop bound matches the actual bit stream width (7 bits, indices 6 down to 0) — an off-by-one in the loop bound combined with a clk generator that never stops on its own (always #5 clk = ~clk;) will leave the simulation running past $finish never being reached correctly.
What's Set Up
Nothing new — this section confirms HDL's iverilog/vvp toolchain extends cleanly to a real FSM design, and establishes the self-checking testbench pattern (!== comparison against a known-expected sequence) that Functional Verification formalizes further.
Next Steps
Go to the Fundamentals section to continue with datapath design and the counter module referenced throughout later Advanced/Troubleshooting material.

