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 2009W2: Jan-Apr 2010 labs and tutorials start this week Tech Career Fair Chap


  1. University of British Columbia News Department of Computer Science Reading This Week Undergraduate Events CPSC 111, Intro to Computation Events this week 2009W2: Jan-Apr 2010 ■ labs and tutorials start this week Tech Career Fair ■ Chap 1: 1.3-1.8 Drop-In Resume Edition Date: Wed. Jan 13 Date: Mon. Jan 11 ■ Chap 2: 2.1-2.2, 2.5 Time: 10 am – 4 pm Tamara Munzner Time: 11 am – 2 pm Location: SUB Ballroom ■ my office hours: Mon 4-5, or by appointment Location: Rm 255, ICICS/CS ■ Chap 4: 4.1-4.2 Google Tech Talk Industry Panel ■ in X661 Date: Wed, Jan 13 Speakers: Managers from IBM, Time: 4 – 5 pm Microsoft, SAP, TELUS, Radical … Languages, Whitespace, Identifiers Location: DMP 110 ■ UBC CS news Date: Tues. Jan 12 Time: Panel: 5:15 – 6:15 pm IBM Info Session Networking: 6:15 – 7:15 pm Lecture 3, Mon Jan 11 2010 Date: Wed, Jan 13 Location: DMP 110 for panel, Time: 5:30 – 7 pm X-wing ugrad lounge for Location: Wesbrook 100 networking borrowing from slides by Kurt Eiselt, Wolfgang Heidrich, Alan Hu http://www.cs.ubc.ca/~tmm/courses/111-10 1 2 3 4 Review: Memory Review: Central Processing Unit Review: Computer Programming Review: Machine Language ■ Memory consists of a series of locations, each having a ■ CPU executes instructions in a continuous cycle ■ First programming languages: machine languages unique address, that are used to store programs and data. ■ Most primitive kind ■ known as the “fetch-decode-execute” cycle Input Devices Output Devices ■ When data is stored in a memory location, the data that was ■ CPU has dedicated memory locations known as registers previously stored there is overwritten and destroyed. ■ Sample machine language instruction ■ One register, the program counter , stores the address in ■ Register: special purpose memory location inside CPU ■ Each memory location stores one byte (or 8 bits) of data. memory of the next instruction to be executed Central Processing Unit where real computation occurs ■ Each bit is a 0 or a 1 Computer ■ More on this soon Program Memory 00000000001000100011000000100000 fetch add what’s to what’s and put it unimportant details for us Data values are 5802 in this in this in this stored in memory register register register 5803 10110101 10110101 locations – more Mass Storage Devices 5804 than one location 5805 may be used if the ■ Difficult to write programs this way 5806 execute decode data is large. 5807 ■ People created languages that were more readable Address 5 6 7 8 Review: Assembly Language Review: Binary vs. Decimal Numbers Aside – Other Bases Assembly Language ■ Next: assembly languages ■ decimal system numbers ■ The same principle works for other bases ■ Assembly language program converted into ■ have digits 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 corresponding machine language instructions by ■ Direct mappings of machine language instructions ■ For example, hexadecimal (base 16) ■ read from right to left: another program called an assembler into helpful mnemonics, abbreviations ■ uses digits 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F ■ ones (10 0 ), tens (10 1 ), hundreds (10 2 ), thousands (10 3 ), ... ■ Sample assembly language instruction ■ A-F correspond to values 10-15 ■ ex: 4763 means 3*10 0 +6*10 1 +7*10 2 +4*10 3 ■ Corresponds to machine language instructions ■ Example: ■ the exponents count up from 0 assembly language machine language ■ binary system numbers C350 assembler ■ have digits 0, 1 ■ Means: ■ still read from right to left: 0*16 0 + 5*16 1 + 3*16 2 + 12*16 3 add r1,r2,r6 add r1,r2,r6 ■ ones (2 0 ), twos (2 1 ), fours (2 2 ), eights (2 3 ), sixteens (2 4 ), ... = 5*16 + 3*256 + 12*4096 = 50,000 ■ ex: 10010111 means: 1*2 0 +1*2 1 +1*2 2 +0*2 3 +1*2 4 +0*2 5 +0*2 6 +1*2 7 00000000001000100011000000100000 00000000001000100011000000100000 = 1+2+4+16+128 = 151 add what’s to what’s and put it unimportant details for us add what’s to what’s and put it unimportant details for us in this in this in this in this in this in this register register register register register register 9 10 11 12 Assembly Language High-Level Language Java High-Level Language ■ Both machine and assembly languages pose big challenges ■ Next step: development of high-level languages ■ Java is the high-level language we’ll use. ■ Example of a high-level instruction for programmers ■ A = B + C ■ Modern, widely used, portable, safe. ■ Difficult to read and write ■ You may have heard of some ■ Fortran, COBOL, Lisp, BASIC, C, C++, C#, Ada, Perl, Java, ■ Tells computer to ■ Difficult to remember Python, Ruby, Javascript ■ Developed by Sun in early 1990s ■ go to main memory and find value stored in location called B ■ go to main memory and find value stored in location called C ■ Each instruction does very little ■ Originally intended for set-top boxes ■ High-level languages intended to be easier to use ■ add those two values together ■ Takes lots of instructions just to get something simple done ■ Retargeted for the Web ■ still a long way from English. ■ store result in memory in location called A ■ Every machine or assembly language good for only one type ■ A single high-level instruction gets more work done than a of computer machine or assembly language instruction. ■ Different to program IBM than Honeywell than Burroughs... ■ Most high-level languages can be used on different computers 13 14 15 16

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend