## Relationship between Input Integers and Output Bit Stream

The relationship between the **input integers** and the **output bit stream** is given by the following equations:

*b* _{ i×M+j } = (*a* _{ i }»(*M*-1-*j*)) &1, *j* = 0…*M*-1, *i* = 0…*N* - 1 (**packed bit order** set to MSB first)

*b* _{ i×M+j } = (*a* _{ i }»*j*) &1, *j* = 0…*M* - 1, *i* = 0…*N* - 1 (**packed bit order** set to LSB first)

Where » denotes the operation of right shifting, and the operator & stands for the logical AND operation.

For example, assume the **input integers** array is the element [4], the **bits per integer** value is specified as 3, and **integer format** is set to **Unsigned**. If **packed bit order** is set to **MSB first**, the **output bit stream** is [1 0 0]. If the **packed bit order** is set to **LSB first**, the **output bit stream** is [0 0 1]. The signed negative numbers are stored as the 2's complement. Thus, if **integer format** is set to **Signed** and the **bits per integer** is set to 3, the **input integer** array is the element [-3], and the **packed bit order** is set to **MSB First** the **output bit stream** is [1 0 1].