TAILIEUCHUNG - Basic Concepts part 1

[ Team LiB ] 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. | Team LiB 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. a b c This is a one-line comment This is a multiple line comment This is an illegal comment This is a legal comment 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. a b is a unary operator. b is the operand a b c is a binary operator. b and c are operands a b c d is a ternary operator. b c and d are operands Number Specification There are two types of number specification in Verilog sized and unsized. Sized numbers Sized numbers are represented as size base format number . size is written only in decimal and specifies the number of bits in the number. Legal base formats are decimal d or D hexadecimal h or H binary b or B and octal o or O . The number is specified as consecutive digits from 0 1 2 3 4 5 6 7 8 9 a b c d e f. Only a subset of these digits is legal for a particular base. Uppercase letters are legal for number specification. 4 b1111 This is a 4-bit binary number 12 habc This is a 12-bit hexadecimal number 16 d255

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.