Lesson 3: Binary & Number Representation
We saw that hardware works on bits — 0 and 1. But how does a collection of zeros and ones become a number like 13? The answer is the binary system: just as decimal has a ones, tens, and hundreds digit, binary has a 1, 2, 4, 8 digit — powers of 2. In this lesson we'll understand why computers choose
A computer counts with only two fingers: 0 and 1. Just as we build numbers from ones, tens, and hundreds, the computer builds them from 1, 2, 4, 8 — and each digit says 'has' or 'doesn't have' that value.
- Binary
- A base-2 numbering system using only two digits, 0 and 1, where each place equals a power of 2.
- Bit
- A single binary digit, 0 or 1; the smallest unit of information. Short for Binary Digit.
- Byte
- A group of 8 bits, the basic unit in which memory is measured; it represents 256 distinct values.
- Nibble
- Half a byte, that is 4 bits; it maps exactly to one hexadecimal digit.
- Place Value
- The value each position contributes by its place; in binary the places are 1, 2, 4, 8, 16, and so on (powers of 2).
- Hexadecimal
- A base-16 system (digits 0-9 then A-F) used as a compact shorthand for binary: one digit = 4 bits.
- Unsigned
- A representation of non-negative integers only; with n bits the range is 0 to 2^n minus 1.
- Two's Complement
- The common method for representing negative numbers: flip all the bits and add 1; the leftmost bit sets the sign.
- Overflow
- A situation where a computation's result exceeds the range representable in the given number of bits, and the value 'wraps around'.
- Most Significant Bit
- The leftmost bit, with the highest place value; in two's complement it is also the sign bit.