next up previous contents
Next: Generic arrays and vector Up: Vectors and vector operators Previous: Explicit coercion operators   Contents

Coercion of array variables to vectors

A reference to an array of signals without a subscript will be converted to a vector. For example, if x is declared in this way:

        x : array 0..3 of boolean;

then the expression ``x'' is equivalent to

        [x[0],x[1],x[2],x[3]]

Note that the elements of x occur in the order given by the type declaration. Thus, for example, if x is declared in this way:

        x : array 3..0 of boolean;
then the expression ``x'' is equivalent to

        [x[3],x[2],x[1],x[0]]

This has consequences when combining ``big endian'' and ``little endian'' arrays. For example, if we have

        x : array 3..0 of boolean;
        y : array 0..3 of boolean;
Then the expression ``x = y'' is equivalent to

        (x[3] = y[0]) & (x[2] = y[1]) & (x[1] = y[2]) & (x[0] = y[3])

The only difference between big-endian and little-endian arrays is the order in which they are converted to vectors (which determines which element of the array is considered most significant and least significant).



2002-10-28