Reverse a binary number using bitwise operators only.
Implement reverse_binary(n, width) to reverse exactly width bits of the nonnegative integer n. Return the resulting integer without converting the value to a string or using string-based operations. The input satisfies 0 <= n < 2**width, and 1 <= width <= 32.
def reverse_binary(n, width):