Binary Number System: A Complete Reference
The binary number system is the language in which computers "think" and communicate. All information in digital devices (text, images, sounds, programs) is ultimately represented as a sequence of just two digits: 0 and 1. Understanding the binary system is a fundamental step in learning programming, computer networks, and computer architecture. This reference book explains the basics, rules for converting, and operations in the binary system in simple language.
What is the binary system?
The binary number system is a positional number system with a base of 2. This means:
- Numbers are written using only two digits: 0 and 1.
- The weight of each digit (place value) depends on its position in the number and is equal to a power of two.
Any number can be represented as the sum of the products of its digits and powers of the base system (in this case, two).
How do I convert a binary number to decimal?
To convert a binary number to the familiar decimal system, you need to sum the products of each binary digit by its corresponding power of two, starting from the right (from the least significant digit).
Algorithm:
- Number the digits of the binary number from right to left, starting with zero.
- Multiply each digit by 2 raised to the power equal to its digit number.
- Add the results.
Example: Let"s convert the number 1101 from binary to decimal.
| Place (right to left) | 3 | 2 | 1 | 0 |
| Power of two (2ⁿ) | 2³ | 2² | 2¹ | 2⁰ |
| Calculation | 1×2³ | 1×2² | 0×2¹ | 1×2⁰ |
| Result | 8 | 4 | 0 | 1 |
Sum: 8 + 4 + 0 + 1 = 13
Conclusion: The binary number 1101 is equal to the decimal number 13.
How to convert a decimal number to binary?
The conversion is done by successively dividing the decimal number by 2 and recording the remainder.
Algorithm:
- Divide the original decimal number by 2. Record the quotient and the remainder (0 or 1).
- Divide the resulting quotient by 2 again, again recording the remainder.
- Continue this process until the quotient equals 0.
- Write the resulting remainders in reverse order—this will be the desired binary number.
Example: Convert the number 19 from decimal to binary.
| Division | Quotient | Remainder |
| 19 ÷ 2 | 9 | 1 |
| 9 ÷ 2 | 4 | 1 |
| 4 ÷ 2 | 2 | 0 |
| 2 ÷ 2 | 1 | 0 |
| 1 ÷ 2 | 0 | 1 |
Writing the remainders from the bottom up: 10011
Output: The decimal number 19 is equal to the binary number 10011.
Table of Powers of Two and Binary Numbers
This table is your main assistant when working with the binary system.
| Power (n) | 2ⁿ (Decimal) | Binary Representation (2ⁿ) |
| 0 | 1 | 1 |
| 1 | 2 | 10 |
| 2 | 4 | 100 |
| 3 | 8 | 1000 |
| 4 | 16 | 10000 |
| 5 | 32 | 100000 |
| 6 | 64 | 1,000,000 |
| 7 | 128 | 10,000,000 |
| 8 | 256 | 100,000,000 |
Arithmetic in the Binary System
The rules for addition, subtraction, multiplication, and division are similar to those in the decimal system, but simpler.
Addition of Binary Numbers
| Addend A | Addend B | Sum | Carry |
| 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 1 |
Example:
1011 (11 decimal) +
0110 (6 decimal)
--------
10001 (17 decimal)
Multiplication of Binary Numbers
Multiplication is performed the same way as in the decimal system: partial products are formed and then summed.
Example: ``txt 101 (5 decimal) × 011 (3 decimal)
101 1010 +00000
1111 (15 decimal) ```
Practical Applications of the Binary System
- Computer Memory: Bits (0 and 1) are the smallest unit of information. A byte = 8 bits.
- Colors in graphics: Pixel color is often encoded in binary numbers (for example, in the RGB model).
- Logical operations: The processor is based on logic gates (AND, OR, NOT) that operate on binary signals.
- Network protocols: Data transmission over a network also occurs in binary form.
Conclusion: The binary system is not an abstract concept, but a real tool that underlies all digital technology. By mastering it, you gain the key to understanding how the technological world around us works.