Presentation is loading. Please wait.

Presentation is loading. Please wait.

Number Systems – Definitions page 214 The radix or base 밑 refers to the number b in an expression of the form b n. The number n is called the exponent.

Similar presentations


Presentation on theme: "Number Systems – Definitions page 214 The radix or base 밑 refers to the number b in an expression of the form b n. The number n is called the exponent."— Presentation transcript:

1 Number Systems – Definitions page 214 The radix or base 밑 refers to the number b in an expression of the form b n. The number n is called the exponent 지수 and the expression is known formally as exponentiation of b by n or the exponential of n with base b. It is more commonly expressed as "the nth power of b", "b to the nth power" or "b to the power n". The term power 거듭제곱 strictly refers to the entire expression, but is sometimes used to refer to the exponent.

2 Representation of a number in a system with base (radix) N may only consist of digits that are less than N. If (1) M = a k N k + a k-1 N k-1 +... + a 1 N 1 + a 0 with 0 ≤ a i < N we have a representation of M in base N system and write M = (a k a k-1...a 0 ) N If we rewrite (1) as (2)M = a 0 + N·(a 1 + N·(a 2 + N·...)) the algorithm for obtaining coefficients a i becomes more obvious. For example, a 0 ≡ M (mod N) and a 1 ≡ (M/N) (mod N)

3 Place Value Decimal System 123.4567 Millions Hundred Thousands Ten Thousands Thousands Hundreds Tens Ones. Tenths Hundredths Thousandths Ten thousandths Hundred Thousandth Millionths Ten Millionths 10 6 10 5 10 4 10 3 10 2 10 1 10 0 10 -1 10 -2 10 -3 10 -4 10 -5 10 -6 10 -7 1002030.4 0.05 0.006 0.0007 100 203

4 Decimal Numbers Each digit in the decimal system we use everyday represents a number times a power of 10. 123.789 = 1*10 2 + 2*10 1 + 3*10 0 + 7*10 -1 + 8*10 -2 + 9*10 -3 = 100 + 20 + 3 + 0.7 + 0.08 + 0.009 We use the numbers 0  9 (10 numbers)

5 Place Value Binary 이진법 System sixteens eights fours twos ones. halves fourths eighths sixteenths 2424 23232 2121 2020 2 -1 2 -2 2 -3 2 -4

6 Binary Numbers Each digit in the binary system represents a number times a power of 2. 1011.01 2 We use the numbers 0  1 (2 numbers) We place a 2 as a subscript (lower number) to show it is a base other than base 10 or the decimal system. 1*2 3 + 0*2 2 + 1*2 1 + 1*2 0 + 0*2 -1 + 1*2 -2 8 + 0 + 2 + 1 + 0 + ¼ = 11.25 10 1011.01 2 = 11.25 10

7 Why Use Binary Numbers? For computers, binary numbers are great stuff because: They are simple to work with -- no big addition tables and multiplication tables to learn, just do the same things over and over, very fast. They just use two values of voltage, magnetism, or other signal, which makes the hardware easier to design and more noise resistant.

8 Computer Basis for Binary: Binary, base 2, is the way that computers "know" numbers, much as we know our numbers in base 10, also called decimal notation. Computers use binary because it correlates well with electronic switching: Off = 0, and On = 1. For example, if you have two light switches in your room you can demonstrate four numbers: Switch ASwitch BBinary No.Decimal No. Off 00 On11 Off102 On 113 Challenge questions: We can see that we can represent the numbers 0-3 (four numbers) with two switches. How many numbers do you think we can represent with three switches? What about four, or five?

9 Converting Decimal to Binary Let D= the number we wish to convert from decimal to binary Find P, such that 2^P is the largest power of two smaller than D. Repeat until P<0 If 2^P<=D then –put 1 into column P –subtract 2^P from D Else –put 0 into column P End if Subtract 1 from P

10 Example Now that we have an algorithm, we can use it to convert numbers from decimal to binary relatively painlessly. Let's try the number D=55. Our first step is to find P. We know that 2^4=16, 2^5=32, and 2^6=64. Therefore, P=5. 2^5<=55, so we put a 1 in the 2^5 column: 1-----. Subtracting 55-32 leaves us with 23. Subtracting 1 from P gives us 4. Following step 3 again, 2^4<=23, so we put a 1 in the 2^4 column: 11----. Next, subtract 16 from 23, to get 7. Subtract 1 from P gives us 3. 2^3>7, so we put a 0 in the 2^3 column: 110--- Next, subtract 1 from P, which gives us 2. 2^2<=7, so we put a 1 in the 2^2 column: 1101-- Subtract 4 from 7 to get 3. Subtract 1 from P to get 1. 2^1<=3, so we put a 1 in the 2^1 column: 11011- Subtract 2 from 3 to get 1. Subtract 1 from P to get 0. 2^0<=1, so we put a 1 in the 2^0 column: 110111 Subtract 1 from 1 to get 0. Subtract 1 from P to get -1. P is now less than zero, so we stop.

