Understand binary numbers, their fundamental role in digital systems, and how they represent data in computing environments.
The binary system uses only the digits $0$ and $1$ and is the language of digital circuits: a switch is on or off, a voltage level is high or low. Understanding how numbers are written and added in base two is the first step to understanding how a computer stores and processes data [1].
As in the decimal system, the value of a digit depends on its position, but the weights are powers of $2$. The number $101101_2$ equals $1 \cdot 2^5 + 0 \cdot 2^4 + 1 \cdot 2^3 + 1 \cdot 2^2 + 0 \cdot 2 + 1 = 45$ (calculation, assumed values). With $n$ bits, $2^n$ values are represented: $8$ bits give $256$ values, from $0$ to $255$ [1][2].
Repeated division by $2$ is performed and the remainders are read from the bottom: $45 = 22 \cdot 2 + 1$, $22 = 11 \cdot 2 + 0$, $11 = 5 \cdot 2 + 1$, $5 = 2 \cdot 2 + 1$, $2 = 1 \cdot 2 + 0$, $1 = 0 \cdot 2 + 1$, from which $101101_2$ (calculation).
Addition follows the rules $0+0=0$, $0+1=1$, $1+1=10$ (write $0$, carry $1$). For $13 = 1101_2$ and $11 = 1011_2$ the sum is $11000_2 = 24$ and the product, with additions and shifts, is $10001111_2 = 143$ (calculation).
In two's complement representation on $8$ bits, $-45$ is obtained by inverting the bits of $00101101$ and adding $1$: $11010011$ (calculation). Thus, addition between positives and negatives uses the same circuit.
The digits after the decimal point have weights $2^{-1}, 2^{-2}, \dots$. The number $0.1_{10}$ does not have a finite representation in base two, and for this reason in computers $0.1 + 0.2$ gives $0.30000000000000004$ (calculation): an example of rounding error (see the line on floating-point representation).
To read long strings of bits, they are grouped in $4$ (hexadecimal, see the dedicated line) or in $3$ (octal, see the dedicated line).
Memories and processors, error correction codes, Boolean logic (see the line on Boolean algebra), networks and cryptography (general observation).
Bit strings are long and difficult for a person to read. Precision is limited by the number of bits chosen, and overflow can occur in calculations.
[1] Wikipedia (it): Sistema numerico binario
[2] Wikipedia (en): Binary number
Generating summary…