AHDL

Comparators



Two types of comparators are used to compare single nodes or groups: logical and arithmetic. The following comparators can be used in Boolean expressions.

Comparator: Example: Description:
== (logical)
addr[19..4] == B"B800"
equal to
!= (logical)
b1 != b3
not equal to
< (arithmetic)
fame[] < power[]
less than
<= (arithmetic)
money[] <= power[]
less than or equal to
> (arithmetic)
love[] > money[]
greater than
>= (arithmetic)
delta[] >= 0
greater than or equal to

 

Logical comparators can compare single nodes, groups of nodes, and numbers without X (don't care) values. If groups of nodes or numbers are compared, the groups must be the same size. The Compiler performs a bitwise comparison on the groups, returning VCC when the comparison is true and GND when the comparison is false.

Arithmetic comparators may only compare groups of nodes and numbers, and the groups must be the same size. The Compiler performs an unsigned magnitude comparison on the groups; that is, each group is interpreted as a positive binary number and compared to the other group.


Back to Top

- PLDWorld -

 

Created by chm2web html help conversion utility.