Upload
caroline-young
View
218
Download
0
Embed Size (px)
DESCRIPTION
Place Value Decimal System Millions Hundred Thousands Ten Thousands Thousands Hundreds Tens Ones. Tenths Hundredths Thousandths Ten thousandths Hundred Thousandth Millionths Ten Millionths
Citation preview
Number Systems – Definitionspage 214
The radix or base 밑 refers to the number b in an expression of the form bn.
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.
Representation of a number in a system with base (radix) N may only consist of digits that are less than N.
If(1) M = akNk + ak-1Nk-1 + ... + a1N1 + a0 with 0 ≤ ai
< N we have a representation of M in base N system and write
M = (akak-1...a0)N If we rewrite (1) as
(2) M = a0 + N·(a1 + N·(a2 + N·...)) the algorithm for obtaining coefficients ai becomes more obvious. For example,
a0 ≡ M (mod N) and a1 ≡ (M/N) (mod N)
Place Value Decimal System1 2 3 . 4 5 6 7
Millions
Hundred Thousands
Ten ThousandsThousandsH
undredsTensO
nes
.Tenths
Hundredths
Thousandths
Ten thousandths
Hundred Thousandth
Millionths
Ten Millionths
106 105 104 103 102 101 100 10-1 10-2 10-3 10-4 10-5 10-6 10-7
100 20 3 0.4 0.05 0.006 0.0007
100 20 3104
1005
10006
100007
Decimal Numbers
Each digit in the decimal system we use everyday represents a number times a power of 10.
123.789 = 1*102 + 2*101 + 3*100 + 7*10-1 + 8*10-2 + 9*10-3
= 100 + 20 + 3 + 0.7 + 0.08 + 0.009We use the numbers 0 9 (10 numbers)
Place Value Binary 이진법 System
sixteens
eights
fours
twos
ones
.halves
fourths
eighths
sixteenths
24 23 22 21 20 2-1 2-2 2-3 2-4
Binary NumbersEach digit in the binary system represents a
number times a power of 2.1011.012
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*23 + 0*22 + 1*21 + 1*20 + 0*2-1 + 1*2-2
8 + 0 + 2 + 1 + 0 + ¼ = 11.2510
1011.012 = 11.2510
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.
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 A Switch B Binary No. Decimal No.
Off Off 0 0
Off On 1 1
On Off 10 2
On On 11 3
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?
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
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.
There are 2 methods: (A) Reverse of Binary-To-Digital Method4510 = 32 + 0 + 8 + 4 +0 + 1 = 25+0+23+22+0+20= 1 0 1 1 0 12 (B) Repeat Division
This method uses repeated division by 2. Eg. convert 2510 to binary
25 / 2 = 12+ remainder of 1 1 (Least Important Digit)
12 / 2 = 6 + remainder of 0 0
6 / 2 = 3 + remainder of 0 0
3 / 2 = 1 + remainder of 1 1
1 / 2 = 0 + remainder of 1 1(Most Important Digit)
Result 2510 = 1 1 0 0 12
Practice Converting Decimal to Binarypage 219
Convert the decimal number to binary:1. 22. 113. 384. 1305. 256
101011
100110
10000010
100000000
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 11 0 1 0 0
Practice Adding Binary Numberspage 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
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
Practice Subtracting Binary Numberspage 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
Multiplication is Simple
1 1 1 0 14 ● 1 0 1 ● 5 1 1 1 0 7010 = 10001102
0 0 0 0 0 1 1 1 0 0 01 0 0 0 1 1 0
Practice page 222
Other Number Systems
Binary-To-Octal / Octal-To-Binary ConversionEach Octal digit is represented by three bits
of binary digit.Example100 111 0102 = (100) (111) (010)2 = 4728 The same methods as Decimal to Binary work –
the two different processes
Binary-To-Hexadecimal /Hexadecimal-To-Binary Conversion
Hexadecimal Digit 0 1 2 3 4 5 6 7
Binary Equivalent 0000 0001 0010 0011 0100 0101 0110 0111
Hexadecimal Digit 8 9 A B C D E F
Binary Equivalent 1000 1001 1010 1011 1100 1101 1110 1111
Decimal (10) Hexadecimal(16) Octal (8) Binary (2)
0 0 0 01 1 1 12 2 2 103 3 3 114 4 4 1005 5 5 1016 6 6 1107 7 7 1118 8 10 10009 9 11 100110 A 12 101011 B 13 101112 C 14 110013 D 15 110114 E 16 111015 F 17 1111
Decimal Hexadecimal Octal Binary
16 10 20 10000
17 11 21 10001
18 12 22 10010
19 13 23 10011
20 14 24 10100
21 15 25 10101
22 16 26 10110
23 17 27 10111
24 18 30 11000
25 19 31 11001
26 1A 32 11010
27 1B 33 11011
28 1C 34 11100
29 1D 35 11101
31 1F 37 11111
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)
Practice
• page 228
page 228
1017313368
Pages 223-2251. 11101 27+2=29 =111012
2. 1100 7 + 5=12 =11002
3. 1100000 81+5=86 = 11000002
4. 10110110 175+7=182 =101101102
5. 11001 51 – 2 =49 =110012
6. 10010 23-5=18 =100102
7. 1000010 81-15=66 =10000102
8. 1101000 175-71=104 =11010002
9. 11000 12 x 2 =24 =110002
10. 1011111 19x5=95 =10111112
11. 100111011 45x7=315 =1001110112
12. 101100101 21x17=357 =1011001012
13. 101014. 1000115. 1111116. 10000117. 1000100