7
Elements of Verilog HDL
This chapter introduces the basic lexical elements of the Verilog HDL. In common with other high-level languages, Verilog defines a set of types, operators and constructs that make up the vocabulary of the language. Emphasis is placed on those aspects of the language that support the description of synthesizable combinatorial and sequential logic.
7.1 BUILT-IN PRIMITIVES AND TYPES
7.1.1 Verilog Types
As mentioned in Chapter 6, Verilog makes use of two basic types: nets and registers. Generally, nets are used to establish connectivity and registers are used to store information, although the latter does not always imply the presence of sequential logic.
Within each category there exist several variants; these are listed in Table 7.1. All of the type names, listed in Table 7.1, are Verilog reserved words; the most commonly used types are shown in bold.
Along with the basic interconnection net type wire, two additional predefined nets are provided to model power supply connections: supply0 and supply1.
These special nets possess the so-called ‘supply’ drive strength (the strongest; it cannot be overridden by another value) and are used whenever it is necessary to tie input ports to logic 0 or logic 1. The following snippet of Verilog shows how to declare and use power supply nets:
module … supply0 gnd; supply1 vdd; nand g1(y, a, b, vdd); //tie one input of nand gate high endmodule
The power supply nets are also useful when using Verilog to describe switch-level ...
Get FSM-based Digital Design using Verilog HDL now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.