ࡱ> rtq5@ )bjbj22 "dXXN!.+h&h&h&8&d'z:2''4''' + + +9999999$;R=x: +s* + + +:''4: . . . +Xl''9 . +9 .P .[.V36`,?7'' @εh&e+f6 84J:0z:6xv>[,??7?7J?7< + + . + + + + +::$D -($CORE 5.1 NOTES Lecture 1: Intro - what is CS? algorithms, programs What is a computer? A computer as a device that receives, stores, and processes information. A computer is a machine capable of following the instructions of a program. A program is a set of instructions. Computer Organization: Hardware The underlying structure of a computer is known as the von Neumann architecture (named from computers science pioneer john von Neumann, who formalized his method of computer organization in the early 1950s). The von Neumann architecture identifies three essential components that work together to function as a computer. I Central Processing Unit (CPU) Coordinates the operation of the other sections of the computer. brain of the computer. 2 tasks fetching program instructions from memory executing those instructions not complex broken down into simple instructions, such as add two numbers copy a value from one location to another CPUs process instruction sequences extremely quickly which enables the processors to handle these immense programs. CPU speed is generally measured in gigahertz (GHz), which indicates how many billions of instructions a CPU can execute in a second. Ex. 1.8 GHz CPU can execute approximately 1.8 billion simple instructions in a second CPU speed gets faster and faster each year in PCs. New software applications often require the fastest available CPUs, so sometimes its not possible to run new software on an old computer. Unfortunately there is little you can do to speed up an old CPU. Thats why there is little demand for used computers, unless they are relatively new. (my laptop Inspiron 600m Pentium M Processor 745(1.80 GHz/400MHz FSB) 14.1-in XGA w/32MB VideoB18MG3N[221-7886]Memory512MB DDR SDRAM 2 Dimms512MB2D[311-1885]Hard Drive40GB Hard Drive40GB[340-8046]Operating SystemMicrosoft Windows XP Home) II Memory The memory is the part of a computer that stores programs and data. Modern computers are digital devices - they store and process information as binary digits, or bits. Bits are the building blocks of digital memory; usually, the two possible values of a bit are written as 0 and 1, but the values could just as easily be represented as off and on. RAM Random Access Memory The memory that the CPU uses when it executes its machine instructions. Its fast memory because the CPU can write to and read from it very quickly. RAM is volatile, when you turn off your computer data is lost. RAM is considered human short-term memory. Each program you run on your computer requires some minimal amount of RAM. Your computer allocates a fixed amount of its available RAM to each program. If the programs require more than is available, the OS needs to use various memory management strategies, which may or may not work very well. You computer might respond very slowly when it is working with less RAM than it needs. Buy as much RAM as you can afford. Long-Term Storage Modern computers contain large hard drives capable of saving all the files your computer needs as well as any data files you create for your personal use. Whereas data in Ram disappears when the power goes off, data saved on the hard drive is stable. The hard drive can be used to save, computer programs, word processing files, spreadsheet data, etc. The larger your hard drive, the more files you can save and the more programs you can store on your computer. A lot of RAM can help your computer run faster, but a large hard drive allows you to install more applications such as office programs and games. Examples of inexpensive secondary memory: Floppy disks and CDs. A floppy disk is a smaller, portable version of a hard disk, capable of storing up to 1.44 MB of data on a 3.5-inch plastic disk. A CD (Compact Disk) is a metal disk that stores up to 700 MB of data as patterns on its reflective surface. Primary memorySecondaryTemporary, volatilePermanent, nonvolatileRapid accessSlower access (1/0)Low capacityHigh capacityHigh costLow cost III Input/Output Devices Input devices allow the computer to receive data and instructions from an external source, such as a person entering commands at a keyboard. Ex. keyboard, mouse, microphones, CD-ROM drive Output devices allow the computer to display or broadcast its results. Examples. Monitor, printer, speaker, CD-Writer Computer Organization: Software Program - A set of instructions that determines a computer's action. Software A program or a collection of programs that are not 'built-into the hardware. Application Software - software designed to carry out tasks such as word processing, graphical design, or web access. Ex. word processors such as Microsoft Word contain instructions for creating and managing documents. Graphics programs such as Adobe Photoshop contain instructions for creating and displaying graphical images, and Web browsers such as Microsoft Internet Explorer and Netscape Navigator contain instructions for accessing and displaying Web pages. Operating System The heart of any computer. Starts when you turn on the computer. examples Microsoft Windows. Unix, Linux, and Apple are other examples. Controls how the CPU, memory, and I/O devise work together to execute programs. The Operating System is necessary for application programs to run. Ex. a Personal Computer user might perform several tasks simultaneously (downloading mail, viewing a web page, listing to music). By switching control of the CPU back and forth between active programs at a very fast rate the OS can produce the appearance of simultaneous execution. The OS also manages the computers memory, organizing storage into files and directories. The OS keeps track of where individual files are stored so that they can be accessed when needed. The operating system connects the CPU and memory with the computers other hardware components. This allows a program to receive input from a keyboard, fetch data from a hard drive, display results on a screen, and even print the results to a laser printer. To make interacting easier most operating systems (including Microsoft Windows, Mac OS, and Linux provide a graphical user interfact (GUI). GUI uses visual elements to simplify the process of viewing files and executing programs. Programming Language - A language with which programs are written. First generation  Machine Language The "language" that the computer actually understands. (strings of 1s and 0s) Second generation  Assembly Languages A low-level programming language. Use Englishlike abbreviations to represent the machinelanguage instructions LOAD BASEPAY ADD OVERPAY STORE GROSSPAY Third generation  Compiler Languages Highlevel, machine independent, more Englishlike, more natural. Each high-level language statement translates to several low-level language statements. Use compilers to translate from the highlevel language into machine language. Compilers translate the whole program first, then execute the object program. E.g., GROSSPAY = BASEPAY + OVERPAY High-level languages are more English-like, easier to code, more costly to run, less flexible. e.g., C, C+ + , Java, JavaScript , Pascal, Visual Basic, ...: High-level programming languages. Compiler: Software that translates programs written in high-level languages into machine language.   Ex. Of application software (source program) that can be written in any of the language above: Registration system in BC. First we will keep all information in two tables: The first is a students table that has students addresses, courses taken or registered for and grades. The second is a course database that has the course number, hours, number enrolled and enrollment limit. Enter all courses that will be offered this semester If a new student comes to register enter name into student database For each course a student wants to take If the course is not full, in the course table increment the number enrolled and in the student table enter the course number for that student. If the course is full inform the student that they would need an overtally. Registration algorithm can be written in any of the programming languages mentioned before. The software life cycle: To clearly specify the problem in English, code it in computer language, run the program, fix errors that come up (bugs) and do long-term maintenance. PAGE  PAGE 5  FILENAME CORE511a compiler source program object program EGZ\]^     7 ? B ɺ}oaoaS}D5h2O5CJOJQJ^JaJh8F5CJOJQJ^JaJho"CJOJQJ^JaJhsvCJOJQJ^JaJhD1CJOJQJ^JaJh2OCJOJQJ^JaJ#h2Oh2O5CJOJQJ^JaJ hD1h2Oht#htht5CJOJQJ^JaJhd5CJOJQJ^JaJ#htThtT5CJOJQJ^JaJ#htTh,\5CJOJQJ^JaJ#htTh 5CJOJQJ^JaJFG]   7  8 U gd%-`gd%- & Fgdad9 7$8$H$gd4gdtdgdD1gddN)|))B y    . D F # ɸส~l^XO^A^A^A^h%-CJOJQJ^JaJh4h4CJ h4CJhad9CJOJQJ^JaJ#h= had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Fgd8FdgdUcgdY=%%%&&&4(S((((((((I)M)N)O)U)V)W)Y)Z)`)ǶzveTJDJD@JDho" ho"0Jjho"0JU h<h8FCJOJQJ^JaJ h-=hUcCJOJQJ^JaJhUch-=hUcCJaJh-=hUc>*CJaJhUc>*CJaJhUcCJOJQJ^JaJh8FCJOJQJ^JaJ h~Wh8FCJOJQJ^JaJh8FCJOJQJ^JaJhUch8F>*CJaJh1,CJOJQJ^JaJ h-=h8FCJOJQJ^JaJN)W)X)Y)d)z){)|)))))))))$a$gdY=h]hgdmG &`#$gdmG`)a)b)c)d)e)o)p)x)y){)|))))))))))ƾغ h<h8FCJOJQJ^JaJh[ghXihY=5 hY=5h1,ho"mHnHuho"jho"U ho"0Jh1,0JmHnHujho"0JU 1h/ =!"#$%Dd,  c Anuu'USVu WjFuEܝ03E WWj6vPpNjSeT3"<!-- D(["mb","</font></td><td width=\"45%\" bgcolor=\"#E7E7E7\"><font face=\"Arial\" size=\"1\">Pentium M Processor 745(1.80 GHz/400MHz FSB) 14.1-in XGA w/32MB Video<br></font></td><td width=\"10%\" align=\"right\" bgcolor=\"#E7E7E7\"><font face=\"Arial\" size=\"1\">B18MG3N<br></font></td><td align=\"right\" width=\"15%\" bgcolor=\"#E7E7E7\"><font face=\"Arial\" size=\"1\">[221-7886]<br></font></td></tr>\r\n\t\t<tr><td width=\"20%\" bgcolor=\"#FFFFFF\"><font face=\"Arial\" size=\"1\">Memory</font></td><td width=\"45%\" bgcolor=\"#FFFFFF\"><font face=\"Arial\" size=\"1\">512MB DDR SDRAM 2 Dimms<br></font></td><td width=\"10%\" align=\"right\" bgcolor=\"#FFFFFF\"><font face=\"Arial\" size=\"1\">512MB2D<br></font></td><td align=\"right\" width=\"15%\" bgcolor=\"#FFFFFF\"><font face=\"Arial\" size=\"1\">[311-1885]<br></font></td></tr>\r\n\t\t<tr><td width=\"20%\" bgcolor=\"#E7E7E7\"><font face=\"Arial\" size=\"1\">Hard Drive</font></td><td width=\"45%\" bgcolor=\"#E7E7E7\"><font face=\"Arial\" size=\"1\">40GB Hard Drive<br></font></td><td width=\"10%\" align=\"right\" bgcolor=\"#E7E7E7\"><font face=\"Arial\" size=\"1\">40GB<br></font></td><td align=\"right\" width=\"15%\" bgcolor=\"#E7E7E7\"><font face=\"Arial\" size=\"1\">[340-8046]<br></font></td></tr>\r\n\t\t<tr><td width=\"20%\" bgcolor=\"#FFFFFF\"><font face=\"Arial\" size=\"1\">Operating System</font></td><td width=\"45%\" bgcolor=\"#FFFFFF\"><font face=\"Arial\" size=\"1\">Microsoft Windows XP Home<br></font></td><td width=\"10%\" align=\"right\" bgcolor=\"#FFFFFF\"><font face=\"Arial\" size=\"1\">WHXP<br></font></td><td align=\"right\" width=\"15%\" bgcolor=\"#FFFFFF\"><font face=\"Arial\" size=\"1\">[412-0689]<br></font><font face=\"Arial\" size=\"1\">[420-4766]<br></font><font face=\"Arial\" size=\"1\">[463-2282]<br></font><font face=\"Arial\" size=\"1\">[420-4928]<br></font><font face=\"Arial\" size=\"1\">[420-4830]<br></font></td></tr>\r\n\t\t<tr><td width=\"20%\" bgcolor=\"#E7E7E7\"><font face=\"Arial\" size=\"1\">Integrated Modem and NIC</font></td><td width=\"45%\" bgcolor=\"#E7E7E7\"><font face=\"Arial\" size=\"1\">Internal 56K Modem and Integrated Network Card<br></font></td><td width=\"10%\" align=\"right\" bgcolor=\"#E7E7E7\"><font face=\"Arial\" size=\"1\">",1] ); //-->b!X󆡑NBDnX󆡑NBPNG  IHDRfsRGB@}0PLTE{bIDATE!0Eq^uM&VUp\ &C|)"3.8̴(6 jPtsʄ&)NU- \^w& ^eyƾ_c|_^9IENDB`$$If!vh5555#v#v#v#v:V (6,555534 p($$If!vh5555#v#v#v#v:V (6,555534 p($$If!vh5555#v#v#v#v:V (6,555534 p($$If!vh5555#v#v#v#v:V 6,55534 p($$If !vh5a 5N #va #vN :V lE 05a 5N 4a p$$If !vh5a 5N #va #vN :V lB05a 5N 4a $$If !vh5a 5N #va #vN :V lB05a 5N 4a $$If !vh5a 5N #va #vN :V lB05a 5N 4a $$If !vh5a 5N #va #vN :V lB05a 5N / 4a @@@ NormalCJ_HaJmH sH tH Z@Z o" Heading 1$$ 7$8$@&H$a$5>*CJaJP@P o" Heading 2$ 8 7$8$@&H$CJaJDA@D Default Paragraph FontRi@R  Table Normal4 l4a (k@(No ListB^@B 0P Normal (Web)dd[$\$4 @4 mGFooter  !.)@. mG Page Number4@"4 mGHeader  !6B@26 o" Body TextCJaJ *! *-!dFG]7 8UEF$& +,7GLWXi 9 :;no~   '^_ !/0NOEFjkR_k{|$%),-45/X4 5 !*!I!L!M!N!W!X!Y!d!z!{!|!!!!!!!!00000000000000000 0 000000000000000@ 0@ 0@ 0@ 0D 0@ 0@ 0@ 0@ 0D 0@ 0@ 0@ 0@ 0D 0@ 0@ 0@ 0@ 0D 00000000000000p0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 00p000000000000000000000p0000p000@0@0@0@0@0@0@0@0@0@0@0_@0_@0_@0_@0_@0_@0_@0_@0_@0_@0_@0_@0_@0_@0_@0_@0_0_0@0_ 0_ 0_ 0_ 0_ 0_0_0_0_p0  0_ 0_ 0_ 0_ 0_0 @00p@0@0My00@0@0My000Ɯ0H@00@00@0M900FG] 8U +,7GLWXi ;   _ !NOEk$,-4/X4 5 !*!I!L!!000000000000 0 0Oy00Oy00Oy00Oy00Oy00 Oy00Oy00Oy00Oy00Oy00 Oy00Oy00Oy00Oy00My00 Oy00 Oy00 My00 My00 My00 M900M900M90 0O90S0M90S0M90S0M90S0M90S0O900O900Oy00l My0N0My00l My0N0My00l My0N0My0L0My0N0My0N0My0L0@0 O9000O9000O900O900O90C0O90C0Oy0.0O900O900O90D0O90D0O900O900Oy0 0O90B0O900O900O900Oy0.0Oy00Oy0.0Oy0.0Oy00Oy00Oy0.0Oy00Oy00Oy0.0Oy00Oy0#0Oy0.0Oy0.0Oy00Oy00Oy00@0@0@ 0@ 0@ 0B 0Oy00Oy0.0@00@ 00@ 00@ 00@ 00@ 0Oy0.00w ---0B # %wOR"%`)) '(*+-/1 +W!!-%N))!"#$%&),.0) !*0!!8@b(  P   " P   " P   " \B  S D"\B  S D"B S  ?%&')*!X~t~t ~ttH t) 2 N!{!|!!1;]UXD H .7'LNVko0356lo#*!-!N!{!|!!!!!!!33333333333333333333333333331FG]8T$&  o 9R_ !N!d!y!{!|!!!!!!!N!{!|!!PROFESSOR FRIEDMANRachel FriedmanI0V~U:x Tzz^`zo(. ^`hH. pLp^p`LhH. @ @ ^@ `hH. ^`hH. L^`LhH. ^`hH. ^`hH. PLP^P`LhH.h^`OJQJo(hHh^`OJQJ^Jo(hHohpp^p`OJQJo(hHh@ @ ^@ `OJQJo(hHh^`OJQJ^Jo(hHoh^`OJQJo(hHh^`OJQJo(hHh^`OJQJ^Jo(hHohPP^P`OJQJo(hH ^`hH. ^`hH. pLp^p`LhH. @ @ ^@ `hH. ^`hH. ^`hH. ^`hH. ^`hH. PP^P`hH. T\2 I0~U:0Q$J{{{M0؍                          dCaxVIHY="r4= @=7T o"%]'1,-/D1w-3ad9q:m~<-=DmG2O3Vb^@bUcBggXi4l@ m1svwh>J,\8F/qdSqtTLf~W%-0Pdt!%S][g <]YJ ^m~ +,7GLWXio~ !@*1!`@UnknownGz Times New Roman5Symbol3& z Arial?5 z Courier New;Wingdings"qhFA9\V<V<!24d=!=! 3QH)? CORE 5PROFESSOR FRIEDMANRachel Friedman#O From: "Rachel Friedman" Subject: CORE51 Date: Mon, 15 Aug 2005 12:34:42 -0700 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527    Oh+'0|  8 D P\dltCORE 5OREPROFESSOR FRIEDMANROFROFNormalORachel Friedman57hMicrosoft Word 10.0@(s0@@V՜.+,0 hp  CUNYCO<=!A CORE 5 Title  !"#$%&'()*+,-./012456789:;<=>?@BCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`bcdefghjklmnopsRoot Entry FCuData 31TableA?WordDocument"dSummaryInformation(aDocumentSummaryInformation8iCompObjj  FMicrosoft Word Document MSWordDocWord.Document.89q