Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Number System

What is a number system?


A number system in computing is a system of representing numbers in a digital format that can be
processed by a computer. It is a way of representing quantities and performing arithmetic operations on
them using a set of digits or symbols. The most commonly used number systems in computing are the
decimal system, which uses ten digits (0-9), and the binary system (base-2), which uses only two digits (0
and 1).
Other number systems used in computing include the octal system (base-8) and the hexadecimal system
(base-16). The choice of number system depends on the specific application and the type of hardware
being used.

Binary Number System Base-2 (0 and 1)


 The binary number system is a base-2 number system, meaning it uses only two digits, 0 and 1,
to represent numbers.
 Binary is the number system used by computers.
 It uses only two digits (0 and 1) to represent numbers.
 Each digit also has a place value, and the value of a number is determined by the sum of its digits
multiplied by their respective place values.
Example: the binary number 1011 has a value of (1 x 8) + (0 x 4) + (1 x 2) + (1 x 1) = 11 in decimal.

Decimal Number System Base-10(0 to 9)


 The decimal number system is a base-10 number system, meaning it uses ten digits, 0 to 9, to
represent numbers.
 Decimal is the number system most commonly used in everyday life.
 It uses ten digits (0-9) to represent numbers.
 Each digit has a place value, and the value of a number is determined by the sum of its digits
multiplied by their respective place values.
Example: the number 1234 in decimal has a value of (1 x 1000) + (2 x 100) + (3 x 10) + (4 x 1) = 1234.

Converting Binary to Decimal and Decimal to Binary


 The number systems we use in everyday life, such as decimal (base-10), are not the only ones in
existence.
 In computing, binary (base-2) is commonly used for representing and processing data.
 Converting between these two number systems is an important skill for anyone interested in
computing or data science.

Binary
 Binary is a base-2 number system, which means it has two digits (0 and 1) that represent different
values.
 Each digit in a binary number is called a bit.
 The place values in binary are powers of 2: 1, 2, 4, 8, 16, etc.
Examples of binary numbers: 1011 (eleven), 111010 (fifty-eight).

Decimal
 Decimal is a base-10 number system, which means it has ten digits (0-9) that represent different
values.
 Each digit in a decimal number is called a digit.
 The place values in decimal are powers of 10: 1, 10, 100, 1000, etc.
Examples of decimal numbers: 123, 4567.
Converting Binary to Decimal
 To convert a binary number to decimal, multiply each bit by its corresponding power of 2 and add
the results.
Example #1: Convert 1011 into decimal.

1. Write down the binary number 1011.


2. Write the powers of 2 (starting from the right)
2^3 = 8 | 2^2 = 4 | 2^1 = 2 | 2^0 = 1
3. Multiply each digit of the binary number by its corresponding power of 2, and write the result
below each power of 2. For 1011, this gives:
1 x 2^3 = 8
0 x 2^2 = 0
1 x 2^1 = 2
1 x 2^0 = 1
4. Add up all of the results from step 3.
For 1011, this gives: 8 + 0 + 2 + 1 = 11
5. Write the final answer. The decimal form of the binary number 1011 is 11.

Example #2: Convert 1101 into decimal.

2^3 = 8| 2^2 = 4| 2^1 = 2 | 2^0 = 1

1 x 2^3 = 8
1 x 2^2 = 4
0 x 2^1 = 0
1 x 2^0 = 1

8+4+0+1 = 13

The decimal form of the binary number 1101 is 13.

Example #3: Convert 11100 into decimal.

2^4 = 16 | 2^3 = 8 | 2^2 = 4 |2^1 = 2 | 2^0 = 1

1 x 2^4 = 16
1 x 2^3 = 8
1 x 2^2 = 4
0 x 2^1 = 0
0 x 2^0 = 0

16+8+4+0+0 = 28

The decimal form of the binary number 11100 is 28.


Example #4: Convert 1010101 into decimal.

2^5 = 32 | 2^4 = 16 | 2^3 = 8 | 2^2 = 4 |2^1 = 2 | 2^0 = 1

1 x 2^6 = 64
0 x 2^5 = 0
1 x 2^4 = 16
0 x 2^3 = 0
1 x 2^2 = 4
0 x 2^1 = 0
1 x 2^0 = 1

64+0+16+0+4+0+1 = 85

The decimal form of the binary number 1010101 is 85.

Converting Decimal to Binary


 To convert a decimal number to binary, repeatedly divide the number by 2 and record the
remainders (in reverse order).
Example #1: Convert 123 into binary
123 ÷ 2 = 61 remainder 1
61 ÷ 2 = 30 remainder 1
30 ÷ 2 = 15 remainder 0
15 ÷ 2 = 7 remainder 1
7÷2 =3 remainder 1
3÷2 =1 remainder 1
1÷2 =0 remainder 1
 List down in reverse order: The binary form of the decimal number 123 is 1111011

Example #2: Convert 4567 into binary


4567 ÷ 2 = 2283 remainder 1
2283 ÷ 2 = 1141 remainder 1
570 ÷ 2 = 285 remainder 0
285 ÷ 2 = 142 remainder 1
142 ÷ 2 = 71 remainder 0
71 ÷ 2 = 35 remainder 1
35 ÷ 2 = 17 remainder 1
17 ÷ 2 = 8 remainder 1
8÷2=4 remainder 0
4÷2=2 remainder 0
2÷2=1 remainder 0
1÷2=0 remainder 1
The binary form of the decimal number 4567 is 100011101011

Comparison and Applications


 Binary and decimal are two different number systems with unique features and uses.
 Binary is base-2 and uses only 2 digits, while decimal is base-10 and uses 10 digits.
 Conversion between binary and decimal is important for various applications, such as:
 Data storage and transmission (e.g., representing text, images, and other types of data as binary
numbers)
 Cryptography (e.g., encrypting and decrypting messages using binary operations)
 Computing and programming (e.g., working with binary code

You might also like