A Verilog source file contains tokens: identifiers, keywords, numbers and punctuation. Names are case-sensitive. Comments document intent but do not alter the circuit. Use consistent file extensions and explicitly declare every connection so spelling mistakes do not quietly introduce implicit one-bit nets.

Worked example

default_nettype none makes accidental implicit nets an error in supporting tools. Restore the normal setting at the end of a reusable source file so the directive does not unexpectedly affect subsequent files in the compilation unit.

Verilog
`default_nettype none
module explicit_wire(input request, output acknowledge);
  wire valid_request;
  assign valid_request = request;
  assign acknowledge = valid_request;
endmodule
`default_nettype wire

What to watch for

A missing semicolon can cause an error to be reported on the next line. Inspect the declaration immediately before the reported location.

Try it yourself

Are data and Data the same identifier?

Answer: No. Verilog identifiers are case-sensitive, so they name separate objects unless the source explicitly connects them.

How to study this topic

Save the example in a .v file and identify its top module before compiling. Separate stimulus and observation from synthesizable RTL. Change one input, width or boundary condition at a time, predict the result, and compare that prediction with simulation. A syntax check does not establish synthesis support or timing closure.

Continue learning

Previous: Design, simulation and synthesis flow

Next: Modules and ports

Browse the complete Verilog index

Explore related programmes

These recorded programmes are upcoming. This article is general educational content, not a syllabus or course sample.

Verilog