Shifts a number to the right by a specified amount of bits and returns the result found after the shift.
BITRSHIFT(number, shift_amount)
number should be 0 or higher.
shift_amount is an integer.
Example:
If number contains 1 and shift_amount contains 2:
BITRSHIFT(1, 2)
returns 0
numberOne:
numberTwo:
Result:
Sensor Data Processing
Imagine you have a sensor that measures light intensity. The sensor outputs a digital value, which is then processed by a microcontroller. The raw sensor data is a decimal number, but for certain calculations, you need to quickly divide this value by powers of two (e.g., to scale the data or perform a simple average).
Let's say the sensor returns a value that needs to be divided by 4 for a specific part of the data analysis. Instead of using a standard division operation, which can be computationally more expensive, you can use the BITRSHIFT function, which performs a bitwise right shift. A right shift of 2 bits is equivalent to dividing the number by 22=4.
Here is how you can represent this in a spreadsheet program using the BITRSHIFT function:
Raw Sensor Value (Decimal) | Raw Sensor Value (Binary) | Shift Amount | Formula | Processed Value (Decimal) | Processed Value (Binary) | ||
|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | ||
1 | 45 | 101101 | 2 | BITRSHIFT(45, 2) | 11 | 1011 | |
2 | 62 | 111110 | 2 | BITRSHIFT(62, 2) | 15 | 1111 | |
3 | 100 | 1100100 | 2 | BITRSHIFT(100, 2) | 25 | 11001 |
Explanation of the table:
In this example, the BITRSHIFT function provides a highly efficient way to perform a division by a power of two, which is a common task in fields like signal processing, computer graphics, and embedded systems.
PRODUCT & FEATURES
RESOURCES
Terms | Privacy | Spam Policy
© 2026 Zapof