Binary, Octal and Hexadecimal for Programming & Computer Science by Sunil Tanna

Binary, Octal and Hexadecimal for Programming & Computer Science by Sunil Tanna

Author:Sunil Tanna [Tanna, Sunil]
Language: eng
Format: epub
Publisher: Answers 2000 Limited
Published: 2018-06-30T23:00:00+00:00


In the rest of this chapter, we will look at how to convert numbers from octal to denary and vice-versa, as well as how to convert from octal to binary and vice-versa (you will shortly discover that converting between octal and binary is very easy - and it is for this reason that octal is used by programmers and computer scientists). Before doing so, here is a table of the powers of 8, which correspond to the values of the columns in octal numbers:

How to convert an octal number to denary

Here are the steps for converting an octal number to denary:

(1) Start with the rightmost digit of the octal number and multiply it by 80 (that is 1).

(2) Now move to the second from right digit of the octal number and multiply it by 81 (that is 8). Add this to the running total from your previous step to get a new running total.

(3) Now move to the third from right digit of the octal number and multiply it by 82 (that is 64). Add this to the running total from your previous step to get a new running total.

(4) Continue repeating this process until you have processed all the digits of the octal number, each time using the next higher power of 8. The total at the end is the denary value of the octal number.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.