Find the bug

Each puzzle is a short Verilog or SystemVerilog module with one mistake that compiles but misbehaves. Click the line you think is wrong to see the answer, why it's a bug and the fix.

0 of 24 solved

A 3-way mux

Latches · Verilog · Which line has the bug?

What the 24 puzzles cover

How the puzzles are checked

Every buggy module and every fixed version is compiled with Icarus Verilog and linted with Verilator (all warnings on) before it is published. Where Verilator catches the bug, the answer names its warning, and the fixed version is checked to be free of it. Clock domain crossing and race bugs pass lint, which is why they are worth learning to spot by eye. Your progress is kept on this device only.

Learn the rules behind them