1276 Number Systems Appendix B Outline B.1 Introduction (Web site design and hosting)

1276 Number Systems Appendix B Outline B.1 Introduction B.2 Abbreviating Binary Numbers as Octal Numbers and Hexadecimal Numbers B.3 Converting Octal Numbers and Hexadecimal Numbers to Binary Numbers B.4 Converting from Binary, Octal or Hexadecimal to Decimal B.5 Converting from Decimal to Binary, Octal, or Hexadecimal B.6 Negative Binary Numbers: Two s Complement Notation Summary Terminology Self-Review Exercises Answers to Self-Review Exercises Exercises B.1 Introduction In this appendix, we introduce the key number systems that programmers use, especially when they are working on software projects that require close interaction with machinelevel hardware. Projects like this include operating systems, computer networking software, compilers, database systems, and applications requiring high performance. When we write an integer such as 227 or 63 in a program, the number is assumed to be in the decimal (base 10) number system. The digits in the decimal number system are 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. The lowest digit is 0 and the highest digit is 9 one less than the base of 10. Internally, computers use the binary (base 2) number system. The binary number system has only two digits, namely 0 and 1. Its lowest digit is 0 and its highest digit is 1 one less than the base of 2. Fig. B.1 summarizes the digits used in the binary, octal, decimal and hexadecimal number systems. As we will see, binary numbers tend to be much longer than their decimal equivalents. Programmers who work in assembly languages and in high-level languages that enable programmers to reach down to the machine level, find it cumbersome to work with binary numbers. So two other number systems the octal number system (base 8) and the hexadecimal number system (base 16) are popular primarily because they make it convenient to abbreviate binary numbers. In the octal number system, the digits range from 0 to 7. Because both the binary number system and the octal number system have fewer digits than the decimal number system, their digits are the same as the corresponding digits in decimal. The hexadecimal number system poses a problem because it requires sixteen digits a lowest digit of 0 and a highest digit with a value equivalent to decimal 15 (one less than the base of 16). By convention, we use the letters A through F to represent the hexadecimal digits corresponding to decimal values 10 through 15. Thus in hexadecimal we can have numbers like 876 consisting solely of decimal-like digits, numbers like 8A55F consisting of digits and letters, and numbers like FFE consisting solely of letters. Occasionally, a hexadecimal number spells a common word such as FACE or FEED this can appear strange to programmers accustomed to working with numbers. Fig. B.2 summarizes each of the number systems.
Note: In case you are looking for affordable and reliable webhost to host and run your j2ee application check Vision J2ee Web Hosting services.

Leave a Reply