What is Verilog?
A hardware description language widely used for digital design and verification, describing circuits as modules with behavior expressed through assign and always.
Japanese name: Verilog
A hardware description language widely used for digital design and verification, describing circuits as modules with behavior expressed through assign and always.
Japanese name: Verilog
A Verilog design is built from modules, each a block of circuitry with declared input and output ports. A module can be instantiated inside another as many times as needed, with ports wired together, so a chip is described as a hierarchy of components. Inside a module, a continuous assignment such as assign y = (a & b) | c describes combinational logic whose output follows its inputs at all times. An always block describes behavior triggered by events: always @(posedge clk) becomes edge-triggered flip-flops, while always @(*) re-evaluates whenever any signal it reads changes and describes combinational logic.
Verilog looks like a programming language, but every assign statement and always block operates concurrently, regardless of its order in the file. In clocked blocks, nonblocking assignments (<=) evaluate all right-hand sides with pre-edge values and then update together, matching flip-flops that capture simultaneously; blocking assignments (=) suit combinational blocks that compute intermediate values top to bottom. A signal declared reg is not necessarily a register: assigned in always @(*), it is combinational. An if without an else in a combinational block implies memory and infers an unintended latch. Widths also matter, since assignments silently truncate, and signals are unsigned unless declared signed.
Verilog simulators are event-driven: they re-evaluate only the logic whose inputs changed, which is efficient because few signals toggle in any cycle. Signals take four values: 0, 1, X for unknown and Z for high impedance. Uninitialized registers and conflicting drivers produce X, and undriven nets produce Z, so seeing either in a waveform is a strong debugging clue. Some semantics are optimistic: an if statement treats an X condition as false, hiding bugs that real hardware would expose. The == operator returns X when X or Z bits in the operands leave it undecided whether they match (and 0 when the known bits already differ), while === compares X and Z literally and is used mainly in testbenches.
Only a subset of Verilog is synthesizable. Delays such as #10, $display and file I/O are simulation-only and are ignored by synthesis, so testbenches may use them freely but RTL should not. SystemVerilog, the successor standard, adds the logic type, which removes most of the wire/reg distinction, and always_ff and always_comb, which state the designer's intent so tools can flag an inferred latch. It also adds extensive verification features such as assertions and classes. VHDL is the other major hardware description language, with stricter typing and a more verbose style; both are used for RTL design.
Answer: A. An HDL description represents circuits that operate concurrently
An HDL looks like a program, but logic synthesis turns what is written into gates and flip-flops. Every part of a circuit operates at all times, so multiple assign statements and always blocks work in parallel regardless of their order in the text. Thinking "do this, then that" as in software leads to unintended circuits, so it is important to picture the circuit being created while writing.
Answer: A. To define a circuit component with input and output ports so it can be used inside other modules
A module defines a block of circuitry with input and output ports, representing anything from an adder or counter to an entire CPU. A defined module can be used as a component any number of times inside other modules (instantiation), with its ports wired together to build larger circuits. Circuits are built hierarchically, much like placing and wiring parts on a board.
A wire is driven by a continuous assignment or a module output, while a reg is assigned inside an always or initial block. A reg becomes a flip-flop only if it is updated on a clock edge; in always @(*) it is combinational logic.
Use nonblocking assignments in clocked always blocks that describe flip-flops, and blocking assignments in combinational always blocks. Mixing the two in one block or using blocking assignments for sequential logic can make simulation depend on statement order and differ from hardware.
SystemVerilog is a superset of Verilog that adds design conveniences such as the logic type, always_ff and always_comb, plus verification features like assertions, constrained random stimulus and object-oriented testbenches.
Verilog appears in 21 practice questions across 2 topics, including HDL & Verification, IC design flow and EDA.
As an Amazon Associate I earn from qualifying purchases.
This page was drafted with AI and fact-checked by a separate AI review before publication. Our Editorial policy explains how we write and check content. If you spot an error, please tell us on our Contact page.