Module #02 - Verilog HDL - Lexical Tokens
Module #02 - Verilog HDL - Lexical Tokens
Example 2.1 :
module sample (a, b, c, d);
input a; // space in the start is ignored
reg [8*6 :1] string = “Earth ” ; // would not be ignored
wire temp;
assign = (a & b &c) | (a & b &c) | (a & b &c) | (a & b &c) | (a & b &c) | (a
& b &c) ; //Multiple line statement
- Enclose comments between the characters /* and */ : This method allows you to continue
comments on more than one line
Example 2.2:
assign c = a & b; //This is a simple comment
2.3. Numbers:
- Number values can be specified in binary, octal, decimal or hexadecimal
- Number storage is defined as a number of bits
Example 2.3:
2.4. Identifiers :
- User defined words for variables, function names, module names, block names and instance names
- Begins with a letter or underscore
- Never begins with a number and $
- Identifiers are case-sensitive in Verilog
Example 2.4:
2.5. Operators:
- Operators are one, two or sometimes three characters
- Used to performs operations on variables
Example 2.5:
Example 2.6:
assign, always, case, while, wire, reg, and, or, module, begin, input, output, inout, posedge, negedge