All values are 32 bits, the same size as a MIPS register. HEX, DEC, OCT, and BIN always show the same value.
Choose the input base
Tap HEX, DEC, OCT, or BIN, or tap a row in the display. The selected base key turns yellow. Only the digits of that base can be typed. The small word before the result (HEX, DEC, OCT, or BIN) shows the base of the number.
To type a negative decimal number, type the number and press NEG. DEC signed accepts up to 2147483647. For larger decimal numbers, tap the DEC unsigned row (up to 4294967295).
To get −2147483648 (the most negative 32-bit value), type 80000000 in HEX, or tap the DEC unsigned row and type 2147483648.
Two-value operations
Type the first value, press the operation, type the second value, then press =. If you press = without a second value, the first value is used again (5 + = gives 10).
AND OR XOR
Bitwise AND, OR, XOR
NAND NOR XNOR
NOT of AND, OR, XOR
+ −
Add and subtract. The result wraps to 32 bits. "Signed overflow" shows when the signed result of the last operation does not fit in 32 bits.
Binary column view
In BIN, after + or − and =, the display shows the work in columns: the first number, the second number, and the result, with bit numbers (31, 27, ..., 3, 0) on top. For +, the "carry" row on top shows the carry into each bit, and the line under the result shows the carry into bit 31 and the carry out of bit 31.
Signed overflow happens when the carry into bit 31 and the carry out of bit 31 are different.
Shifts (like MIPS)
Type the value, press the shift, type the shift amount, then press =. The shift amount is always typed in decimal (0 to 31), as in MIPS: sll $t0, $t1, 4.
sll
Shift left logical. 0s fill from the right.
srl
Shift right logical. 0s fill from the left.
sra
Shift right arithmetic. Copies of bit 31 (the sign bit) fill from the left.
Multiply and divide with shifts
Shifting by n bits multiplies or divides by 2, 4, 8, 16, ... (2 to the power n). Example: n = 3 means × 8 or ÷ 8. MIPS has no "sla": sll works for both signed and unsigned values.
sll n
Multiply, signed or unsigned. 5 sll 3 = 40 (5 × 8). −5 sll 2 = −20 (−5 × 4). Bits shifted out of bit 31 are lost.
Warning 1: do not use srl on a negative value. −64 srl 3 = 536870904, not −8.
Warning 2: if a negative value does not divide exactly, sra rounds down, not toward zero. −7 sra 1 = −4, but MIPS div gives −7 ÷ 2 = −3. Word addresses and word offsets divide exactly by 4, so this does not affect them.
Tip: to type −5, tap the DEC signed row, type 5, then press NEG.
One-value operations (act right away)
NOT
Flip all 32 bits
NEG
Two's complement negate (0 − value)
SE16
Sign-extend the low 16 bits to 32 bits (like the immediate of addi, lw, sw, and like lh)
ZE16
Zero-extend the low 16 bits to 32 bits (like the immediate of andi, ori, xori, and like lhu)
SE8
Sign-extend the low 8 bits to 32 bits (like lb)
ZE8
Zero-extend the low 8 bits to 32 bits (like lbu)
Two's complement by hand: NEG is the same as NOT and then + 1. Try it: type 5, press NOT, then press + 1 =. The result is −5, the same as 5 NEG.
Other keys
AC
Clear everything
⌫
Delete the last typed digit
Undo
Go back one step. Press it again to go back more steps (up to 50). It can also undo AC.
Redo
Go forward again after Undo, one step at a time. Use Undo and Redo to step back and forth through your work. A new change after Undo clears the Redo steps.
Bits
Tap any bit in the BIN area to flip it between 0 and 1
? Help
Open this help page
Computer keyboard
0-9 A-F
Digits
Enter or =
Equals
Backspace
Delete last digit
Esc
AC (when help is open, Esc closes help)
Ctrl+Z
Undo (Cmd+Z on a Mac)
Ctrl+Y
Redo (or Ctrl+Shift+Z; Cmd+Shift+Z on a Mac)
& | ^ ~
AND, OR, XOR, NOT
+ -
Add, subtract
< >
sll, srl
Tab
Move between keys. Enter or Space presses the selected key. Type any shortcut key to go back to normal typing, where Enter is =.