ExactBench · Engineering calculators

Bitwise · Bit Shift Calculator

AND · OR · XOR · shifts

Operands

Result · AND

0x30
48 unsigned · 48 signed

Bit map

result in green
8-BIT OPERANDSa11110000b00111100result00110000
Result (hex)0x30
Result (decimal)48
Result (signed)48
Result (binary)0011 0000
a0xF0 · 240
b0x3C · 60
Expression0xF0 & 0x3C
How this works. Every operation is applied to the value masked to the selected word width, so the result is what a fixed-width register would actually hold. The two right shifts differ in what they feed in at the top: logical (>>>) always shifts in zeros, while arithmetic (>>) replicates the sign bit so a negative value stays negative — which is why 0xF0 >> 4 is 0xFF at 8 bits signed but 0x0F logical. In C, which one you get depends on whether the operand is signed, and shifting by more than the word width is undefined behaviour rather than zero. Shift counts here are read as decimal regardless of the selected base.