Verilog Crash Course Home
A crash course for a strong CS background, zero Verilog

Verilog, from first principles you already have

Eight short lessons that take Boolean logic, state machines, and binary arithmetic you already know and map them onto Verilog — the language, the mental model, and the handful of rules that cause almost every early bug.

Lessons
01

Why Verilog Isn't a Programming Language

The single biggest mental shift: Verilog describes hardware that all exists and runs at once, not a sequence of steps. Plus simulation vs. synthesis.

02

Modules, Ports & Signal Types

Module interfaces, vectors, the wire/reg distinction (and why it's not what it sounds like), and Verilog's four-valued logic.

03

Combinational Logic

assign and always @(*), the operators you'll actually use, and the classic latch-inference bug.

04

Sequential Logic & the Blocking/Non-Blocking Rule

Flip-flops, reset styles, and the most consequential rule in practical Verilog — with a live demo of exactly how it breaks.

05

Finite State Machines in Verilog

The state diagrams you already know, mapped onto the three-block Verilog coding style, with a worked traffic-light example.

06

Testbenches & Simulation

Writing simulation-only code that drives and checks a design — clocks, stimulus, $display, and waveform dumps.

07

Parameters & Generate Blocks

Reusable, resizable modules with parameter, and structural replication with generate — a loop that builds hardware, not one that runs.

08

Common Pitfalls & Where to Go Next

Multiple drivers, stale sensitivity lists, signed/unsigned traps, a synthesizable-vs-simulation cheat sheet, and pointers past this course.

Resources
Reference

References

A short list of high-quality external tutorials, the canonical Cummings paper, and recommended YouTube channels.

Glossary

Glossary

Every term introduced across the eight lessons, alphabetically, linked back to where it's first explained.

Code
Lesson 3

mux2to1.v

A 2-to-1 multiplexer using the ternary operator.

Lesson 3

full_adder.v

A 1-bit full adder — the building block reused in Lesson 7.

Lesson 4

reg_swap_blocking.v

The buggy register swap — blocking assignment, negative example.

Lesson 4

reg_swap_nonblocking.v

The correct register swap — non-blocking assignment.

Lesson 5

traffic_light_fsm.v

A three-state Moore FSM in the three-block coding style.

Lesson 6

traffic_light_tb.v

A testbench driving the traffic light FSM and printing results.

Lesson 7

ripple_carry_adder_gen.v

A parameterized ripple-carry adder built with a generate loop.