Verilog_four_slides_per_page

Verilog_four_slides_per_page - 1 1 OF SOUTHERN OF SOUTHERN...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 1 1 OF SOUTHERN OF SOUTHERN USC USC UNIVERSITY UNIVERSITY CALIFORNIA CALIFORNIA What is Verilog? What is Verilog? l Verilog is a hardware description language (HDL) for modeling and verifying the design of digital systems. l History v Proprietary language at Gateway Design Automation (now Cadence) in 1983 v Public domain in 1990 v IEEE standard in 1995 2 OF SOUTHERN OF SOUTHERN USC USC UNIVERSITY UNIVERSITY CALIFORNIA CALIFORNIA Verilog Features Verilog Features l Verilog can model designs at several levels: v Behavioral ; Algorithmic ; RTL (register transfer language) ; Dataflow v Structural ; Gate ; Switch v Hybrid mixture of levels 3 OF SOUTHERN OF SOUTHERN USC USC UNIVERSITY UNIVERSITY CALIFORNIA CALIFORNIA Verilog Identifiers Verilog Identifiers l An identifier is any sequence of letters, digits, $, _ (underscore) v First character must be a letter or _ l Examples v Count, COUNT, _R2_D2, FIVE$ l Identifiers are case-sensitive l Many reserved keywords cannot be used v Example: always (however ALWAYS is okay) 4 OF SOUTHERN OF SOUTHERN USC USC UNIVERSITY UNIVERSITY CALIFORNIA CALIFORNIA Comments and Format Comments and Format l Comments (similar to C++) v Use delimiter /* to start a multi-line comment and */ to end v Use // for a single-line comment which ends at the line end v Side note be liberal with comments in your project code!!! l Verilog is free-format v Constructs may be on one line or spread across lines ; No distinction between different types of white space (space, newline, tab, etc) v Example: always #50 clk = ~clk; is the same as always #50 clk = ~clk; 2 5 OF SOUTHERN OF SOUTHERN USC USC UNIVERSITY UNIVERSITY CALIFORNIA CALIFORNIA Value Sets and Constants Value Sets and Constants l Verilog supports 4 basic values: v 0 : logic-0 or false v 1 : logic-1 or true v X (or x) : unknown v Z (or z) : high-impedance l 3 types of constants ; Integer ; Real ; String ; You probably will be using only integers for your course project. 6 OF SOUTHERN OF SOUTHERN USC USC UNIVERSITY UNIVERSITY CALIFORNIA CALIFORNIA Integer Constants Integer Constants l Two notations for specification of integers v Simple decimal ; Sequence of digits with optional leading + or ; Examples: 32, -15 v Base format notation ; [size] `base value Number of bits in constant indicated by size base is o or O for octal, b or B for binary, d or D for decimal, h or H for hexadecimal value is sequence of digits valid for specified base Values a through f (for hexadecimal base) are case-insensitive 7 OF SOUTHERN OF SOUTHERN USC USC UNIVERSITY UNIVERSITY CALIFORNIA CALIFORNIA Base Format Notation Examples Base Format Notation Examples l 5O37 // 5-bit octal l 4d2 // 4-bit decimal l 4b1x_01 // 4-bit binary ( _ has no effect but can be // used for readability) l 7hx // xxxxxxx in binary (x-extended) l 4d-4 // Not legal: value cannot be negative l 8 h 2A // spaces allowed between size and character // and between base and value l 3 b001 // not legal: no space allowed between and...
View Full Document

Page1 / 22

Verilog_four_slides_per_page - 1 1 OF SOUTHERN OF SOUTHERN...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online