Back to: COMPUTER SCIENCE JSS2

**Welcome to Class !!**

*We are eager to have you join us !!*

*In today’s Computer Science class, We will be discussing Number Bases Conversion. We hope you enjoy the class!*

**NUMBER BASE Conversion: from Decimal to other Base System**

- Step 1 – divide the decimal number to be converted by the value of the new base.
- Step 2 – get the remainder from step 1 as the rightmost digit (least significant digit) of the base number.
- Step 3 – divide the quotient of the previous divide by the new base.
- Step 4 – record the remainder from step 3 as the next digit (to the left) of the new base number.

Repeat steps 3 and 4, getting remainders from right to left until the quotient becomes zero in step 3.

The last remainder obtained will be the most significant digit (MSD) of the new base number.

##### Decimal to Binary:

Example: Convert 15_{10} to binary.

Step | Operation | Result | Remainder |

Step 1 | 15/2 | 7 | 1 |

Step 2 | 7/2 | 3 | 1 |

Step 3 | 3/2 | 1 | 1 |

Step 4 | 1/2 | 0 | 1 |

As mentioned in steps 2 and 4, the remainders must be arranged in reverse order i.e. from bottom to top.

15_{10 }= 1111_{2}

##### Decimal to Octal:

Example: convert 385_{10} to octal.

Step | Operation | Result | Remainder |

Step 1 | 385/8 | 48 | 1 |

Step 2 | 48/8 | 6 | 0 |

Step 3 | 6/8 | 0 | 6 |

As mentioned in steps 2 and 4, the remainders must be arranged in reverse order i.e. from bottom to top.

385_{10} = 601_{8}

**NUMBER BASE Conversion:**** from other Base System to Decimal**

- Step 1 – determine the positional value of each digit. This depends on the position of the digit and the base of the number system.
- Step 2 – multiply the obtained values in step 1 by the digits in the corresponding position.
- Step 3 – sum the products calculated in step 2. This total is the equivalent value in decimal.

##### Binary to Decimal

For example: convert 223_{2} to base 10

223_{2 }= 2×2^{2} + 2×2^{1} + 3×2^{0}

= 2×4 + 2×2 + 3×1 = 8 + 4+3

= 15_{10}

##### Octal to Decimal

For example: convert 22 from octal to decimal.

22_{8}= 2×8^{1} + 2×8^{0 }= 2×8 + 2×0 = 16 + 2 = 18_{10} or 18.

*We have come to the end of this class. We do hope you enjoyed the class?*

*Should you have any further question, feel free to ask in the comment section below and trust us to respond as soon as possible.*

*In our next class, we will be talking about Units of Storage in Computer. We are very much eager to meet you there.*

**Pass WAEC, JAMB, POST-UTME & more in One Sitting for FREE!💃**