Module Two The Best Book To Read
Module Two The Best Book To Read
Module 2
Basic Concepts
Modules and Ports
Contents
Basic Concepts
Learning Objectives
• Understand lexical conventions for operators, comments, whitespace,
numbers, strings, and identifiers.
• Define the logic value set and data types such as nets, registers,
vectors, numbers, simulation time, arrays, parameters, memories,
and strings.
• Identify useful system tasks for displaying and monitoring
information, and for stopping and finishing the simulation.
• Learn basic compiler directives to define macros and include files.
Lexical Conventions
• The basic lexical conventions used by Verilog HDL are similar to those
in the C programming language.
• Verilog contains a stream of tokens. Tokens can be comments,
delimiters, numbers, strings, identifiers, and keywords.
• Verilog HDL is a case-sensitive language.
• All keywords are in lowercase.
Whitespace
• Blank spaces (\b) , tabs (\t) and newlines (\n) comprise the
whitespace.
• Whitespace is ignored by Verilog except when it separates tokens.
• Whitespace is not ignored in strings.
Comments
• Comments can be inserted in the code
for readability and documentation.
• There are two ways to write
comments. A one line comment starts
with "//".
• Verilog skips from that point to the
end of line.
• A multiple- line comment starts with
"/*" and ends with "*/". Multiple-line
comments cannot be nested.
• However, one-line comments can be
embedded in multiple-line comments.
Operators
• Operators are of three types:
unary, binary, and ternary.
• Unary operators precede the
operand.
• Binary operators appear
between two operands.
• Ternary operators have two
separate operators that separate
three operands.
Number Specification