next up previous contents
Next: Array Construction Intrinsics Up: Intrinsics Previous: Intrinsics

 

Bit Manipulation Intrinsic Functions

Summary,

tabular11313

Variables used as bit arguments must be INTEGER valued. The model for bit representation is that of an integer so 0 would have a bit representation of all 0's, 1 would have all zeros except for a 1 in the last position (position zero) ( 00...0001). The positions are numbered from zero and go from right to left (just like regular binary numbers.)

The model for bit representation is that of an unsigned integer, for example,

  figure11253
Figure 13: Visualisation of Bit Variables

The number of bits in a single variable depends on the compiler -- parameterised integers should be used to fix the number of bytes. The intrinsic BIT_SIZE gives the number of bits in a variable.

Here is a summary of the bit intrinsics and examples of their use; assume that A has the value 5 (00...000101) and B the value 3 (00...000011) in the following:


next up previous contents
Next: Array Construction Intrinsics Up: Intrinsics Previous: Intrinsics

Adam Marshall ©University of Liverpool, 1996
Tue Nov 26 17:50:42 GMT 1996