Multiplex: For every bit in u3: for a 1 bit, select the
corresponding bit from u1, otherwise the corresponding bit from u2.
E.g., %0011 %1100 %1010 mux
gives %0110
Shift u1 left by u bits.
Shift u1 (cell) right by u bits, filling the shifted-in bits with zero (logical/unsigned shift).
Shift n1 (cell) right by u bits, filling the shifted-in bits from the sign bit of n1 (arithmetic shift).
Shift ud1 (double-cell) left by u bits.
Shift ud1 (double-cell) right by u bits, filling the shifted-in bits with zero (logical/unsigned shift).
Shift d1 (double-cell) right by u bits, filling the shifted-in bits from the sign bit of d1 (arithmetic shift).
Shift left by 1; also works on unsigned numbers
Arithmetic shift right by 1. For signed numbers this is a floored
division by 2 (note that /
is symmetric on some systems, but
2/
always floors).
Shift double-cell left by 1; also works on unsigned numbers
Arithmetic shift right by 1. For signed numbers this is a floored division by 2.
u2 is the lowest power-of-2 number with u2>=u1.
N is the rounded-down binary logarithm of u, i.e., the index of the first set bit; if u=0, n=-1.
f is true if and only if u is a power of two, i.e., there is exactly one bit set in u.
count trailing zeros in binary representation of x
Unlike most other operations, rotation of narrower units cannot easily be synthesized from rotation of wider units, so using cell-wide and double-wide rotation operations means that the results depend on the cell width. For published algorithms or cell-width-independent results, you usually need to use a fixed-width rotation operation.
Rotate the least significant 16 bits of u1 left by u bits, set the other bits to 0.
Rotate the least significant 16 bits of u1 right by u bits, set the other bits to 0.
Rotate the least significant 32 bits of u1 left by u bits, set the other bits to 0.
Rotate the least significant 32 bits of u1 right by u bits, set the other bits to 0.
Rotate all bits of u1 left by u bits.
Rotate all bits of u1 right by u bits.
Rotate all bits of ud1 (double-cell) left by u bits.
Rotate all bits of ud1 (double-cell) right by u bits.