Appendix E Number Systems (on (Web hosting services) CD) 1357 Outline

Appendix E Number Systems (on CD) 1357 Outline E.1 Introduction E.2 Abbreviating Binary Numbers as Octal Numbers and Hexadecimal Numbers E.3 Converting Octal Numbers and Hexadecimal Numbers to Binary Numbers E.4 Converting from Binary, Octal, or Hexadecimal to Decimal E.5 Converting from Decimal to Binary, Octal, or Hexadecimal E.6 Negative Binary Numbers: Two s Complement Notation Summary Terminology Self-Review Exercises Answers to Self-Review Exercises Exercises E.1 Introduction In this appendix, we introduce the key number systems that Java programmers use, especially when they are working on software projects that require close interaction with machine-level 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 Java 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. 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 like Java 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. Each of these number systems uses positional notation each position in which a digit is written has a different positional value. For example, in the decimal number 937 (the 9, the 3, and the 7 are referred to as symbol values), we say that the 7 is written in the ones position, the 3 is written in the tens position, and the 9 is written in the hundreds position.
You want to have a cheap webhost for your apache application, then check apache web hosting services.

Leave a Reply