AHDL

Boolean Equations



Boolean equations are used in the Logic Section of a Text Design File (.tdf) to represent the connection of nodes, the flow of inputs into and the flow of outputs from input and output pins, primitives, macrofunctions, and state machines.

NOTE Boolean equations must follow the rules described in Boolean Equation Rules.

The following example shows a complex Boolean equation:

a[] = ((c[] & -B"001101") + e[6..1]) # (p, q, r, s, t, v);

The left of the equation can be a symbolic, port, or group name. You can use the NOT (!) operator to invert any item on the left. The right of the equation consists of a Boolean expression, which is evaluated as described in Boolean Operator & Comparator Priorities.

The equals symbol (=) is used in Boolean equations to indicate that the result of the Boolean expression on the right is the source of the symbolic node or group on the left. The single equals symbol differs from the double equals symbol (==), which is used as a comparator.

In the example shown above, the Boolean expression on the right is evaluated according to Boolean equation priority rules:

  1. The binary number B"001101" is negated and becomes B"110011". The unary minus (-) has first priority.

  2. B"110011" is ANDed (&) with the group c[]. This expression has second priority because it is enclosed in parentheses.

  3. The result of the group expression in step 2 is added to the group e[6..1].

  4. The result of the expression in step 3 is ORed (#) with the group (p, q, r, s, t, v). This expression has last priority.

The final result is assigned to the group a[].

For the sample equation shown above to be legal, the number of bits in the group on the left of the equation must be evenly divisible by the number of bits in the group on the right of the equation. The bits on the left of the equation are mapped to the right of the equation in order. Example


Back to Top

- PLDWorld -

 

Created by chm2web html help conversion utility.