You are on page 1of 8

PRESIDENT RAMON MAGSAYSAY STATE UNIVERSITY

FINAL PROJECT IN
INTRODUCTION TO COMPUTING

CONVERSION OF FOUR NUMBER SYSTEM:


BINARY, DECIMAL, OCTAL, AND
HEXADECIMAL

GROUP MEMBERS:
ARLANTICO, JULIA ANTONIA B.
MENDOZA, LEONCIO FEDERIC P.
NAVARRO, ISMAEL E.

INSTRUCTOR:
ENGR. MELOJEAN MARAVE LPT
Binary Number System
Binary is a base-2 number system invented by Gottfried Leibniz. This system is made up of only
two digits: 0 (zero) and 1 (one). This number system is the basis for all binary code.

The term binary also refers to any digital encoding/decoding system in which there are exactly
two possible states. The terms "low" and "high" are occasionally used to refer to the 0 and 1 values,
respectively, in digital memory, storage, processing, and communications.

In mathematics and in computing systems, a binary digit, or bit, is the smallest unit of data.
Every bit can only have one value, which is either 1 or 0. It cannot have any other value. Computers
can represent numbers using binary code in the form of digital 1s and 0s inside the Central
Processing Unit (CPU) and Random Access Memory (RAM). Inside the CPU or RAM, these digital
numbers represent electrical signals that are either on or off.

The importance of Binary number system is it is the foundation of all computer systems and
processes is the binary number system. Devices can store, retrieve, and work with any kind of data
that is sent to or received from the CPU or memory.

Decimal Number System


The decimal number system is also known as the base-10 numeral system. It uses ten
digits from 0 to 9. In the decimal number system, the positions continuos to the left of the decimal
point represents units, tens, hundreds, thousands, etc. Thus, the base of the decimal number system
is 10.

Binary to Decimal Conversion

The Binary to Decimal numbers conversion is converting the binary number into decimal
number. To convert the binary number to a decimal number, we need to use multiplication method.
If a number with base n has to be converted into a number with base 10, then each digit of the given
number is multiplied from the Most Significant Bit (MSB) to the Least Significant Bit (LSB) with
reducing the power of the base.
Binary to Decimal Table

4-bit Binary Decimal Numbers


Number
0000 0
0001 1
0010 2
0011 3
0100 4
0101 5
0110 6
0111 7
1000 8
1001 9
1010 10
1011 11
1100 12
1101 13
1110 14
1111 15

Step-by-step Process of Binary to Decimal Conversion:


1. Write the given binary number and count the powers of 2 from right to left (starting from 0).
2. Write each binary digit (right to left) with the corresponding powers of 2 from right to left, such
that first binary digit (MSB) will be multiplied with the greatest power of 2.
3. Add all the products.
4. The final answer is the converted value of binary to decimal number.

Base 25 24 23 22 21 20
Equivalent value of the power 32 16 8 4 2 1

Examples of Binary to Decimal Conversion:

1. Convert the binary number (110011)2 into a decimal number.

Solution: Multiply each digit from MSB to LSB with reducing the power of the base number 2.

(110011)2 = (1 × 2⁵) + (1 × 2⁴) + (0 × 2³) + (0 × 2²) + (1 × 2¹) + (1 × 2⁰)


= 32 + 16 + 2 + 1
(110011)2 = (51)10

2. Convert the binary number (1000011)2 into a decimal number.

Solution: Multiply each digit from MSB to LSB with reducing the power of the base number 2.

(1000011)2 = (1 × 26) + (0 × 2⁵) + (0 × 2⁴) + (0 × 2³) + (0 × 2²) + (1 × 2¹) + (1 × 2⁰)


= 64 + 2 + 1
(1000011)2 = (67)10

3. Convert the binary number (101010)2 into a decimal number.

Solution: Multiply each digit from MSB to LSB with reducing the power of the base number 2.

(101010)2 = (1 × 2⁵) + (0 × 2⁴) + (1 × 2³) + (0 × 2²) + (1 × 2¹) + (0× 2⁰)


= 32 + 8 + 2
(101010)2 = (42)10

Decimal to Binary Conversion

Binary numbers have a base of two, while decimal numbers have a base of ten. The base of
the number changes from base 10 to base 2 when converting from decimal to binary. There are
binary numbers that correspond to every decimal number. These binary numbers are primarily
utilized for coding or programming in computer applications. This is because computers are able to
communicate using binary, or the 0 and 1, digits.

There are two methods that can be used to solve the decimal to binary conversion. First is the
Subtraction method, and the other one is the Successive division method.

