Download presentation
Presentation is loading. Please wait.
Published byMarshall Booth Modified over 9 years ago
2
Business Programming I Fall – 2000 By Jim Payne
3
Lecture 04Jim Payne - University of Tulsa2 Storage and Data
4
Lecture 04Jim Payne - University of Tulsa3 What do we store? Numbers 0,1,2,3, etc. Alphabetic Characters A,B,C, a,b,c Special Symbols * ( [ { ? / + : Pictures Sounds Motion Pictures
5
Lecture 04Jim Payne - University of Tulsa4 Numbering Systems Decimal Numbering System Hexadecimal Numbering System Octal Numbering System Binary Numbering System
6
Lecture 04Jim Payne - University of Tulsa5 Decimal Numbering System Uses 10 unique characters 0 1 2 3 4 5 6 7 8 9 We are very familiar with it For example: Is 1325 a large number? What does 1325 mean?
7
Lecture 04Jim Payne - University of Tulsa6 Here is what it means: If we built a number line for a decimal number, it would look like this: 10 4 10 3 10 2 10 1 10 0 100001000100101 1325
8
Lecture 04Jim Payne - University of Tulsa7 Let’s assume we did not know this. 10 4 10 3 10 2 10 1 10 0 100001000100101 1325/base 10 = 132 R 5 132/10 = 13 R 2 13/10 = 1 R 3 1/10 = 0 R 1 1325
9
Lecture 04Jim Payne - University of Tulsa8 To Check Our Answer: 110100100010000 10 0 10 1 10 2 10 3 10 4 1325 1*1000 = 1000 3*100 = 300 2*10 = 20 5*1 = 5 ------------------ Sum = 1325
10
Lecture 04Jim Payne - University of Tulsa9 Hexadecimal Numbering System Uses 16 unique characters 0 1 2 3 4 5 6 7 8 9 A B C D E F We are not familiar with it
11
Lecture 04Jim Payne - University of Tulsa10 Hexadecimal – 0 1 2 3 4 5 6 7 8 9 A B C D E F 16 4 16 3 16 2 16 1 16 0 655364096256161 1325/16 = 82 R D 82/16 = 5 R 2 5/16 = 0 R 5 5D2
12
Lecture 04Jim Payne - University of Tulsa11 To Check Our Answer: 116256409665536 16 0 16 1 16 2 16 3 16 4 52D 5*256 = 1280 2*16 = 32 D*1 = 13 ------------------ Sum = 1325
13
Lecture 04Jim Payne - University of Tulsa12 What have we learned? We just learned that 52D is the hexadecimal equivalent of the decimal number 1325. If 1325 is a large number of gold bars or a small amount of sand, then so is 52D to someone that grew up in the hexadecimal numbering system.
14
Lecture 04Jim Payne - University of Tulsa13 Octal Numbering System Uses 8 unique characters 0 1 2 3 4 5 6 7 We are not familiar with it
15
Lecture 04Jim Payne - University of Tulsa14 Octal – 0 1 2 3 4 5 6 7 8 4 8 3 8282 8 1 8 0 40965126481 1325/8 = 165 R 5 165/8 = 20 R 5 20/8 = 2 R 4 2/8 = 0 R 2 2455
16
Lecture 04Jim Payne - University of Tulsa15 To Check Our Answer: 18645124096 8 0 8181 8 2 8 3 8 4 2455 2*512 = 1024 4*64 = 256 5*8 = 40 5*1 = 5 ------------------ Sum = 1325
17
Lecture 04Jim Payne - University of Tulsa16 What have we learned? We have just learned, that 2455 is the octal equivalent of the hexadecimal 52D, which of course is the decimal equivalent of 1325. They are all the same NUMBER, just different numbering systems.
18
Lecture 04Jim Payne - University of Tulsa17 Binary Numbering System Uses 2 unique characters 0 1 We WILL become much more familiar with it
19
Lecture 04Jim Payne - University of Tulsa18 Binary - 0 1 1325/2 = 662 R 1662/2 = 331 R 0331/2 = 165 R 1 165/2 = 82 R 1 2 10 2929 2828 2727 2626 2525 2424 23232 2121 2020 10245122561286432168421 82/2 = 41 R 041/2 = 20 R 1 20/2 = 10 R 010/2 = 5 R 05/2 = 2 R 1 2/2 = 1 R 01/2 = 0 R 1 101 10100 10 1
20
Lecture 04Jim Payne - University of Tulsa19 To Check Our Answer: 2 10 2929 2828 2727 2626 2525 2424 23232 2121 2020 10245122561286432168421 10100101101 Notice – No Multiplication: 1024 + 256 + 32 + 8 + 4 + 1 = 1325
21
Lecture 04Jim Payne - University of Tulsa20 So,…. obviously,… 10100101101 is the binary equivalent of the octal 2455, the hexadecimal 52D, and the decimal 1325. You might not find the repetitive division process exciting, but you could all do it if you had to… So, obviously, any one of you could take any decimal number and convert it into it’s binary equivalent by a process of division by 2…. It turns out, that division by 2 is something a computer chip can do very very fast.
22
Lecture 04Jim Payne - University of Tulsa21 Let’s try a few new numbers: 2 10 2929 2828 2727 2626 2525 2424 23232 2121 2020 10245122561286432168421
23
Lecture 04Jim Payne - University of Tulsa22 2 3 2 2 1 2 0 8421 Let’s learn to count in binary…
24
Lecture 04Jim Payne - University of Tulsa23 2 2 1 2 0 8421 1101110010111011110001101110010111011110001 10011010101111001101111011111001101010111100110111101111
25
Lecture 04Jim Payne - University of Tulsa24 What is the Binary Equivalent of: 8 4 2 1 11 13 7 4 6 3 15 1011 1101 111 100 110 11 1111
26
Lecture 04Jim Payne - University of Tulsa25
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.