Verilog
Learn to describe digital circuits in Verilog by connecting language constructs to the hardware they represent.
About this course
Learn to describe digital circuits in Verilog by connecting language constructs to the hardware they represent. This proposed course starts with a short digital-design readiness check, then develops modules, four-state values, vectors, operators and procedural modelling in a deliberate order. Combinational and clocked examples establish how assignment choices, widths, signedness and event scheduling affect simulation and inferred hardware.
The later sequence develops reusable hierarchy, parameterised blocks, self-checking testbenches, finite-state machines and small datapaths. Planned exercises use a practical Verilog-2001 baseline that can run with free simulation tools, with synthesis inspection used to expose unintended latches and other modelling mistakes. A final controller-and-datapath project brings implementation, directed tests, waveform debugging and reproducible tool commands into one reviewable design package.
Where to start
Build the knowledge in these courses first, or bring equivalent practical experience:
What you’ll learn
- Write and connect Verilog-2001 modules with explicit port and signal widths.
- Predict four-state, signedness and expression-sizing behaviour in common RTL constructs.
- Model combinational and sequential hardware without unintended latches or assignment races.
- Build reusable parameterised modules and elaboration-time generated structures.
- Create self-checking testbenches with repeatable stimuli and useful failure messages.
- Implement an FSM and datapath with defined reset and transaction behaviour.
- Run simulation and basic synthesis checks and interpret the resulting diagnostics.
Course syllabus
12 sections · 60 topics
01. Digital readiness and the RTL workflow5 topics
- Review combinational logic, registers, FSMs and clock/reset assumptions
- Hardware concurrency and the distinction between a circuit description and software execution
- RTL, behavioural and structural modelling roles
- Create, compile and run a minimal Verilog module and testbench
- Exercise: map a circuit diagram to module ports and predict its waveform
02. Modules, values and data declarations5 topics
- Verilog-2001 module structure, ANSI-style ports and named signals
- Nets versus procedural variables and why reg does not necessarily imply a physical register
- Four-state 0, 1, X and Z values and their simulation meaning
- Sized literals, vectors, bit selects, part selects and array declarations
- Exercise: diagnose undeclared signals, width mismatches and unexpected unknown values
03. Expressions, widths and signed arithmetic5 topics
- Arithmetic, relational, logical, bitwise, reduction and conditional operators
- Operator precedence, concatenation and replication
- Expression widths, truncation, extension and unsized literal hazards
- Signed declarations, mixed signed/unsigned expressions and shift behaviour
- Exercise: predict and simulate boundary-value results before coding an arithmetic function
04. Combinational RTL modelling5 topics
- Continuous assignments and combinational always @* processes
- Blocking assignments, complete assignments and safe default values
- if/else, case and priority versus parallel selection intent
- Latch inference from incomplete assignments and the risks of wildcard case matching
- Exercise: implement and exhaustively test a mux, decoder and priority encoder
05. Clocked RTL and simulation scheduling5 topics
- Edge-sensitive always blocks for registers, counters and shift registers
- Nonblocking updates, old-state evaluation and the active/nonblocking scheduling distinction
- Blocking versus nonblocking assignment rules and race-producing examples
- Synchronous and asynchronous reset models, enable and load priority
- Exercise: debug a pipeline and counter whose simulated behaviour disagrees with the intended circuit
06. Hierarchy and reusable parameterised design5 topics
- Module instantiation, named port connections and hierarchical composition
- Parameters, localparams and width-dependent interfaces
- Generate blocks, genvar and elaboration-time structural replication
- Procedural loops with static bounds versus generated hardware instances
- Exercise: assemble and test a configurable-width arithmetic unit from smaller modules
07. Tasks, functions and simulation utilities5 topics
- Functions for reusable calculations and combinational expressions
- Tasks for repeated stimulus sequences and procedural control
- Scope, arguments and automatic lifetime where appropriate
- Simulation-only initial blocks, delays, display messages and file-based vector input
- Exercise: organise reusable stimulus and expected-result helpers without placing testbench code in RTL
08. Self-checking testbenches and waveform debugging5 topics
- Instantiate the DUT and generate clock, reset and directed input sequences
- Check outputs with explicit expected values and case-aware comparisons
- Avoid testbench/DUT races through deliberate drive and sample timing
- VCD dump generation, waveform inspection and first-failure diagnosis
- Exercise: run boundary and repeated-operation cases with pass/fail counts and a timeout
09. FSMs and controller-datapath RTL5 topics
- Translate state diagrams into state registers and next-state logic
- Verilog localparam state encodings and Moore versus Mealy outputs
- Default transitions, illegal-state handling and output assignment completeness
- Separate datapath operations, status flags and controller decisions
- Exercise: implement a transaction controller and compare state traces with its specification
10. Arrays, memories and synchronous buffers5 topics
- Declare and access unpacked arrays of packed Verilog words
- Model synchronous writes and explicitly specified read behaviour
- Buffer pointers, occupancy tracking and full/empty boundary conditions
- Reset and initialisation choices and their implementation dependence
- Exercise: verify a small single-clock buffer including overflow and underflow prevention
11. Synthesizable RTL and implementation inspection5 topics
- Distinguish synthesizable design constructs from simulation-only stimulus
- Run a basic Yosys read, hierarchy, process conversion and check flow
- Inspect inferred registers, multiplexers, memories and unintended latches
- Review warnings for undriven signals, conflicting drivers and width errors
- Exercise: compare simulated behaviour and inferred structure after a deliberate RTL mistake is corrected
12. Capstone implementation and regression5 topics
- Specify the buffered command controller's ports, handshake and reset behaviour
- Integrate parameterised storage, control state and arithmetic datapath
- Create directed tests for empty/full, reset during activity and repeated commands
- Run reproducible simulation and synthesis checks and resolve diagnostics
- Document module responsibilities, waveform evidence, assumptions and remaining limitations
Course requirements
- A computer with a text editor, terminal and local project folder.
- A Verilog simulator such as Icarus Verilog with working iverilog and vvp commands; use Verilog-2001 language mode for baseline exercises.
- A VCD waveform viewer such as GTKWave, or another compatible waveform inspection tool.
- Access to Yosys or an equivalent Verilog synthesis tool for the supported synthesizable RTL exercises.
- Browser access for reference documentation and optional HDLBits practice; no FPGA board or paid simulator is required.
Prerequisites
- Binary representation, Boolean logic and basic combinational circuit design.
- Flip-flops, registers, counters and clock/reset concepts.
- Basic FSM diagrams and an understanding of setup and hold timing.
- Ability to create text files and execute terminal commands.
Who this course is for
- Learners who have completed digital electronics or equivalent study.
- Engineering students beginning RTL implementation.
- Software developers moving into hardware description.
- Verification learners who need a firm understanding of the RTL under test.
Practice projects
Apply the topics in sequence through these planned exercises.
Parameterised arithmetic unit and testbench
Planned exercise: implement a width-configurable arithmetic and selection block, then use a reference calculation and boundary vectors to check results and status flags.
Buffered command controller
Planned capstone: implement a small synchronous buffer and command-processing FSM with a datapath; test reset, full/empty conditions, accepted commands and repeated transactions.
Curriculum references
Primary documentation and teaching resources that inform this learning sequence.
- HDLBits: Problem sets
Primary practice-site taxonomy for language, circuit modelling, simulation reading and testbench progression; accessed 18 October 2026.
- Icarus Verilog: Getting Started
Official reference for compile/run workflow and simulation examples; accessed 18 October 2026.
- Icarus Verilog: Command Line Flags
Official language-generation options support a deliberate Verilog-2001 baseline; accessed 18 October 2026.
- Yosys: Converting process blocks
Official synthesis reference connecting procedural RTL to muxes, latches and flip-flops; accessed 18 October 2026.
Course outline and pricing are subject to confirmation before enrolment opens.
Open course workspace