Menu
Log in

Computer Engineering Concepts

2.3 Binary, Octal, and Hexadecimal

The base two or the binary system is a number system that is based on two symbols, 1 and 0. In the binary system, each digit of a binary number is called a bit for short (binary digit). Using this system of numbers, all types of computations can be done just like the decimal system. Numbers can be added, subtracted, multiplied, divided, etc. This system of numbers is very useful in computing because it can be represented using electrical signals (on=1 and off=0). Everything within a computer is handled using this system of numbers. Information that is handled by the computer is converted to a representation in binary and then worked on by the computer in binary. The results obtained by the computer are then converted back to its initial form for output to the user. Though this process sounds like more work, it is an efficient method for the computer to operate with. The mathematics of general binary systems was first studied in detail by the Scottish mathematician George Boole in 1854, and his work is essentially the mathematical basis on which the computer operates today.

Base 8 (octal) and base 16 (hexadecimal) are also significant bases in the world of computers. They play an important role in computers as they take up far fewer number of digits to represent a number, when compared to the binary representation. Since the binary, octal, and hexadecimal bases are all exponents of 2, converting from binary to either octal or hexadecimal is a relatively quick and easy task. The compact representation and the ease of conversion are great advantages from a human perspective, as working with long binary numbers can be difficult. For example, a 20 bit binary number can be represented using 5 hexadecimal digits.

0100 1101 1100 0010 1111 = 4DC2F16

To convert quickly from binary to either octal or hexadecimal the base is first written as an exponent of 2. In the case of the octal base it is: 23. The binary digits are then grouped based on the exponent of the base, in this case the bits are grouped into sets of 3's, starting from the right. The value of each of these groups determines the digit of the number in the new base. Consider the following conversion example of a binary number being converted to octal.

              101011112 = 010  101  1112 = 2578                          [0102 =2, 1012 =5, 1112=7]

The validity of this method can be checked by first converting the binary number to decimal and then converting the decimal number to octal. The same process is applied to convert the number to hexadecimal, but in this case, the binary digits are grouped into sets of fours as shown.

              101011112 = 1010  1111 = AF16                              [10102 =10 =A16, 11112=15 =F16]

Now to convert the number from an octal or hexadecimal base to binary, the reverse of the previous process is used. Each digit is individually represented in binary and connected together to form the converted number as shown below.

62358 = 110 010 011 101= 1100100111012

BC16 = 1011 1100 = 10111100 2               

This conversion process works for any base that can be expressed as a power of two. Given the condensed format and the ease of conversion, the octal and hexadecimal bases are commonly used in the world of digital computing.


2.3 Practice Questions

1.     Express the following octal number in binary.

        a. 468                  b. 718                 c. 508    d. 1218               e. 2348

2.     Express the following hexadecimal numbers in binary.

        a. 13                   b. B1                   c. CE     d. D1F                 e. A2B

3.     Express the following binary numbers in base 4.

        a. 10012              b. 1001112         c. 100111012         d. 1100100012

4.     Express the following binary numbers in octal and hexadecimal bases.

        a. 10010112                                  b. 1001001112      

        c. 10111101001102                     d. 10010001111012

5.     Express the following hexadecimal numbers in octal.

        a. 24                   b. F3                   c. EA     d. EDA              

6.     Express the following octal numbers in hexadecimal.

        a. 458                  b. 378                  c. 7538  d. 52418                          

7.     Describe a quick method for converting base 3 number to base 9, and check the method’s validity by first converting the number to decimal and then to base 9.

8.     Use the method in question 7 to convert the following to base 9.

         a. 123                  b. 1213             c. 2203                    d. 11223


GlobalEduTech Solutions

Powered by Wild Apricot Membership Software