Step-by-step process of division method:


1. Divide the given decimal number by “2” where it gives the result along with the remainder.
2. If the given number is even, then the result will be whole and it gives the remainder “0”.
3. If the given decimal number is odd, then the result will have a remainder “1”.
4. By placing all the remainders in order in such a way, the LSB at the top and the MSB at the
bottom, the required binary number will be obtained.

Examples of Decimal to Binary Conversion:

1. Convert the decimal number (51)10 into a binary number.

Solution: Divide 51 by 2, and so on until the last number (1).

51/ 2 = 25.5 (let’s consider the .5 as the remainder 1).


51/2 = 25 remainder 1 (Least Significant Bit)
25/2 = 12 remainder 1
12/2 = 6 remainder 0
6/2 = 4 remainder 0
4/2 = 2 remainder 0
2/2 = 1 remainder 0
1/2 = 0 remainder 1 (Most Significant Bit)

Therefore, the equivalent for the given decimal number (51)10 is (100001)2.

(51)10 = (100001)2

2. Convert the decimal number (67)10 into a binary number.

Solution: Divide 67 by 2, and so on until the last number (1).

67/ 2 = 33 remainder 1 (Least Significant Bit)


33/ 2 = 16 remainder 1
16/ 2 = 8 remainder 0
8/ 2 = 4 remainder 0
4/ 2 = 2 remainder 0
2/ 2 = 1 remainder 0
1/ 2 = 0 remainder 1 (Most Significant Bit)

Therefore, the equivalent for the given decimal number (67)10 is (1000011)2.

(67)10 = (1000011)2

3. Convert the decimal number (42)10 into a binary number.

Solution: Divide 42 by 2, and so on until the last number (1).

42/ 2 = 21 remainder 0 (Least Significant Bit)


21/ 2 = 10 remainder 1
10/ 2 = 5 remainder 0
5/ 2 = 2 remainder 1
2/ 2 = 1 remainder 0
1/ 2 = 0 remainder 1 (Most Significant Bit)

Therefore, the equivalent for the given decimal number (42)10 is (101010)2.

(42)10 = (101010)2
Hexadecimal Number System

The hexadecimal number system is a type of number system, that has a base value equal to 16.
Hexadecimal numbers are represented by only 16 symbols. These symbols or values are 0, 1, 2, 3, 4,
5, 6, 7, 8, 9, A, B, C, D, E, and F. Hexadecimal number systems can be converted to other number
systems such as binary number, and decimal number.

Hexadecimal to Binary Table

Decimal Numbers 4-bit Binary Hexadecimal Number


Number
0 0000 0
1 0001 1
2 0010 2
3 0011 3
4 0100 4
5 0101 5
6 0110 6
7 0111 7
8 1000 8
9 1001 9
10 1010 A
11 1011 B
12 1100 C
13 1101 D
14 1110 E
15 1111 F

Binary to Hexadecimal conversion


Binary to hexadecimal conversion is a simple method to do. Put the values of the binary
number to the relevant hexadecimal number.

Step-by-step process of Binary to Hexadecimal conversion:


1. Separate the binary number in groups of four.
2. Convert the binary numbers into decimal value. (8, 4, 2, 1)
3. Multiply the binary numbers to the decimal value.
4. Add the product of the multiplied value of binary number and decimal value.
5. Convert the computed numbers to the hexadecimal values.

Examples of Binary to Hexadecimal conversion:

1. Convert the binary number (10110111)2 into hexadecimal number.

Solution: Group the binary into 4 values = 1011 0111

1011 = (1 * 23) + (0 * 22) + (1 * 21 ) + (1 * 20) 0111 = (0 * 23) + (1 * 22) + (1 * 21 ) + (1 * 20)


= 8+2+1 = 4+2+1
1011 = 11 0111 = 7
11 = B 7= 7

Therefore, the equivalent value of the binary number (10110111)2 to hexadecimal is (B7)16.
2. Convert the binary number (11001010)2 into hexadecimal number.

Solution: Group the binary into 4 values = 1110 1010

1110 = (1 * 23) + (1 * 22) + (1 * 21 ) + (0 * 20) 1010 = (1 * 23) + (0 * 22) + (1 * 21 ) + (0 * 20)


=8+4+2 =8+2
1110 = 14 1010 = 10
14 = E 10 = A

Therefore, the equivalent value of the binary number (11001010)2 to hexadecimal number is
(EA)16.

3. Convert the binary number (11110110)2 into hexadecimal number.

