Computer Science JSS2
Week 7
Topic: CONVERSION OF NUMBER BASE SYSTEM
DECIMAL TO BINARY CONVERSION
To convert a decimal number to its binary equivalent, follow these five steps
Step 1 The decimal number is divided by 2 (base of binary number)
Step 2 The reminder is written in the one place
Step 3 the result is again divided by two
Step 4 its reminder is written in the next place to the left
The process is repeated until the number becomes zero
Example, to convert the decimal n
OPERATION | REMIANDER |
118÷ 2 = 59 | 0 |
59 ÷ 2 = 29 | 1 |
29 ÷ 2 = 14 | 1 |
14 ÷ 2 = 7 | 0 |
7 ÷ 2 = 3 | 1 |
3 ÷ 2 = 1 | 1 |
1 ÷ 2 = 1 | 1 |
Number 118 to its binary equivalent.
Writing the sequence of reminders from the button up given the binary number 1110110_{2}
BINARY TO DECIMAL CONVERSION
To convert a binary to decimal equivalent, follow the given steps
Step 1: Multiply each of the binary number with 2 to the power of 0, 1, 2, 3 e.t.c
Step 2: All the products of multiplication are added to get the decimal equivalent of the number
Example, to convert the binary number 11011 = 1 x 2^{5} + 1 x 2^{4} + 0 x 2^{3} + 1 x 2^{1} + 1 x 2^{0}
= 32 + 16 + 0 + 4 + 1
= 55
The decimal value of 110/11 is 55
DECIMAL TO OCTAL CONVERSION
To convert a decimal number into its octal equivalent, the same procedure is adopted as in the decimal to binary conversion, but here the decimal number is divided by the number 8
Example, to convert the decimal number 1510 to its octal equivalent.
8 | 15 REMAINDER |
8 | 1 7 |
0 1 |
The octal equivalent of 15 is 17
OCTAL TO DECIMAL CONVERSION
To convert an octal number to its decimal equivalent, the same procedures is used a in the binary to decimal conversion, but here the octal number is expressed as the sum of power of 8
Example, 56_{8} = (6 x 8^{1}) + (5 x 8^{0}) = (6 x 8) + (5 x 1) = 53_{10}
Therefore, the decimal value of 65_{8 }will be 53
OCTAL TO BINARY CONVERSION
To convert an octal number into its binary equivalent, each octal digit of the number is converted into its 3 bit binary equivalent.
For example, binary 000 is equivalent to octal digit 0, 111 is equivalent octal 7 and so on
Example (1574)_{8} = (00110111100)_{2}. The binary equivalent of 1572 is 001101111100
BINARY TO OCTAL CONVERSION
To convert a binary into its octal equivalent, see the following example:
Example 101100_{2} = 101100_{2} grouped = 54_{8}
HEXADECIMAL TO DECIMAL CONVERSION
To convert hexadecimal number into its decimal equivalent, the same procedure is used as in the binary into decimal conversion, but here the number is expressed as the sum of power 16.
If you are doing this conversion orally, it is easier to start backward because counting the number of digit takes extra time, you might count wrongly.
If you do not remember what particular value of a power 16 is, it is easier to calculate it from the previous power value. For instance, if you do not remember what the value of 16_{3} is, then just multiply the value of 16_{2} (which you are likely to already have, if you start backward)16.
Example (5FA8)_{16} = (24488)_{10}
The decimal equivalent of 5FA8 is 24488
5FA8 = 8 x 16^{0} + A x 16^{1} + F x 16^{2} + 5 x 16^{3}
= 8 x 1 + 10 x 16 + 15 x 256 + 5 x 4096
= 8 + 160 + 3840 + 20480
= 24488
Therefore, the decimal value of 5FA8 is 24488
DECIMAL TO HEXADECIMAL CONVERSION
To convert decimal to hexadecimal, follow the stops below
Step 1: divide the decimal number by 16; treat the division as an integer division
Step 2: write down thee remainder (in hexadecimal)
Step 3: divide the result by 16, treat the division as an integer division
Step 4: repeat step 2 and 3 until the result is 0
Step 5: the hexadecimal value is the digit sequence of remainder from the last to the first.
16 | 256 REMAINDER |
16 | 16 0 |
16 | 1 0 |
0 1 |
N.B A remainder in this topic refers to the left over value after performing an integer division
Example to convert the number decimal 256 to hexadecimal
For more class notes, visit: https://passnownow.com/classwork-support/
Leave A Comment