11 There are 2 methods: (A) Reverse of Binary-To-Digital Method 45 10 = 32 + 0 + 8 + 4 +0 + 1 = 2 5 +0+2 3 +2 2 +0+2 0 = 1 0 1 1 0 1 2 (B) Repeat Division This method uses repeated division by 2. Eg. convert 25 10 to binary

12 25 / 2= 12+ remainder of 11 (Least Important Digit) 12 / 2= 6 + remainder of 00 6 / 2= 3 + remainder of 00 3 / 2= 1 + remainder of 11 1 / 2= 0 + remainder of 11 (Most Important Digit) Result25 10 =1 1 0 0 1 2

13 Practice Converting Decimal to Binary page 219 Convert the decimal number to binary: 1.2 2.11 3.38 4.130 5.256 10 1011 100110 10000010 100000000

14 Adding Binary Numbers To add binary numbers just add the columns. If a sum equals 1 or 0 write it, it if equals 2, write a 0 and carry a 1. 1 0 1 1 + 1 0 0 1 1 0 1 0 0

15 Practice Adding Binary Numbers page 220 1.1 0 0 1 0 1 + 1 1 0 0 1 1 2.1 0 0 1 1 1 + 1 0 1 0 1 0 3.1 0 0 0 0 0 1 + 1 1 0 1 1 0 1 0 1 1 0 0 0 1 0 1 0 0 0 1 1 1 1 0 1 1 1

16 Subtracting Binary Numbers To subtract binary numbers just subtract the columns. To borrow, subtract one from a column and add 2 to the column to the right. 1 1 1 0 - 1 0 1 0 2 1 0 0 1

17 Practice Subtracting Binary Numbers page 221 1. 1 0 0 1 0 1 - 1 0 0 1 1 2.1 0 0 1 1 1 - 1 1 0 1 0 3.1 0 0 0 0 0 1 - 1 1 0 1 1 0 1 0 0 1 0 1 1 0 1 1 0 1 1

18 Multiplication is Simple 1 1 1 014 ● 1 0 1 ● 5 1 1 1 0 70 10 = 1000110 2 0 0 0 0 0 1 1 1 0 0 0 1 0 0 0 1 1 0

19 Practice page 222

20 Other Number Systems Binary-To-Octal / Octal-To-Binary Conversion Each Octal digit is represented by three bits of binary digit. Example 100 111 010 2 = (100) (111) (010) 2 = 472 8 The same methods as Decimal to Binary work – the two different processes

21 Binary-To-Hexadecimal / Hexadecimal-To-Binary Conversion Hexadecimal Digit01234567 Binary Equivalent00000001001000110100010101100111 Hexadecimal Digit89ABCDEF Binary Equivalent10001001101010111100110111101111

22 Decimal (10)Hexadecimal(16)Octal (8)Binary (2) 0000 1111 22210 33311 444100 555101 666110 777111 88101000 99111001 10A121010 11B131011 12C141100 13D151101 14E161110 15F171111

23 DecimalHexadecimalOctalBinary 16102010000 17112110001 18122210010 19132310011 20142410100 21152510101 22162610110 23172710111 24183011000 25193111001 261A3211010 271B3311011 281C3411100 291D3511101 311F3711111

24 Octal-To-Hexadecimal / Hexadecimal-To-Octal Conversion 1) Convert Octal (Hexadecimal) to Binary first. 2a) To Octal - Regroup the binary number in 3 bits a group starts from the LSD. 2b) Convert to Hexadecimal - Regroup the binary number in 4 bits a group from the LSD. (LSD = Least Significant Digit)

25 Practice page 228

26 10 17 31 33 68

27 Pages 223-225 1. 11101 27+2=29 =11101 2 2. 1100 7 + 5=12 =1100 2 3. 1100000 81+5=86 = 1100000 2 4. 10110110 175+7=182 =10110110 2 5. 11001 51 – 2 =49 =11001 2 6. 10010 23-5=18 =10010 2 7. 1000010 81-15=66 =1000010 2 8. 1101000 175-71=104 =1101000 2 9. 11000 12 x 2 =24 =11000 2 10. 1011111 19x5=95 =1011111 2

28 11. 100111011 45x7=315 =100111011 2 12. 101100101 21x17=357 =101100101 2 13. 1010 14. 10001 15. 11111 16. 100001 17. 1000100


Download ppt "Number Systems – Definitions page 214 The radix or base 밑 refers to the number b in an expression of the form b n. The number n is called the exponent."

Similar presentations


Ads by Google