- How does binary addition work?
- Binary addition follows the same column-by-column process as decimal addition, but with only two digits (0 and 1). Rules: 0+0=0, 0+1=1, 1+0=1, 1+1=10 (write 0, carry 1), 1+1+1=11 (write 1, carry 1). Example: 1010 + 0110 = 10000 (10 + 6 = 16 in decimal).
- How does binary subtraction work?
- Binary subtraction follows the same borrow rules as decimal. When borrowing, 1 ten (1 in decimal) becomes 10 binary (2 in decimal), so 10 − 1 = 1. Example: 1010 − 0110 = 0100 (10 − 6 = 4 in decimal). The calculator handles the borrowing automatically.
- What is a bitwise AND operation?
- Bitwise AND compares each bit position: the result bit is 1 only if both input bits are 1. Example: 1010 AND 1100 = 1000 (bits aligned: only position 3 has both bits as 1). AND is used for masking — isolating specific bits by ANDing with a mask.
- What is XOR used for in computing?
- XOR (exclusive OR) produces 1 when bits differ, 0 when they are the same. It is used in: cryptography (simple XOR cipher, hash functions), parity checks, swap algorithms (XOR swap without a temp variable), RAID storage parity, and generating checksums. XOR-ing a value with itself always gives 0.
- What does left shift (<<) do?
- Left shift moves all bits left by the specified number of positions, filling from the right with zeros. Each left shift by 1 doubles the value (equivalent to multiplying by 2). Example: 0011 << 2 = 1100 (3 << 2 = 12 = 3 × 4). Right shift (>>) divides by powers of 2.
- How do I enter a negative binary number?
- Enter the magnitude as a positive binary number — the subtraction operation handles negativity. For example, to compute −5 + 3, calculate 5 − 3 = 2 separately. Two's complement representation of negative numbers is used internally but the display shows decimal for negative results.
- What is the maximum binary number I can calculate with?
- The calculator uses JavaScript's standard 32-bit integer for bitwise operations (AND, OR, XOR, shifts) and 53-bit safe integers for arithmetic. For bitwise operations, inputs are coerced to 32-bit signed integers, so very large binary numbers may have unexpected results — use arithmetic mode for large values.