1. Trang chủ
  2. » Giáo án - Bài giảng

The architecture of computer hardware and systems software an information technology approach ch02

43 199 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 43
Dung lượng 635,5 KB

Nội dung

CHAPTER 2: Number Systems The Architecture of Computer Hardware and Systems Software: An Information Technology Approach 3rd Edition, Irv Englander John Wiley and Sons 2003 Why Binary?  Early computer design was decimal   John von Neumann proposed binary data processing (1945)    Mark I and ENIAC Simplified computer design Used for both instructions and data Natural relationship between on/off switches and calculation using Boolean logic Chapter Number Systems On Off True False Yes No 2-2 Counting and Arithmetic       Decimal or base 10 number system   Origin: counting on the fingers “Digit” from the Latin word digitus meaning “finger” Base: the number of different digits including zero in the number system  Example: Base 10 has 10 digits, through Binary or base Bit (binary digit): digits, and Octal or base 8: digits, through Hexadecimal or base 16: 16 digits, through F  Examples: 1010 = A16; 1110 = B16 Chapter Number Systems 2-3 Keeping Track of the Bits  Bits commonly stored and manipulated in groups    bits = byte bytes = word (in many systems) Number of bits used in calculations   Affects accuracy of results Limits size of numbers manipulated by the computer Chapter Number Systems 2-4 Numbers: Physical Representation   Different numerals, same number of oranges    Cave dweller: IIIII Roman: V Arabic: Different bases, same number of oranges    510 1012 123 Chapter Number Systems 2-5 Number System   Roman: position independent Modern: based on positional notation (place value)     Decimal system: system of positional notation based on powers of 10 Binary system: system of positional notation based powers of Octal system: system of positional notation based on powers of Hexadecimal system: system of positional notation based powers of 16 Chapter Number Systems 2-6 Positional Notation: Base 10 43 = x 101 + x 100 10’s place 1’s place Place 101 100 Value 10 x 10 x1 40 Evaluate Sum Chapter Number Systems 2-7 Positional Notation: Base 10 527 = x 102 + x 101 + x 100 100’s place 1’s place 10’s place Place 102 101 100 Value 100 10 x 100 x 10 x1 500 20 Evaluate Sum Chapter Number Systems 2-8 Positional Notation: Octal 6248 = 40410 64’s place 8’s place 1’s place Place 82 81 80 Value 64 Evaluate x 64 2x8 4x1 Sum for Base 10 384 16 Chapter Number Systems 2-9 Positional Notation: Hexadecimal 6,70416 = 26,37210 4,096’s place 256’s place 16’s place Place 163 162 161 160 Value 4,096 256 16 6x x 256 x 16 4x1 1,792 Evaluate 1’s place 4,096 Sum for Base 10 24,576 Chapter Number Systems 2-10 Binary Multiplication x 1 1 1 0 1 1 1 1 1 1 1 1 0 0 0 2’s place (bits shifted to line up with 2’s place of multiplier) 4’s place 32’s place 1 Result (AND) Note the at the end, since the 1’s place is not brought down Note: multiple carries are possible Chapter Number Systems 2-29 Converting from Base 10  Powers Table Power Base 256 128 64 32 16 512 64 16 16 Chapter Number Systems 32,768 4,096 65,536 4,096 256 2-30 From Base 10 to Base 4210 = 1010102 Power Base 2 64 32 16 1 1 Integer 42/32 =1 10/16 =0 10/8 =1 2/4 =0 2/2 =1 0/1 =0 Remainder 10 0 Chapter Number Systems 10 2-31 From Base 10 to Base Base 10 42 Quotient Remainde r ) 42 ( Least significant bit ) 21 ( ) 10 ( 2) 2) 2) Base Chapter Number Systems (1 (0 Most significant bit 101010 2-32 From Base 10 to Base 16 5,73510 = 166716 Power 65,536 4,096 256 16 1 6 Base 16 Integer 5,735 /4,096 =1 Remainder 5,735 - 4,096 1,639 –1,536 103 – 96 = 1,639 = 103 =7 Chapter Number Systems 1,639 / 256 =6 103 /16 =6 2-33 From Base 10 to Base 16 Base 10 5,735 Remainde r 16 ) 5,735 ( Least significant bit Quotient 16 ) 16 ) 16 ) 16 ) Base 16 358 ( 22 ( ( Most significant bit 1667 Chapter Number Systems 2-34 From Base 10 to Base 16 Base 10 8,039 Remainde r 16 ) 8,039 ( Least significant bit Quotient 16 ) 16 ) 16 ) 16 ) Base 16 502 ( 31 ( 15 ( Most significant bit 1F67 Chapter Number Systems 2-35 From Base to Base 10 72638 = 3,76310 Power Sum for Base 10 83 82 81 80 512 64 x7 x2 x6 x3 3,584 128 48 Chapter Number Systems 2-36 From Base to Base 10 72638 = 3,76310 x8 56 + = 58 x8 464 + = 470 x8 3760 + = 3,763 Chapter Number Systems 2-37 From Base 16 to Base  The nibble approach  Hex easier to read and write than binary Base 16 Base 0001  F 1111 0110 0111 Why hexadecimal?  Modern computer operating systems and networks present variety of troubleshooting data in hex format Chapter Number Systems 2-38 Fractions  Number point or radix point    Decimal point in base 10 Binary point in base No exact relationship between fractional numbers in different number bases  Exact conversion may be impossible Chapter Number Systems 2-39 Decimal Fractions  Move the number point one place to the right    Effect: multiplies the number by the base number Example: 139.010 139010 Move the number point one place to the left   Effect: divides the number by the base number Example: 139.010 Chapter Number Systems 13.910 2-40 Fractions: Base 10 and Base 258910 Place 10-1 10-2 10-3 10-4 Value 1/10 1/100 1/1000 1/10000 x 1/10 x 1/100 x 1/1000 x1/1000 05 008 0009 Evaluate Sum 1010112 = 0.67187510 Place 2-1 2-2 2-3 2-4 2-5 2-6 Value 1/2 1/4 1/8 1/16 1/32 1/64 x 1/2 x 1/4 1x 1/8 x 1/16 x 1/32 x 1/64 0.03125 0.015625 Evaluate Sum Chapter Number Systems 0.125 2-41 Fractions: Base 10 and Base  k k No general relationship between fractions of types 1/10 and 1/2    Therefore a number representable in base 10 may not be representable in base But: the converse is true: all fractions of the form 1/2 k can be represented in base 10 Fractional conversions from one base to another are stopped   If there is a rational solution or When the desired accuracy is attained Chapter Number Systems 2-42 Mixed Number Conversion   Integer and fraction parts must be converted separately Radix point: fixed reference for the conversion   Digit to the left is a unit digit in every base B0 is always regardless of the base Chapter Number Systems 2-43 ... stored and manipulated in groups    bits = byte bytes = word (in many systems) Number of bits used in calculations   Affects accuracy of results Limits size of numbers manipulated by the computer. .. Chapter Number Systems Range (0 and 1) 1,024 (1K) 65,536 (64K) 2-14 Base or Radix  Base:   The number of different symbols required to represent any given number The larger the base, the more numerals... Number Systems 1 1 1 1 0 0 1 2-24 Binary Arithmetic  Addition   Multiplication    Boolean using XOR and AND + AND Shift Division x Chapter Number Systems 1 10 0 2-25 Binary Arithmetic: Boolean

Ngày đăng: 10/01/2018, 16:23

TỪ KHÓA LIÊN QUAN

TÀI LIỆU CÙNG NGƯỜI DÙNG

TÀI LIỆU LIÊN QUAN