11.2.2 Operators

A number of bit-wise operators are available to you: Arithmetic, Concentration and Replication, Conditional, Equality, Logical Bit-wise, Logical Comparison, Reduction, Relational, Shift, and Unary Arithmetic (Sign). These operators and their availability in VHDL or Verilog are compared in the table below.

OperationOperator
VHDLVerilog
Arithmetic Operators
exponential**-
multiplication**
division//
addition++
subtraction--
modulusmod%
remainderrem-
absolute valueabs-
Concentration and Replication Operators
concentration&{}
replication{{}}
Conditional Operator
conditional-?:
Equality Operators
equality===
inequality/=!=
Logical Bit-wise Operators
unary negation NOTnot~
binary ANDand&
binary ORor|
binary NANDnand-
binary NORnor-
binary XORxor^
binary XNORxnor^~ or ~^
Logical Comparison Operators
NOTnot!
ANDand&&
ORor||
Reduction Operators
AND-&
OR-|
NAND-~&
NOR-~|
XOR-^
XNOR-^~ or ~^
Relational Operators
less than<<
less than or equal to<=<=
greater than>>
greater than or equal to>=>=
Shift Operators
logical shift leftsll<<
logical shift rightsrl>>
arithmetic shift leftsla
arithmetic shift rightsra
logical rotate leftrol
logical rotate rightror
Unary Arithmetic Operators
identity++
negotiation--