Basic Computer Concepts Number Systems Concepts Deka Greek

Basic Computer Concepts Number Systems Concepts Ø “Deka” – Greek word denoting a value equal to ten Table 1: Decimal Example 2, 048 Digit Value Denotation Numeric. Value Denotation 2 thousands 1, 000 0 hundreds 100 4 tens 10 TABLE 2: The 8 value ones denotation of 1 a number “place” or position v Given a base-n number system, the value denotation of a position m is: m Value denotation 1 1 2 1 xn 3 1 xnxn 4 1 xnxnxn M 1 x n. . . x n (n multiplied M-1 times)0 Computer Organization

Basic Computer Concepts Number Systems Concepts Example A: Ø Finding the value of a number in any number system Given a base-n system and a number PQRST, the value is given by: Tx 1 +Sxn +Rxnxn +Qxnxnxn +Pxnxn Example B: Ø Given a base-8 system and a number 56472, the value is given by: Step 2 x 1 +7 x 8 +4 x 8 x 8 +6 x 8 x 8 x 8 +5 x 8 x 8 Total: 23, 866 Computer Organization Value 2 x 1= 2 7 x 8 = 56 4 x 64 = 256 6 x 512 = 3, 072 5 x 4, 096 = 20, 480

Basic Computer Concepts Number Systems Concepts TABLE 3: General method for obtaining the value denotation of a base-n numeral Value denotation Vm The value denotation of a position m in a base-n number system is: value denotation Vm = n (m-1) Decimal value N of a base-n numeral The decimal value N of a number pkpk-1 pk-2, . . , p 2 p 1 in a base-n number system is given by: numerical value N = i=1? i=k pi Vi = i=1 ? i=k pi n(i-1) Computer Organization

Basic Computer Concepts Number Systems Concept Examples: 1. Derive the decimal value of 6409 Solution: From Table 3: 6409 = 0 x 90 + 4 x 91 + 6 x 92 = 0 x 1+ 4 x 9+ 6 x 9 x 9 = 0 + 36 + 486 = 52210 2. Derive the decimal value of 64012 Solution: From Table 3: 64012 = 0 x 120 + 4 x 121 + 6 x 122 = 0 x 1 + 4 x 12 + 6 x 12 = 0 + 48 + 864 = 91210 Computer Organization

Basic Computer Concepts Number Systems Concept Using the notation of Table 3: 3. Derive the decimal value of 64016 Solution: From Table 3: 64016 = i=1? i=3 pi 16(i-1) = 0 x 160 + 4 X 161+ 6 X 162 Value = 0 + 64 + 1536 = 1600 Computer Organization

Basic Computer Concepts Hexadecimal, Octal, & Binary Systems 1. Derive the decimal value of 11012 Solution: 11012 = 1 x 20 + 0 x 21 + 1 x 22 + 1 x 23+ 1 x 24 + 0 x 25 + 1 x 26+ 1 x 27 Value = 1 + 0 + 4 + 8 + 16 + 0 + 64 + 128 = 22110 2. Derive the decimal value of 541760238 Solution: 541760238 = 3 x 80 + 2 x 81+ 0 x 82 + 6 x 83 + 7 x 84 + 1 x 85 + 4 x 86 + 5 x 87 Value = 3 + 16 + 0 + 3072 + 28672 + 32768 + 10485760 = 1159886710 Computer Organization

Basic Computer Concepts Hexadecimal, Octal, & Binary Systems 3. Derive the decimal value of 24 CF 16 Solution: 24 CF 16 = F x 160 + C x 161 + 4 x 162 + 2 x 163 Value = 15 + 192 + 1024 + 8192 = 94231010 Computer Organization

Basic Computer Concepts Converting: Decimal to Another Number System Ø Given a decimal number M, to convert to a number system with base - n: Ø As an example, let M = 2, 654 and n = 8 4 8 2 3 1 0 8 8 4, 096 512 64 8 1 0 5 - - - 4 3 8 8 4, 096 0 Computer Organization 1 2 0 8 8 8 512 64 8 1 5 1 - -

Basic Computer Concepts Converting: Decimal to Another Number System 4 3 2 1 8 8 8 8 8 4096 512 64 8 1 0 5 1 3 6 2, 65410 = 51368 Computer Organization 0 0

Basic Computer Concepts Converting: Decimal to Another Number System Derive the octal value of 10112 Solution: a. Convert 10112 to decimal: 10112 = 1 x 20 + 1 x 21 + 0 x 22 + 1 x 23 decimal value = 1 + 2 + 0 + 8 = 1110 b. Convert 1110 to octal: : 11/8 = 1 remainder 3 : 3/1 = 3 remainder 0 octal value = 138 Computer Organization

Basic Computer Concepts Converting: Decimal to Another Number System Shortcut Method Derive the octal value of 10112 Solution: Group the binary digits into three : 10112 = 10 111 0112 = 010 111 0112 421 Now 010= 2 421 111= 7 421 011 = 3 Therefore 010 111 0112 = 2738 Computer Organization

Basic Computer Concepts Converting: Decimal to Another Number System Shortcut Method Derive the hexadecimal value of 10112 Solution: Group the binary digits into four : 10112 = 10112 8 421 Now 1 0 1 1 = 11 8421 1 0 1 1= 11 But 1116 = B; therefore 10112 = BB 16 Computer Organization
- Slides: 12