Bit shift right logical
c = bitsrl(a, k) returns the result of a logical right shift by k bits on input a for fixed-point operations. bitsrl shifts zeros into the positions of bits that it shifts right. It does not check overflow or underflow.
bitsrl ignores fimath properties such as RoundingMode and OverflowAction.
When a is a fi object, a and c have the same associated fimath and numerictype objects.
Shift a signed fi input right by 1 bit.
Create a signed fixed-point fi object with a value of –8, word length 4, and fraction length 0 and display its binary value.
a = fi(-8,1,4,0); disp(bin(a))
Shift a right by 1 bit, and display the binary value.
bitsrl shifts a zero into the position of the bit that it shifts right.
Shift right a built-in int8 input using a fi shift value.
k=fi(2); a = int8(64); bitsrl(a,k)
ans = 16
Use bitsrl to shift an uint8 input right by 2 bits.
a = uint8(64); bitsrl(a,2)
ans = 16
Data that you want to shift, specified as a scalar, vector, matrix, or multidimensional array.
Data Types: fi | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64
Complex Number Support: Yes
Number of bits to shift, specified as a non-negative integer-valued scalar.
Data Types: fi|single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64