正在加载图片...
Section 2.2 Octal and Hexadecimal Numbers 23 In a binary number,the radix point is called the binary point.When dealing with binary point binary and other nondecimal numbers.we use a subscript to indicate the radix of each number,unless the radix is clear from the context.Examples of binary numbers and their decimal equivalents are given below. 100112=116+08+04+1-2+11=1o 1000102=1-32+016+0-8+0-4+1-2+01=340 101.0012=14+0:2+11+00.5+00.25+10.125=5.120 The leftmost bit of a binary number is called the high-order or most significant MS bit (MSB);the rightmost is the low-order or least significant bit (LSB). LSB 2.2 Octal and Hexadecimal Numbers Radix 10 is important because we use it in everyday business,and radix 2 is important because binary numbers can be processed directly by digital circuits. Numbers in other radices are not often processed directly,but may be important for documentation or other purposes.In particular,the radices8 and 16 provide convenient shorthand representations for multibit numbers in a digital system. The octal number system uses radix 8,while the hexadecimal number sys- octal number system em uses radix 16.Table 2-1 shows the binary integers fromto 1111 and their cimal number octal,decimal,and hexadecimal equivalents.The octal system needs8 digits,so it uses digits 0-7 of the decimal system.The hexadecimal system needs 16 dig- its,so it supplements decimal digits 09with the letters4-F. hexadecimal digit The octal and hexadecimal number systems are useful for representing multibit numbers because their radices are powers of 2.Since a string of three bits can take on eight different combinations.it follows that each 3-bit string can be uniquely sented by one octal digit,according to the third and fourth col- umns of Table 2-1.Likewise,a 4-bit string can be represented by one hexadecimal digit according to the fifth and sixth columns of the table. Thus,it is very easy to convert a binary number to octal.Starting at the binary point and working ef we simply separate the bits into groups of three and replace each group with the corresponding octal digit: 1000110011102=1000110011102=43168 111011011101010012=0111011011101010012=3556518 The procedure for binary to hexadecimal conversion is similar,except we use binary to hexadecimal groups of four bits: comersion 1000110011102=1000110011102=8CE16 111011011101010012=000111011011101010012=1DBA916 In these examples we have freely added zeroes on the left to make the total num- ber of bits a multiple of 3 or 4 as required. Copyright1999 by John F.Wakerly Copying ProhibitedSection 2.2 Octal and Hexadecimal Numbers 23 DO NOT COPY DO NOT COPY DO NOT COPY DO NOT COPY DO NOT COPY DO NOT COPY DO NOT COPY DO NOT COPY DO NOT COPY Copyright © 1999 by John F. Wakerly Copying Prohibited In a binary number, the radix point is called the binary point. When dealing with binary and other nondecimal numbers, we use a subscript to indicate the radix of each number, unless the radix is clear from the context. Examples of binary numbers and their decimal equivalents are given below. The leftmost bit of a binary number is called the high-order or most significant bit (MSB); the rightmost is the low-order or least significant bit (LSB). 2.2 Octal and Hexadecimal Numbers Radix 10 is important because we use it in everyday business, and radix 2 is important because binary numbers can be processed directly by digital circuits. Numbers in other radices are not often processed directly, but may be important for documentation or other purposes. In particular, the radices 8 and 16 provide convenient shorthand representations for multibit numbers in a digital system. The octal number system uses radix 8, while the hexadecimal number sys￾tem uses radix 16. Table 2-1 shows the binary integers from 0 to 1111 and their octal, decimal, and hexadecimal equivalents. The octal system needs 8 digits, so it uses digits 0–7 of the decimal system. The hexadecimal system needs 16 dig￾its, so it supplements decimal digits 0–9 with the letters A–F. The octal and hexadecimal number systems are useful for representing multibit numbers because their radices are powers of 2. Since a string of three bits can take on eight different combinations, it follows that each 3-bit string can be uniquely represented by one octal digit, according to the third and fourth col￾umns of Table 2-1. Likewise, a 4-bit string can be represented by one hexadecimal digit according to the fifth and sixth columns of the table. Thus, it is very easy to convert a binary number to octal. Starting at the binary point and working left, we simply separate the bits into groups of three and replace each group with the corresponding octal digit: The procedure for binary to hexadecimal conversion is similar, except we use groups of four bits: In these examples we have freely added zeroes on the left to make the total num￾ber of bits a multiple of 3 or 4 as required. 100112 = 1·16 + 0·8 + 0·4 + 1·2 + 1·1 = 1910 1000102 = 1·32 + 0·16 + 0·8 + 0·4 + 1·2 + 0·1 = 3410 101.0012 = 1·4 + 0·2 + 1·1 + 0·0.5 + 0·0.25 + 1·0.125 = 5.12510 1000110011102 = 100 011 001 1102 = 43168 111011011101010012 = 011 101 101 110 101 0012 = 3556518 1000110011102 = 1000 1100 11102 = 8CE16 111011011101010012 = 00011101 1011 1010 10012 = 1DBA916 binary point MSB LSB octal number system hexadecimal number system hexadecimal digits A–F binary to octal conversion binary to hexadecimal conversion
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有