Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
VAMS-LRM-2-3-1.pdf
Скачиваний:
43
Добавлен:
05.06.2015
Размер:
3.73 Mб
Скачать

 

Accellera

Analog and Mixed-signal Extensions to Verilog HDL

Version 2.3.1, June 1, 2009

4. Expressions

4.1 Overview

This section describes the operators and operands available in the Verilog-AMS HDL, and how to use them to form expressions.

An expression is a construct which combines operands with operators to produce a result which is a function of the values of the operands and the semantic meaning of the operator. Any legal operand, such as an integer or an indexed element from an array of reals, without a operator is also considered an expression. Wherever a value is needed in a Verilog-AMS HDL statement, an expression can be used.

Some statement constructs require an expression to be a constant expression. The operands of a constant expression consists of constant numbers and parameter names, but they can use any of the operators defined in Table 4-1, Table 4-14, and Table 4-15.

4.2 Operators

The symbols for the Verilog-AMS HDL operators are similar to those in the C programming language. Table 4-1 lists these operators.

 

 

 

 

Table 4-1—Operators

 

 

 

 

 

{}

{{}}

 

 

Concatenation, replication

 

 

 

unary +, unary -

 

Unary operators

 

 

 

 

 

 

+

-

*

/ **

 

Arithmetic

 

 

 

 

 

 

%

 

 

 

 

Modulus

 

 

 

 

 

 

>

>=

<

<=

 

Relational

 

 

 

 

 

 

!

 

 

 

 

Logical negation

 

 

 

 

 

&&

 

 

 

Logical and

 

 

 

 

 

 

||

 

 

 

 

Logical or

 

 

 

 

 

 

==

 

 

 

 

Logical equality

 

 

 

 

 

 

!=

 

 

 

 

Logical inequality

 

 

 

 

 

===

 

 

 

Case equality

 

 

 

 

 

!==

 

 

 

Case inequality

 

 

 

 

 

 

~

 

 

 

 

Bitwise negation

 

 

 

 

 

 

&

 

 

 

 

Bitwise and

 

 

 

 

 

 

|

 

 

 

 

Bitwise inclusive or

 

 

 

 

 

 

^

 

 

 

 

Bitwise exclusive or

 

 

 

 

^~ or ~^

 

 

Bitwise equivalence

 

 

 

 

 

 

&

 

 

 

 

Reduction and

 

 

 

 

 

 

~&

 

 

 

 

Reduction nand

 

 

 

 

 

 

|

 

 

 

 

Reduction or

 

 

 

 

 

 

49

Copyright © 2009 Accellera Organization, Inc. All rights reserved.

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]