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

Accellera

 

Version 2.3.1, June 1, 2009

VERILOG-AMS

 

Table 4-1—Operators (continued)

 

 

 

~|

 

Reduction nor

 

 

 

^

 

Reduction xor

 

 

 

~^ or ^~

 

Reduction xnor

 

 

 

<<

 

Logical left shift

 

 

 

>>

 

Logical right shift

 

 

 

<<<

 

Arithmetic left shift

 

 

 

>>>

 

Arithmetic right shift

 

 

 

?:

 

Conditional

 

 

 

4.2.1 Operators with real operands

The operators shown in Table 4-2 are legal when applied to real operands. All other operators are considered illegal when used with real operands.

Table 4-2—Legal operators for use in real expressions

unary + unary -

Unary operators

 

 

 

 

+

- * /

**

Arithmetic

 

 

 

 

 

%

 

 

 

Modulus

 

 

 

 

 

>

>=

<

<=

Relational

 

 

 

 

== !=

 

 

Logical equality

 

 

 

 

 

!

&&

||

 

Logical

 

 

 

 

 

?:

 

 

 

Conditional

 

 

 

 

 

The result of using logical or relational operators on real numbers is an integer value 0 (false) or 1 (true).

If a real expression is used for the replication factor of a concatenation, the expression will first be converted to an integer value using the rules described in 4.2.1.1, before it is used as the replication factor for the concatenation.

4.2.1.1 Real to integer conversion

Real numbers are converted to integers by rounding the real number to the nearest integer, rather than by truncating it. Implicit conversion takes place when a real number is assigned to an integer. If the fractional part of the real number is exactly 0.5, it shall be rounded away from zero.

Examples:

The real numbers 35.7 and 35.5 both become 36 when converted to an integer and 35.2 becomes 35.

Converting -1.5 to integer yields -2, converting 1.5 to integer yields 2.

Copyright © 2009 Accellera Organization, Inc.

50

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