Bitwise rotate left
c = bitrol(a, k) returns the value of the fixed-point fi object, a, rotated left by k bits. bitrol rotates bits from the most significant bit (MSB) side into the least significant bit (LSB) side. It performs the rotate left operation on the stored integer bits of a.
bitrol does not check overflow or underflow. It ignores fimath properties such as RoundingMode and OverflowAction.
a and c have the same fimath and numerictype properties.
Create an unsigned fixed-point fi object with a value of 10, word length 4, and fraction length 0.
a = fi(10,0,4,0); disp(bin(a))
Rotate a left 1 bit.
Rotate a left 2 bits.
Create a vector of fi objects.
a = fi([1,2,5,7],0,4,0)
a = 1 2 5 7 DataTypeMode: Fixed-point: binary point scaling Signedness: Unsigned WordLength: 4 FractionLength: 0
0001 0010 0101 0111
Rotate the bits in vector a left 1 bit.
0010 0100 1010 1110
Create an unsigned fixed-point fi object with a value 10, word length 4, and fraction length 0.
a = fi(10,0,4,0);
Rotate a left 1 bit where k is a fi object.
Data that you want to rotate, specified as a scalar, vector, matrix, or multidimensional array of fi objects. a can be signed or unsigned.
Data Types: fixed-point fi
Complex Number Support: Yes
Number of bits to rotate, specified as a non-negative integer-valued scalar fi object or built-in numeric type. k can be greater than the word length of a. This value is always normalized to mod(a.WordLength,k).
Data Types: fi |single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64