Binary is a base-2 number system that forms the foundation of all digital technology, including computers 💻. Instead of using ten digits (0-9) like the common decimal system (base-10), binary uses only two digits: 0 and 1.
This simple system works because it's easy to represent physically:
* 1 can represent an 'on' or 'true' state (like an electric current flowing).
* 0 can represent an 'off' or 'false' state (like no current flowing).
1. Terminology
* Bit: A single binary digit (0 or 1). This is the smallest unit of digital data.
* Byte: A sequence of eight bits. For example, 10110010. A byte is the standard unit for measuring data storage and memory.
\text{Bit} = 0 \text{ or } 1 \quad \rightarrow \quad \text{Byte} = 8 \text{ bits}
2. How Binary Counting Works
The key to understanding binary is recognizing the place values. In decimal, the place values are powers of ten (1, 10, 100, 1000, \dots). In binary, the place values are powers of two:
\dots, \quad 2^4 \quad (16), \quad 2^3 \quad (8), \quad 2^2 \quad (4), \quad 2^1 \quad (2), \quad 2^0 \quad (1)
To find the decimal equivalent of a binary number, you multiply the digit in each position by its corresponding power of two, and then sum the results.
Example: Converting Binary to Decimal
Let's convert the binary number 1011_2 to decimal (the subscript _2 indicates it's a base-2 number).
| Position | 2^3 (8) | 2^2 (4) | 2^1 (2) | 2^0 (1) |
|---|---|---|---|---|
| Digit | \mathbf{1} | \mathbf{0} | \mathbf{1} | \mathbf{1} |
| Value | 1 \times 8 | 0 \times 4 | 1 \times 2 | 1 \times 1 |
\text{Total} = (1 \times 8) + (0 \times 4) + (1 \times 2) + (1 \times 1)
\text{Total} = 8 + 0 + 2 + 1 = \mathbf{11}
So, 1011_2 is equal to 11_{10}.
Binary Counting Sequence
| Decimal | Binary | Calculation |
|---|---|---|
| 0 | 0 | 0 \times 1 = 0 |
| 1 | 1 | 1 \times 1 = 1 |
| 2 | 10 | (1 \times 2) + (0 \times 1) = 2 |
| 3 | 11 | (1 \times 2) + (1 \times 1) = 3 |
| 4 | 100 | (1 \times 4) + (0 \times 2) + (0 \times 1) = 4 |
| 5 | 101 | (1 \times 4) + (0 \times 2) + (1 \times 1) = 5 |
| 6 | 110 | (1 \times 4) + (1 \times 2) + (0 \times 1) = 6 |
| 7 | 111 | (1 \times 4) + (1 \times 2) + (1 \times 1) = 7 |
| 8 | 1000 | (1 \times 8) + \dots = 8 |
3. Converting Decimal to Binary
To convert a decimal number to binary, you use the repeated division by 2 method.
Example: Converting Decimal 13 to Binary
* Divide 13 by 2 and record the remainder:
13 \div 2 = 6 remainder \mathbf{1}
* Divide the quotient (6) by 2:
6 \div 2 = 3 remainder \mathbf{0}
* Divide the quotient (3) by 2:
3 \div 2 = 1 remainder \mathbf{1}
* Divide the quotient (1) by 2:
1 \div 2 = 0 remainder \mathbf{1} (Stop when the quotient is 0)
* Read the remainders from the bottom up: \mathbf{1101}
So, 13_{10} = 1101_2.
0 Comments