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

 

Bit Manipulation Intrinsic Functions

Summary,

tabular18773

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,

  figure13498
Figure 29: 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:

Return to corresponding overview page gif


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

©University of Liverpool, 1997
Wed May 28 20:20:27 BST 1997
Not for commercial use.