news
play

News Department of Computer Science Reading This Week - PowerPoint PPT Presentation

University of British Columbia News Department of Computer Science Reading This Week Undergraduate Events CPSC 111, Intro to Computation Events this week Drop-In Resume Edition Session 2009W2: Jan-Apr 2010 reminder: no class next time:


  1. University of British Columbia News Department of Computer Science Reading This Week Undergraduate Events CPSC 111, Intro to Computation Events this week Drop-In Resume Edition Session 2009W2: Jan-Apr 2010 ■ reminder: no class next time: this Friday Jan 8! ■ Ch 1.1 - 1.2: Computer Anatomy How to Prepare for the Tech Date: Mon. Jan 11 Career Fair Time: 11 am – 2 pm Date: Wed. Jan 6 Tamara Munzner Location: Rm 255, ICICS/CS Bldg Time: 5 – 6:30 pm ■ UBC CS news Location: DMP 110 Industry Panel Speakers: Managers from Google, Resume Writing Workshop (for IBM, Microsoft, TELUS, etc. non-coop students) Date: Tues. Jan 12 Date: Thurs. Jan 7 Hardware, Memory, Languages Time: Panel: 5:15 – 6:15 pm; Time: 12:30 – 2 pm Networking: 6:15 – 7:15 pm Location: DMP 201 Location: Panel: DMP 110; CSSS Movie Night Networking: X-wing Undergrad Lecture 2, Wed Jan 6 2010 Lounge Date: Thurs. Jan 7 Time: 6 – 10 pm Tech Career Fair Location: DMP 310 borrowing from slides by Kurt Eiselt, Wolfgang Heidrich, Date: Wed. Jan 13 Movies: “Up” & “The Hangover” (Free Popcorn & Time: 10 am – 4 pm Alan Hu Pop) Location: SUB Ballroom http://www.cs.ubc.ca/~tmm/courses/111-10 1 2 3 4 Recap: Procedures and Algorithms Why Being Precise/Stupid Isn’t Easy Correction / Recap: Prerequisites Recap: Processes, Procedures, and Programs ■ Mathematics 12 is the prerequisite ■ process: what happens when a computer follows a ■ human languages are very different from computer Here’s why we get frustrated when we start to learn languages: they’re ambiguous ■ or any math course at UBC procedure - it’s a procedure in execution to write programs to make computers do stuff: ■ humans bring huge amounts of knowledge to understanding ■ if you have not taken it you will be dropped from the course meaning of sentence ■ see CS advisors if you need prerequisite waived because of ■ procedure: collection of instructions in some An algorithm is ■ we apply it automatically and unconsciously equivalent work meaningful order that results in useful behavior on ■ many meanings per word ■ current stuff • a finite procedure ■ sentence structure behalf of the device that executes the instructions ■ you cannot get credit for both 111 and new 110 course • written in a fixed symbolic vocabulary ■ context of conversation ■ you cannot get credit for 101 if you take it after or concurrently • governed by precise instructions ■ how the world workd with 111 ■ program: when instructions are written in symbolic • moving in discrete steps, 1, 2, 3, ... ■ how language is used ■ you CAN get credit for 111 if you take it after 101! • whose execution requires no insight, cleverness, language that can be executed by a computer ■ you count on listener to disambiguate without even noticing intuition, intelligence, or perspicuity ■ we can get away with relatively short and imprecise sentences • and that sooner or later comes to an end We don’t have a lot of practice at being stupid! 5 6 7 8 Why Being Precise/Stupid Isn’t Easy Physical Hardware Computer Design Introduction to Computer Hardware ■ imagine a world where there is no ambiguity ■ “Computer science is how to harness the physical ■ it’s hard to figure out how to make things do ■ Objectives: world to help us think. ” - Alan Hu ■ that’s computer programming! computation ■ to identify and explain the purpose of core hardware components ■ all digital computers for over 50 years have had: ■ everyone starts out imprecise ■ to understand the way data is represented in ■ harnessing the physical world to help us think ■ same basic organization ■ everyone gets frustrated while learning this stuff memory ■ binary representation of data ■ how to get things that have computational behavior? ■ you are not alone ■ numerically addressed memory ■ technology dependent: ■ you can succeed at this ■ Understanding the hardware that runs our programs ■ sticks, gears, relays, vacuum tubes, transistors, ■ fetch-decode-execute operation cycle can help us understand the programs' behavior, DNA, ... especially when they misbehave. ■ how to control that behavior to do interesting things ■ we’ll only have a brief glance here 9 10 11 12 Computer Hardware Overview Computer Hardware Overview Binary Data Representation Memory ■ All programs and data on a computer are ■ Some of computer programming is resource management represented using only symbols 0 and 1 ■ As beginning programmers, the resource that you’ll be ■ This simple binary system is encoded in all of our concerned with most is memory digital hardware devices: ■ Most programming languages do a lot of the work for you ■ Magnetic disks: magnetic material can be polarized ■ More on this soon to one of two extremes (north or south) to represent a 0 or a 1. ■ Memory: each byte consists of 8 bits; each bit is a kind of electronic switch that is either off or on representing a 0 or a 1. 13 14 15 16

  2. Memory Memory Units of Memory Storage What Can Be Represented By A Byte? ■ Memory consists of a series of locations, each having a ■ 256 different characters from your keyboard unique address, that are used to store programs and data. ■ Java actually uses 2 bytes to represent a character We measure units of memory in terms of bytes: ■ how many characters is that? ■ When data is stored in a memory location, the data that was ■ 256 different shades of gray in a black and white image previously stored there is overwritten and destroyed. ■ Each memory location stores one byte (or 8 bits) of data. ■ 256 colors or shades of color in a color image Unit Symbol # of bytes ■ Each bit is a 0 or a 1 ■ More on this soon byte (8 bits) 2 0 = 1 ■ 256 frequencies or tones to be played through a speaker kilobyte KB 2 10 = 1024 Data values are 5802 stored in memory ■ 256 of anything that can be represented as discrete entities 5803 10110101 10110101 megabyte MB 2 20 = 1024 2 locations – more 5804 than one location gigabyte GB 2 30 = 1024 3 5805 may be used if the ■ part of an instruction for a computer 5806 data is large. terabyte TB 2 40 = 1024 4 5807 Address 17 18 19 20 Memory Mass storage/long-term memory Central processing unit Central processing unit ■ CPU executes instructions in a continuous cycle ■ known as the “fetch-decode-execute” cycle ■ CPU has dedicated memory locations known as registers ■ One register, the program counter , stores the address in memory of the next instruction to be executed fetch Macintosh SE in 1987 MacBook Pro in 2008 1 megabyte (MB) of memory 2 gigabytes (GB) of memory execute decode 1000 times more memory capacity in 20 years A disk drive without its protective case 1000 times greater processing speed Approximately the same price 21 22 23 24 Central processing unit Central processing unit Instructions Programming Languages ■ Implication of the fetch-decode-execute cycle ■ Objectives ■ we control the computer to make it do what we want Understand what is meant by computer ■ by giving it a sequence of little steps for it to do programming. ■ these steps are the instructions in a programming Understand the difference between ■ language machine/assembly language and a high-level computer language. Understand what compilers and interpreters are, ■ and why we use them. Write, compile, and run a simple Java program. ■ 25 26 27 28 What is Computer Programming? What is a Computer? What is a Computer? Computer Programming How is a computer different from a video game How is a computer different from a video game console? Or a DVD player? Or a telephone? Or a console? Or a DVD player? Or a telephone? Or a Input Devices Output Devices bank machine? bank machine? Central Processing Unit The computer is general . It can be all of the other Computer devices. Program Memory Making the computer do what we want is called Mass Storage Devices programming the computer. 29 30 31 32

Recommend


More recommend