[Next] [Up] [Previous] [Contents]
Next: Arrays Up: Data types and type Previous: Data types and type

Boolean, enumerated and subrange types

The simple types are boolean, enumerated and subrange. The type ``boolean'' is simply an abbreviation for the set {0,1}. Thus,

        foo : boolean;
declares a signal named ``foo'', which can take on the value 0 or 1. An enumerated type is a set of symbols. For example,

        bar : {ready,willing,able};
declares a signal named ``bar'', which can take one of the symbolic values ``ready'', ``willing'' or ``able''. A type can also be a subrange of the integers. For example,

        count : 0..7;
declares a signal ``count'' which can take any value inclusively in the range from 0 to 7. Numeric values in type declarations may also be expressions, consisting of numeric constants, and the numeric operators +, -, *, /, mod, <<, >> and ** (see section 1.8).



Ken McMillan
Sat Jun 6 21:41:59 PDT 1998