Appendix B Number Systems 1281 (Geocities web hosting) B.3 Converting Octal
Appendix B Number Systems 1281 B.3 Converting Octal Numbers and Hexadecimal Numbers toBinary Numbers In the previous section, we saw how to convert binary numbers to their octal and hexadecimal equivalents by forming groups of binary digits and simply rewriting these groups as their equivalent octal digit values or hexadecimal digit values. This process may be used in reverse to produce the binary equivalent of a given octal or hexadecimal number. For example, the octal number 653 is converted to binary simply by writing the 6 as its 3-digit binary equivalent 110, the 5 as its 3-digit binary equivalent 101, and the 3 as its 3digit binary equivalent 011 to form the 9-digit binary number 110101011. The hexadecimal number FAD5 is converted to binary simply by writing the F as its 4-digit binary equivalent 1111, the A as its 4-digit binary equivalent 1010, the D as its 4digit binary equivalent 1101, and the 5 as its 4-digit binary equivalent 0101 to form the 16digit 1111101011010101. B.4 Converting from Binary, Octal or Hexadecimal to Decimal Because we are accustomed to working in decimal, it is often convenient to convert a binary, octal, or hexadecimal number to decimal to get a sense of what the number is really worth. Our diagrams in Section B.1 express the positional values in decimal. To convert a number to decimal from another base, multiply the decimal equivalent of each digit by its positional value, and sum these products. For example, the binary number 110101 is converted to decimal 53 as shown in Fig. B.8. To convert octal 7614 to decimal 3980, we use the same technique, this time using appropriate octal positional values as shown in Fig. B.9. Converting a binary number to decimal Positional values: 32 16 8 4 2 1 Symbol values: 1 1 0 1 0 1 Products: 1*32=32 1*16=16 0*8=0 1*4=4 0*2=0 1*1=1 Sum: = 32 + 16 + 0 + 4 + 0 + 1 = 53 Fig. B.8 Converting a binary number to decimal. Converting an octal number to decimal Positional values: 512 64 8 1 Symbol values: 7 6 1 4 Products 7*512=3584 6*64=384 1*8=8 4*1=4 Sum: = 3584 + 384 + 8 + 4 = 3980 Fig. B.9 Converting an octal number to decimal.
From our experience, we can recommend PHP Web Hosting services, if you need affordable webhost to host and run your web application.