Verilog RTL I – Sequential
Combinational, arithmetic, sequential, counters, timers
What you will learn and practise
Complete the stages in order and retain the requested evidence.
Clocked always blocks
Non-blocking assignment
Sync/async reset
Enable/load/clear patterns
Shift registers
1. DFF
2. Sync-reset DFF
3. Async-reset DFF
4. Enable DFF
5. 4/8-bit registers
6. Register with load/clear
7. SISO/SIPO/PISO/PIPO
8. Bidirectional shift register
9. Universal shift register
10. Toggle FF
11. Edge detector
12. Pulse generator/stretcher
Debug blocking/NBA misuse, reset polarity, clock edge
Waveform explanation exercise
Sequential RTL collection + waveforms
Implement predictable sequential RTL using nonblocking assignments, defined reset behavior, enables and shift-register structures.
- Create project_workspace/week2_verilog_rtl1/day9.
- Use a repeatable clock/reset testbench.
- Capture waveforms for reset, enable/load and normal operation.
- Implement DFF, synchronous-reset DFF and asynchronous-reset DFF.
- Implement enable DFF and 4/8-bit registers.
- Implement register with load/clear.
- Implement SISO, SIPO, PISO and PIPO shift registers.
- Implement bidirectional and universal shift registers.
- Implement toggle FF, edge detector and pulse generator/stretcher.
- Verify reset and control priority using waveforms.
- Why are nonblocking assignments preferred for clocked state updates?
- Compare synchronous and asynchronous reset behavior.
- Explain the effect of reset polarity and reset priority.
- Describe load/enable/clear priority for a register specification.
- From a supplied waveform, identify the sampling edge and explain the observed state transitions.
Repair blocking/nonblocking misuse, incorrect reset polarity and wrong clock-edge sensitivity, then compare the corrected waveform.
- sequential RTL collection
- testbench
- annotated waveform screenshots/files
- debug notes
- written answers
- State changes only at intended clock events
- Reset behavior matches specification
- Control priority is verified
- Waveform explanation matches RTL semantics
Build, run and retain evidence
project_workspace/week2_verilog_rtl1/day9_sequential/
rtl/dff.vrtl/register.vrtl/shift_registers.vrtl/edge_pulse.vtb/tb_day9.v
- Synchronous and asynchronous reset behavior
- Enable hold/update
- Load/clear priority
- SISO/SIPO/PISO/PIPO multi-cycle movement
- Bidirectional/universal shift behavior
- Edge detector/pulse timing
iverilog -g2012 -Wall -o sim/day9.vvp rtl/*.v tb/tb_day9.vRunvvp sim/day9.vvp | tee logs/day9.logWaveformgtkwave sim/day9.vcd- State changes only as specified
- Reset/control priority checks PASS
- No compile errors
- Waveform shows required clock-edge evidence
Review before completing Day 9
- MCQ
Which assignment type is normally used for state registers in clocked RTL?
Review answer
Nonblocking assignment (<=).
- Code reading
What is the behavioral difference between synchronous and asynchronous reset?
Review answer
Synchronous reset acts on the active clock edge; asynchronous reset can act independently through the event control.
- Debug
A register updates with blocking assignment inside posedge logic. Why is this unsafe style?
Review answer
It can create simulation ordering/race behavior unlike simultaneous register updates.
- Short answer
Why must load, clear and enable priority be explicitly defined?
Review answer
Simultaneous controls otherwise have ambiguous intended behavior.
Sequential RTL
- clocked always
- nonblocking assignment
- reset
- enable/load/clear
- shift/pulse behavior
Assessment: Q4