1. Introduction to the Binary System
The binary system is a numeral system that uses only two digits: 0 and 1. Each digit in this system is called a "bit" (short for "binary digit").
System Base:
- Decimal (base 10): 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
- Binary (base 2): 0, 1
In binary, each position represents a power of 2, starting from the right:
- 20: 1
- 21: 2
- 22: 4
- 23: 8, etc.
2. Number Conversion
Decimal to Binary Conversion
To convert a decimal number to binary, divide the number by 2 and record the remainder. Repeat the process until the quotient is 0. The remainders read backward give the binary number.
Example: Convert 13 to binary
1. 13 ÷ 2 = 6, remainder 1
2. 6 ÷ 2 = 3, remainder 0
3. 3 ÷ 2 = 1, remainder 1
4. 1 ÷ 2 = 0, remainder 1
Reading the remainders backward, we get 1101. Therefore, 13 in binary is 1101.
Binary to Decimal Conversion
To convert a binary number to decimal, multiply each digit by the corresponding power of 2 and sum them up.
Example: Convert 1101 to decimal
1. 1 × 2^3 = 1 × 8 = 8
2. 1 × 2^2 = 1 × 4 = 4
3. 0 × 2^1 = 0 × 2 = 0
4. 1 × 2^0 = 1 × 1 = 1
Sum: 8 + 4 + 0 + 1 = 13. Therefore, 1101 in decimal is 13.
3. Binary Operations
Binary Addition
Binary addition follows these rules:
- 0 + 0 = 0
- 0 + 1 = 1
- 1 + 0 = 1
- 1 + 1 = 0 (carry 1)
Example:
1011
+ 1101
------
11000
Binary Subtraction
Binary subtraction follows these rules:
- 0 - 0 = 0
- 1 - 0 = 1
- 1 - 1 = 0
- 0 - 1 = 1 (borrow 1 from the next digit)
Example:
1010
- 0011
------
0111
Binary Multiplication
Binary multiplication follows the same rules as standard multiplication, shifting left each row for each multiplication by 1.
Example:
101
× 11
------
101 (101 × 1)
1010 (101 × 1 shifted one place left)
------
1111
Binary Division
Binary division is similar to decimal division, involving steps of subtraction and shifting.
Example: Divide 1010 (10 in decimal) by 10 (2 in decimal):
1010 ÷ 10 = 101 (10 ÷ 2 = 5 in decimal)
4. Applications of Binary
The binary system is essential in computing because computers use electronic circuits that have two states: on (1) and off (0). Here are some key applications:
- Data Storage: Data is stored in binary as bits and bytes.
- Data Transmission: Information is sent in the form of binary signals.
- Processors and Calculation: Arithmetic operations are performed in binary by processors.
5. Advanced Concepts
Bits and Bytes
Bit: A single binary digit (0 or 1).
Byte: A group of 8 bits. For example, the binary number 11010110 is a byte.
Hexadecimal System
The hexadecimal system (base 16) is often used in computing as a more compact form of binary representation. It uses the digits 0 to 9 and the letters A to F to represent the values 10 to 15.
Example: The binary 11010110 in hexadecimal is D6.