Verilog synthesis problems
Verilog that simulates correctly can still build the wrong hardware. These problems are about the hardware: why a missing default makes a latch, why an if else chain makes a priority encoder, and what an initial block means to a synthesizer.
76 problems12 free to solve21 easy, 35 medium, 20 hard
Every RTL submission is synthesized by Yosys, so next to the test results you see the schematic and the cell count of what you wrote.
What these problems cover
- Inferred latches and how to avoid them
- Priority and parallel case logic, unique and priority case
- ROM and memory inference
- Initial blocks, resets and what synthesis keeps
- Resource sharing, shifts and area trade offs
- Safe FSM defaults and Moore against Mealy area
Free to start
Solve these with a free account. Every other statement on this page is free to read.
Problems by track
Synthesis Intuition25
- The Incomplete Case Latch
- The Default Assignment Trick
- Ternary Operator Safety
- The Variable Loop Bound
- Transparent Latch using always_latch
- If Else Priority Encoder
- Inout Port Mechanics
- Parameterized Sign Extension Unit
- Four Stage Pipelined Multiplier
- ROM Inference via Case
- Power of Two Alignment
- Bidirectional Arithmetic Shift Register
Gate-Level Logic8
Combinational Building Blocks3
Latches and Flip-Flops4
Counters3
Finite State Machines6
Clocking and Synchronization1
Fault Testing and Verification1
Interview Circuit1
Sequential RTL1
FSM Coding1
More problems22
- Arithmetic Shift vs Logical Shift
- Bit Reversal Synthesis
- Constant Folding Optimization
- Division by Power of Two
- Latch vs Clock Enable Inference
- Multi Bit XOR Synthesis
- SystemVerilog Enum Default Encoding
- The Deeply Nested Latch
- Tie Off Register Removal
- Unused Flip Flop Removal
- Dead Code Elimination
- Equality vs Relational Comparators
How your answer is checked
Your module is compiled with Icarus Verilog and simulated against the problem's testbench. The result lists every test with the value you produced and the value expected, and the waveform shows where they part. Yosys synthesizes the same code, so you can see the schematic and the cell count of what you wrote.
Questions
- Which synthesis tool is used?
- Yosys. It runs on every RTL submission and produces the schematic and the cell counts you see beside your result.
- Are synthesis questions asked in interviews?
- Yes, usually as 'what does this code synthesize to' or 'why is there a latch here'. These problems ask exactly that, and the schematic shows the answer.