Вы находитесь на странице: 1из 5

Opeartors

1. Logical operators
VHDL logical operators
opeartor
AND NAND NOR OR XOR XNOR NOT

Operand type
Bit Bit Bit Bit Bit Bit Bit

Result type
Bit Bit Bit Bit Bit Bit Bit

Verilog bitwise logical operators


operator
& | ~(&) ~(|) ^ ~^ ~

Operand type
Bit Bit Bit Bit Bit Bit Bit

Result type
Bit Bit Bit Bit Bit Bit Bit

Verilog boolean logical operators


operator
&& ||

operation
AND OR

No. of operands
two two

Opeartors
Verilog reduction logical operators

operator
& | ~& ~| ^ ~^ !

operation
Reduction AND Reduction OR reduction NAND Reduction OR Reduction XOR Reduction XNOR NEGATION

No. of operands
One One One One One One One

2.Relational operators
VHDL relational operators
operator
= /= < <= > >=

description
Equality Inequality Less than Less than or equal Graeter than Graeter than or equal

Op. type
Any type Any type Scalar Scalar Scalar scalar

Result type
Boolean Boolean Boolean Boolean Boolean boolean

Verilog relational operators operator


== !=

description
equality Inequality

Result type
0,1,x 0,1,x

Opeartors
=== !== < <= > >= Equality inclusive Inequality inclusive Less than Less than or equal Greater than Greater than or equal 0,1 0,1 0,1,x 0,1,x 0,1,x 0,1,x

3.Arithmetic operators
VHDL arithmetic operators
operator
+ * * * / / / Mod Rem Abs

description
Addition A+B Subtraction A-B Multiplication A?B Multiplication A?B Multiplication A?B Division A/B Division A/B Division A/B Modulus A mod B Remainder A rem B Absolute

A or B type
A numeric B numeric A numeric B numeric A integer or real B integer or real A physical B integer or real A integer or real B physical A integer or real B integer or real A integer or real B physical A physical B integer or real A only integer B only integer A only integer B only integer A numeric

Y type
numeric Numeric Same as A Same as A Same as B Same as A Same as B Same as A Integer Integer Positive numeric

Opeartors
& ** Abs(A) Concatenation (A&B) Exponent A**B A numeric or array Same as A B numeric or array A real or integer Same as A B only integer

Verilog arithmetic operators

operator
+ * / % ** {,}

Description
Addition A+B Subtraction A-B Multiplication A?B Division A/B Modulus A%B Exponent A**B Concatenation {A,B}

A or B type
A numeric B numeric A numeric B numeric A numeric B numeric A numeric B numeric A numeric,not real B numeric,not real A numeric B numeric A numeric or array B numeric or array

Y type
Numeric Numeric Numeric Numeric Numeric,not real numeric Same as A

4.Shift and rotate operators


VHDL shift/rotate operators
operation description Op. A before shift Op.A after shift

Opeartors
A sll 1 Shift A 1 position left logic 1110 110x A sll 2 A srl 1 A srl 2 A sla 1 A sra 1 A rol 1 A ror 1 Shift A 2 positions left logic shift A 1 position right logic Shift A 2 positions right logic Shift a 1 position left arithmetic Shift A 1 position right arithmetic Rotate A 1 position left rotate A 1 position right 1110 1110 1110 1110 1110 1110 1110 10xx x111 xx11 110x 1111 1101 0111

Verilog shift operators


operation
A<<1 A<<2 A>>1 A>>2

description
Shift A 1 position left logic Shift A 2 positions left logic Shift A 1 position right logic Shift A 2 positions right logic

Op. A Op. A after before shift shift


1110 1110 1110 1110 110x 10xx X111 Xx11

Вам также может понравиться