Topic 2 · Computer Organisation
Computer Science · Cheatsheet

Topic 2 · Computer Organisation

Chapter 2 · Two's complement & logic

📋 Reference · always available
Two's complement
−x = flip every bit of x, then add 1. Subtraction becomes addition.
Sign bit
Leading bit: 0 = non-negative, 1 = negative.
n-bit range
−2^(n−1) to 2^(n−1)−1. 8 bits → −128 to +127.
Gates
AND (both), OR (either), NOT (flip); NAND/NOR/XOR built from these.
Truth table
n inputs → 2ⁿ rows; precedence NOT → AND → OR.
De Morgan
NOT(A AND B) = NOT A OR NOT B.