1 / 41

CS 64 - KICKOFF

This is a kickoff session for CS 64 where Dr. Franklin will introduce the syllabus, basic concepts, and the importance of learning assembly language and digital design. The class information, grading policy, and tips for success will also be discussed.

Télécharger la présentation

CS 64 - KICKOFF

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CS 64 - KICKOFF Dr. Franklin

  2. Today’s Schedule • Why are you here? • Roll / Waiting List • Syllabus • Introduction • History • Basic concepts • Counting to 1023 on your fingers!

  3. Computer Systems • Coordination across many levels (layers) of abstraction Application (ex: browser) Operating Compiler System (Mac OSX) CS Software Assembler Hardware Processor Memory I/O system CE Datapath & Control Digital Design Circuit Design EE transistors

  4. Why learn assembly language? • Help you write faster programs • Understand the efficiency of different programming constructs • Assembly required for low-level programming (drivers) and performance-critical kernels Design Efficient Software

  5. Why learn digital design? • Processor design is one career of computer scientists • The building blocks determine • Power • Complexity • Functionality • Dispel the Magic! Design Efficient Hardware

  6. Where do programs come from? • Compilers • Translate high-level languages into a human readable version of the machine’s language (e.g. assembly language) • Assembler • Translate assembly language into a binary representation (object files) readable by the computer • Linkers • combine multiple object files into executable programs • Loaders • Loads the program into active memory to execute

  7. General Class Info • When, where and who • Lecture: Phelps 1425 (HERE!) • Lab: Fridays, phelps 3525 • Website: http://www.cs.ucsb.edu/~franklin/64/ • Professor: Diana Franklin, franklin@cs.ucsb.edu • TA: Weilong Cui, Asad Khalid • Office Hours: • Franklin: TR 2-3:15 • TA: M 1-2, W 2-3 • Assignments generally due on Wednesday

  8. General Class Info (2) • Prerequisites • Engineering 3 or CS 16; and Mathematics 3C • Not open if you have received credit for ECE 15A • Not required if you are in the CS BA major. • Textbooks • Randall Hyde: How to Write Great Code, Volume 1 (e-Book) • Robert L. Britton: MIPS Assembly Language Programming

  9. Grading Policy • Grading • Homeworks / Programs : 25-28% • Labs: 2-5% • MiniExams: 10% each • Midterm: 20% • Final: 35% • Plagiarism • You may discuss the design of programming assignments • You may not show or look at any assembly code other than buddy’s • Come to office hours!!! • Look at example code from class!!! • Ask questions on piazza! (no code) • Plagiarism will result in an F in the class and reporting to Judicial Affairs for further action. • Recording or selling course resources is strictly prohibited.

  10. Grading • Students should know where they stand • Individual tests and assignments curved • Reward the behaviors that lead to success w/out penalizing those who attain success other ways • Up to 2% extra credit for participation • Mini-exam portion dropped if it is lower than midterms/final (only entire segment, not individual mini-exams) • Attendance required for 4 labs. After that, it makes assignments worth less and labs worth more.

  11. Participation • 2% extra credit • How? • Ask or answer questions in lecture • Come to office hours with questions • Why? • I want to learn your names (letters of rec) • I want you to take an active role in your learning (because it leads to learning, not for my sake)

  12. Assignments • Released each Friday, due the following Thursday • Consists of • Questions directly related to book reading • Small assembly or C programming exercises • Digital design problems

  13. Discussion group • Piazza • join this week • Announcements will be made here • Do not post code or partial solutions EVER, even to ask for help as to what is wrong • Send those messages directly to me or the TA!

  14. How to Succeed in CS 64 • Skim the relevant book section(s) prior to class • Attend every lecture and complete all labs • Attempt to solve all in-class examples • Ask questions the instant you do not understand • Begin your programming assignments early • Study for all exams

  15. Waiting List • We have plenty of space. Sign up at the end of class with your name, then e-mail me so I can forward the e-mail to Benji. • If your friends want to add, they must attend Tuesday. No one is allowed to add if they didn’t attend today orTuesday.

  16. Answering your family and friends’ questions in a half-way intelligent manner Community Service Portion

  17. Where is computing going?

  18. Technology Trends: Memory Capacity (Single-Chip DRAM) • Now 1.4X/yr, or 2X every 2 years. • 8000X since 1980!

  19. Technology Trends: Microprocessor Complexity Itanium 2: 41 Million Athlon (K7): 22 Million Alpha 21264: 15 million PentiumPro: 5.5 million PowerPC 620: 6.9 million Alpha 21164: 9.3 million Sparc Ultra: 5.2 million Moore’s Law Moore’s Law 2X transistors/chip Every 1.5 years

  20. Moore’s Law 2X transistors/chip Every 1.5 years Technology Trends: Processor Performance 1.5X/yr year

  21. Technology Trends Summary • Technology trend • 2X every 2.0 years in memory size; every 1.0 year in disk capacity; every 1.5 years in processor complexity (Moore’s Law) More processors per chip each generation • Memory Gap / Memory Wall • Processors get faster • Memory gets denser / bigger, not faster

  22. The Architecture Walls • Memory Wall • ILP Wall • Power Wall

  23. The Architecture Walls • Memory Wall – Processor speed kept increasing, memory did not as quickly, so processor is often idle waiting for memory • ILP Wall – There are not enough independent instructions for the processor to get real work done when one instruction needs to wait for another (or memory or whatever) • Power Wall – Solving the above two walls requires too much power, and we don’t have cooling technology to dissipate that much heat.

  24. Beginning of the multi-core era • Multi-core chips • Place multiple processors on a single die • Because • They can communicate very quickly • Much higher potential throughput • Less power per area than accelerating single thread • But • You need parallel programs (or multiple programs) to exploit

  25. The next frontier • GPU – Graphics processing unit • Specialized hardware for graphics • Optimized to run the same thing on many pieces of data (i.e. pixels) • Because • They are mature technology, driven by gaming • Low power parallel processing • Bug • Limited programming model • Not appropriate for a lot of programs (i.e. servers)

  26. Representing Data • Everything 1’s and 0’s • Data (int, char, string, float) • Programs (instructions) • control • arithmetic • memory

  27. Let’s count to 1023 on our fingers!! • And then we’ll do something efficient with that knowledge

  28. How do we usually count on fingers? 1 1 1 1 1 1 1 1 1 1 Each finger has a value, and we add the values up!

  29. How do we usually count on fingers?Sometimes we count this way to make bigger numbersBut this doesn’t match how we usually do numbers 10 1 10 1 10 1 10 1 10 1 Each finger has a value, and we add the values up!

  30. How numbers usually work • What is the difference between: • 001 • 010 • 100 • Are they all the same number? • NO!!!!! • EVERY position is worth a different value!

  31. Counting to 1023 –Give a different set of values!All possible values from 0 – 1023! 128 4 64 8 256 2 512 1 32 16 Each finger has a value, and we add the values up!

  32. Beyond the parlor trick Using binary to accelerate our programs • Write out the decimal values of the following numbers: • 00101 • 01010 • 10100 • What can you conclude from this?

  33. Beyond the parlor trick Using binary to accelerate our programs • To multiply by 2, shift left by 1 • x = y << 1; • To divide by 2, shift right by 1 • x = y >> 1; • To multiply by 4, shift left by ? • To divide by 16, shift right by ?

  34. Beyond the parlor trick Using binary to accelerate our programs • Is this number odd or even? • 1011010010100101101 • What happens in this case? • 00101 >> 1 =? • Ah ha!!! Now we know why division rounds down!

  35. Bases • Octal – base 8 – digits 0-7 • Hexadecimal – base 16 – digits 0-9, a-f • What are the values of the different digits? • Decimal: 1, 10, 100, 1000, 10000, … • Binary: 1, 2, 4, 8, 16, 32, … • Octal: 1, 8, ??? • Hexadecimal: 1, 16, ???

  36. Bases • What are the decimal values of these numbers? • 0b1011 • 0o132 • 0x132 • Translate the decimal number 153 into hex, octal, binary • Translate the binary number 0b101001101110010100101 into octal, hex, decimal

  37. Negative Numbers • 2’s complement – simplest addition, subtraction implementation • All we need to know is the relationship between a positive number and its negative equivalent – the negate operation • To negate a number: • Flip all the bits • Add 1 • Works both directions – positive to negative and negative to positive • Let’s try it: 5 -> -5 -> 5, • What numbers are these? 1111, 1110, 1010, 1001, 1000 • unsigned representation value: • signed (2’s complement) representation value:

  38. You should: • Skim chapter 1, 2.1-2.7 • Memorize Page 26 • Read sections 2.3, 2.4

  39. Next topics • bitwise operators • addition • negative numbers / negation – sign-bit, 1’s complement, 2’s complement

  40. Goal: Inspect the bits of a number • Bitwise and, or, xor • AND: Both must be true for the result to be true (write truth table both ways) • 011010 & 101011 -> 001010 • Mask – inspect only a particular part of a number (i.e. the smallest bit to see if it is odd or even) • If we want to ignore a bit, and it with 0 • If we want to inspect a bit, and it with 1 • ABCDE & 00001 -> 0000E • if (ABCDE & 00001 == 0) • printf(“This is even\n”); • OR • XOR

  41. Goal: Inspect the bits of a number • Bitwise and, or, xor • OR: Both must be false for the result to be false • 011010 | 101011 -> 111011 • Mask – setting a particular bit to 1 • If we want to not change a bit, or it with 0 • If we want to set a bit to 1, or it with 1 • ABCDE I 00101 -> AB1D1 • To save space, you store many boolean values in one integer • This allows you direct access to a particular bit • if (variable & 00100 == 0) then something;

More Related