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.
| Operation | Operator | |
|---|---|---|
| VHDL | Verilog | |
| Arithmetic Operators | ||
| exponential | ** | - |
| multiplication | * | * |
| division | / | / |
| addition | + | + |
| subtraction | - | - |
| modulus | mod | % |
| remainder | rem | - |
| absolute value | abs | - |
| Concentration and Replication Operators | ||
| concentration | & | {} |
| replication | {{}} | |
| Conditional Operator | ||
| conditional | - | ?: |
| Equality Operators | ||
| equality | = | == |
| inequality | /= | != |
| Logical Bit-wise Operators | ||
| unary negation NOT | not | ~ |
| binary AND | and | & |
| binary OR | or | | |
| binary NAND | nand | - |
| binary NOR | nor | - |
| binary XOR | xor | ^ |
| binary XNOR | xnor | ^~ or ~^ |
| Logical Comparison Operators | ||
| NOT | not | ! |
| AND | and | && |
| OR | or | || |
| 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 left | sll | << |
| logical shift right | srl | >> |
| arithmetic shift left | sla | |
| arithmetic shift right | sra | |
| logical rotate left | rol | |
| logical rotate right | ror | |
| Unary Arithmetic Operators | ||
| identity | + | + |
| negotiation | - | - |