Solution: Group the binary into 4 values = 1111 0110

1111 = (1 * 23) + (1 * 22) + (1 * 21 ) + (1 * 20) 0110 = (0 * 23) + (1 * 22) + (1 * 21 ) + (0 * 20)


=8+4+2+1 =4+2
1111 = 15 0110 = 6
15 = F 6=6

Therefore, the equivalent value of the binary number (11110110)2 to hexadecimal number is (F6)16.

Hexadecimal to Binary Conversion


By converting hexadecimal number system to binary number system we can only use 4
digits to represent each hexadecimal number, where each group (nibbles) has a distinct value
0000 (for 0)and 1111 ( for F= 15= 8 + 4 + 2 + 1 ).

Step-by-step process of Hexadecimal to Binary conversion:


1. First, we need to convert the value of the hexadecimal number into decimal value.
2. Each number and letterin hexadecimal can be represented in a binary number in groups of 4.
3. Put 1, and 0 to the decimal value that is the sum of the hexadecimal number.

Examples for Hexadecimal to Binary conversion:

1. Convert the hexadecimal number (A9)16 into binary numbers.

Solution: Convert the A to its value in hexadecimal system = 10. 9 is equals to 9.

A= 10 9=9
=8421 =8421
A=1010 9=1001

Therefore, the equivalent value of hexadecimal number (A9)16 into binary number is (10101001)2.

Octal Number System

Octal number system has a base of eight and uses the numbers from 0 to 7. The octal
numbers, in the number system, are usually represented by binary numbers when they are
grouped in pairs of three.
Octal Number System Table

Octal Value Decimal Number Binary Equivalent


0 0 000
1 1 001
2 2 001
3 3 010
4 4 011
5 5 101
6 6 110
7 7 111

Binary to Octal Conversion

In binary to octal conversion, we learn to convert base 2 number system into bae 8 number
system. We need to convert binary to decimal, then decimal to the equivalent octal number
system.

Step-by-step process of Binary to Octal conversion:


1. Group the binary number with 3 values.
2. Multiply the binary digit to decimal values.
3. Add the products.
4. Merge the answers. (Ex. The answer are 4 and 5, the final is 45)

Examples of Binary to Octal conversion:

1. Convert the binary number (110101)2 into octal number.

Solution: separate the binary numbers into two group. = 110 101

110 = (1 * 22) + (1 * 21 ) + (0 * 20) 101 = (1 * 22) + (0 * 21 ) + (1 * 20)


=4+2+0 =4+1
=6 & =5

Therefore, the equivalent value of binary number (110101)2 to octal number is (65)8.

2. Convert the binary number (111110)2 into octal number.

Solution: group the binary numbers into three. = 111 110


111 = (1 * 22) + (1 * 21 ) + (1 * 20) 110 = (1 * 22) + (1 * 21 ) + (0 * 20)
=4+2+1 =4+2
=7 & =6

Therefore, the equivalent value of binary number (111110)2 to octal number is (76)8.
Octal to Binary conversion

In order to convert octal to binary number, we have to follow a few steps. Octal
numbers have base 8 and binary numbers have base 2. We can convert the octal number into
decimal and then convert the decimal number into its equivalent binary number.

Step-by-step process of Octal to Binary Conversion:


1. Separate the numbers.
2. Add the decimal numbers that is equals to the number.
3. Put 1 to the number that is used to sum up the number, and 0 to the number that is not
included in summing up the number.
4. Combine the answers per number and the final answer is the binary number.

Examples of Octal to Binary Conversion:

1. Convert the octal number (56)8 into binary number.

Solution: separate the 5 and 6.

5 = (22) (21 ) (20) 6 = (22) (21 ) (20)


= 4 2 1 = 4 2 1
5= 1 0 1 6 = 1 1 0

Therefore, the equivalent value of octal number (56)8 into binary number is (1011100)2.

2. Convert the octal number (35)8 into binary number.

Solution: separate the 3 and 5.

3 = (22) (21 ) (20) 5 = (22) (21 ) (20)


= 4 2 1 = 4 2 1
3= 0 1 1 5= 1 0 1

Therefore, the equivalent value of octal number (35)8 into binary number is (011101)2.

3. Convert the octal number (34)8 into binary number.

Solution: separate the 3 and 5.

3 = (22) (21 ) (20) 4= (22) (21 ) (20)


= 4 2 1 = 4 2 1
3= 0 1 1 4= 1 0 0

Therefore, the equivalent value of octal number (34)8 into binary number is (011100)2.

You might also like