2. People to Know Instructor Larry Herman Email: larry@cs.umd.edu Teaching Assistant Philip Dasler Email: daslerpc@cs.umd.edu
3. Things I Lied About / Need to Clarify You must use Eclipse as provided on the class website. You can’t use laptops in lecture. Closer to 80 students in lectures. Recommended books are just that. Also, they are all the same. Office hours will be in A.V. Williams 1112
4. More Administrivia Check for access to the grades server grades.cs.umd.edu Also, a link can be found on the class web page If you are officially registered for the course, you should have access. Grades server allows View scores View statistics Report an absence
6. Let’s Play a Game What was covered in lecture? Parts of a computer Bits, bytes, and words (0s and 1s) N bits can represent 2N values SI Prefixes (kilo, mega, kibibyte, mebi, etc.) ASCII Programming language types machine code assembly
7. An Aside Prefixes 1027 ?? 1024yotta1021zetta1018exa1015peta1012tera109giga106 mega103 kilo102hecto101deka
8. An Aside Prefixes 1027hella 1024yotta1021zetta1018exa1015peta1012tera109giga106 mega103 kilo102hecto101deka
14. Relearning How to Count 8 8 x 1 60 6 x 10 700 7 x 100 2,000 2 x 1000 + 30,000 3 x 10000 32,768
15. Relearning How to Count 8 8 x 100 60 6 x 101 700 7 x 102 2,000 2 x 103 + 30,000 3 x 104 32,768
16. Relearning How to Count 8 8 x 100 60 6 x 101 700 7 x 102 2,000 2 x 103 + 30,000 3 x 104 32,768 Base 10 (or radix 10)
17. Other Bases Can be done with any base number. Numbers in Base N are made of the digits in the range 0 to N-1 Base 10 numbers are made up of 0, 1, 2, . . . 8, 9 Examples Base 3 numbers use 0, 1, and 2 Base 6 numbers use 0, 1, 2, 3, 4, and 5 Base 8 numbers use 0, 1, 2, 3, 4, 5, 6, and 7
18. Other Bases - Example Notation: Xn means some number X in Base n Example: Convert 13924 from Base 4 to Base 10.
19. Other Bases - Example 22 x 40 369 x 41 48 3 x 42 + 64 1 x 43 15010 Base 4
22. Other Bases What is 2536 in Base 10? 10510 What is 1367 in Base 10?
23. Other Bases What is 2536 in Base 10? 10510 What is 1367 in Base 10? 7610
24. Other Bases What is 2536 in Base 10? 10510 What is 1367 in Base 10? 7610 What is 4235in Base 10?
25. Other Bases What is 2536 in Base 10? 10510 What is 1367 in Base 10? 7610 What is 4235in Base 10? 11310
26. Going The Other Way Do integer division by the base Record the remainder as the next smallest place Repeat on the result Example: convert 7610 into Base 7 7610 divided by 7 gives 10 the remainder is 6 __6 1010 divided by 7 gives 1 the remainder is 3 _36 110divided by 7 gives 0 the remainder is 1 136 7610 = 1367
27. Going The Other Way Do integer division by the base Record the remainder as the next smallest place Repeat on the result Example: convert 11310 into Base 5 11310 divided by 5 gives 22 the remainder is 3 __3 2210 divided by 5 gives 4 the remainder is 2 _23 410divided by 5 gives 0 the remainder is 4 423 11310 = 4235
30. Bringing It Back So what does this have to do with computers? Computers store everything as a series of 0s and 1s. This is actually just regular numbers in Base 2! What is 101010 in Base 10?
31. Some Common Terms Base 2, Binary Base 8, Octal Base 10, Decimal Base 16, Hexadecimal or Hex These are the most common bases used in computing.
33. Wait, Base 16? But there aren’t enough numbers! Hex uses the following digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F Thus, 4210 = 2A16
34. Easy Conversions We use binary, octal, and hex often because they are all powers of two. This allows for easy conversions by just translating digits.
35. Easy Conversions Octal is Base 8 Binary is Base 2 8 is just 23 Thus, for every three digits in binary we can directly translate to a single octal digit.
36. Easy Conversions Example: Convert 758 to binary. 78 is 111 in binary. 58 is 101 in binary. Thus, 758 = 1111012
37. Easy Conversions Works just as well for hex or backwards. Convert 1011111101112 to hex. 10112 is B in hex. 11112 is F in hex. 01112 is 7 in hex. Thus, 1011111101112 = BF716
39. Why Use Bases? Computers store information in two states: “charged” or “uncharged” These can easily be represented by 0s and 1s, making binary a convenient method for mathematical manipulation Hex is more compact and easily converts to and from binary 111111101110110111111010110011102 = FEEDFACE16