Logical Operators (AHDL)

The following logical operators can be used in Boolean expressions:

Operator

Example

Description

! NOT

!tob NOT tob

one's complement (prefix inverter)

& AND

bread & butter bread AND butter

AND

!& NAND

a[3..1] !& b[5..3] a[3..1] NAND b[5..3]

AND inverter

# OR

trick # treat trick OR treat

OR

!# NOR

c[8..5] !# d[7..4] c[8..5] NOR d[7..4]

OR inverter

$ XOR

foo $ bar foo XOR bar

exclusive OR

!$ XNOR

x2 !$ x4 x2 XNOR x4

exclusive NOR

Each operator represents a two-input logic gate, except the NOT (!) operator, which is a prefix inverter on a single node. You can use either the name or the symbol to represent a logical operator.

Expressions that use these operators are interpreted differently, depending on whether the operands are single nodes, groups, or numbers. Also, expressions with the NOT operator are interpreted differently from those with other logical operators.

You can name Boolean operators and comparators in AHDL files to make it easy to enter resource assignments and to interpret the Equations Section of the Text-Format Report File (.rpt) or HTML-Format Report File (.htm).