Skip to content

SystemVerilog · Topic

SystemVerilog Operators — Width, Signedness & X Behaviour

Bitwise, logical, reduction, shift, arithmetic and equality operators — with the width, signedness and X rules that decide what each one actually computes.

Operators look like the least interesting part of the language and produce some of its most expensive bugs, because an operator expression is well-formed, type-correct and silently wrong. Three rules cause nearly all of it: a result does not widen to hold the mathematically correct answer, an expression is signed only if every operand is signed, and a comparison against an unknown value returns X rather than false. None of the three produces a warning, and each one has a failure mode where a check stops discriminating rather than failing.

Lessons in this topic(10)

Start hereArithmetic OperatorsSystemVerilog Arithmetic Operators
  1. 2Relational & Equality Operators
  2. 3Logical Operators
  3. 4Bitwise Operators
  4. 5Reduction Operators
  5. 6Shift Operators
  6. 7Concatenation, Replication & Conditional
  7. 8Inside Operator
  8. 9Wildcard Equality — ==? and !=?
  9. 10Operator Precedence