Syntax at a glance
!busy
How it works
Logical negation reverses a Boolean value: !0 is 1 and !1 is 0. Applied to a signal, !busy is true on every sampled cycle where busy is low. Applied to a parenthesized expression, it reverses the value of the entire expression.
Use negation to describe an active-low condition. In (req && !busy) |-> ack, a request requires acknowledgement only while busy is low. When busy is high, !busy is false and that implication instance passes without an acknowledgement obligation.
Negation is a level test, not an edge detector. If start = [1, 0, 0, 0], !start is true at cycles 1, 2, and 3. $fell(start) is true only at cycle 1. Using !start in place of $fell(start) therefore creates repeated obligations during a long low interval.
Be careful about scope: !a && b means that a must be low and b high; !(a && b) means that the pair must not both be high. These differ when both are zero. For binary expressions, !(a && b) is equivalent to !a || !b.
The lab supports logical ! on binary Boolean expressions. It does not implement a multibit bitwise complement operator. Negation has the highest Boolean precedence here; use parentheses to negate a comparison, such as !(a == b).