S3 Digital design with HDL · Practice
Simulation and synthesis pitfalls
Problems dealt one at a time, with new numbers every time. The kinds you miss come back more often, and you can keep going as long as you like.
0 solved
0 in a row
0 of 7 kinds solid
Check
A 6-bit register is assigned the sum of two values, 200 and 9000 (wider operands, already in range of their own widths). What does it hold after truncation?
Check
A 4-stage shift register is written with blocking assignments in the order stage 0, stage 1, …, stage 4 − 1 inside one clocked block. How many clock cycles of delay does it give from input to the last stage?
Check
A combinational block has 5 outputs. A case statement without a default leaves 1 of them unassigned in some branch; the rest are assigned in every branch. How many latches does synthesis infer?
Check
In an 8-bit signed-unsigned comparison, the signed operand holds −3. Verilog treats the comparison as unsigned. What unsigned value does −3 become?
Check
Write two Python models of an n-stage (8) shift register's clock edge, given the list of stage values q and input d: clock_nonblocking(q, d) (all stages update from the old values) and clock_blocking(q, d) (statements in order stage 0, 1, …, each seeing updates above it). Both return the new list. Starting from all zeros, feed the input sequence 1, 0, 0, … for n + 2 clocks and set out_nb and out_b, the lists of the last stage's value after each clock.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
An 8-bit register receives 500 + 900. What does it hold?
Check
As an 8-bit unsigned value, what is −5?
A kind of problem counts as solid once you've got it right on the first try twice in a row. Back to the lesson · Practice every topic in S3