0101 Low-Level ALU Operations
Binary Arithmetic & Bitwise Calculator
Execute binary addition, subtraction with Two's Complement, multiplication, division, and bitwise logic operations (AND, OR, XOR, NOT, Bit-shifts).
Binary Operands
210
53
12 + 10
Bitmask XOR
Shift Right 2
Binary Result (Base 2)
100000111
Hexadecimal
0x107
Octal
0407
Bit Count
9 Bits
๐ก Step-by-Step Execution:
210 + 53 = 263 → 11010010 + 00110101 = 100000111
Two's Complement & ALU Arithmetic
In modern CPU architectures (x86_64, ARM), all subtraction operations are performed via addition using two's complement:
- One's Complement: Flip all bits ($0 \to 1, 1 \to 0$).
- Two's Complement: Add $1$ to One's complement to represent negative integers in binary hardware adders.