Slide 1Chapter 1Overview1.1Computer SystemsHardwareNetworksComputer OrganizationComputer MemoryLarger Data ItemsData or Code?Secondary MemorySecondary Memory MediaMemory AccessThe ProcessorComputer SoftwareComputer InputHigh-level LanguagesLow-level LanguagesCompilersLinkersHistory NoteSection 1.1 Conclusion1.2AlgorithmsProgram DesignProblem Solving PhaseImplementation PhaseObject Oriented ProgrammingOOP CharacteristicsSoftware Life CycleSection 1.2 Conclusion1.3Introduction to C++C++ HistoryA Sample C++ ProgramExplanation of code (1/5)Explanation of code (2/5)Explanation of code (3/5)Explanation of code (4/5)Explanation of code (5/5)Program Layout (1/3)Program Layout (2/3)Program Layout (3/3)Running a C++ ProgramRun a ProgramSection 1.3 Conclusion1.4Testing and DebuggingProgram ErrorsSection 1-4 ConclusionChapter 1 -- EndDisplay 1.1Display 1.2Display 1.3Display 1.4Display 1.5Display 1.6Display 1.7Display 1.8Display 1.9Display 1.10Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-WesleyChapter 1Introduction to Computers and C++ ProgrammingSlide 1- 3Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-WesleyOverview1.1 Computer Systems 1.2 Programming and Problem Solving1.3 Introduction to C++1.4 Testing and DebuggingCopyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley1.1Computer SystemsSlide 1- 5Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-WesleyComputer SystemsA computer program is…A set of instructions for a computer to followComputer software is …The collection of programs used by a computerIncludes:EditorsTranslatorsSystem ManagersSlide 1- 6Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-WesleyHardwareThree main classes of computersPCs (Personal Computer)Relatively small used by one person at a timeWorkstationLarger and more powerful than a PCMainframeStill largerRequires support staffShared by multiple usersSlide 1- 7Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-WesleyNetworksA number of computers connected to share resourcesShare printers and other devicesShare informationSlide 1- 8Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-WesleyDisplay 1.1Computer OrganizationFive main componentsInput devicesAllows communication to the computerOutput devicesAllows communication to the userProcessor (CPU)Main memoryMemory locations containing the running programSecondary memoryPermanent record of data often on a diskSlide 1- 9Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-WesleyComputer MemoryMain MemoryLong list of memory locationsEach contains zeros and onesCan change during program executionBinary Digit or BitA digit that can only be zero or oneByteEach memory location has eight bitsAddress Number that identifies a memory locationSlide 1- 10Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-WesleyDisplay 1.2 Larger Data ItemsSome data is too large for a single byteMost integers and real numbers are too largeAddress refers to the first byte Next few consecutive bytes can store the additionalbits for larger dataSlide 1- 11Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-WesleyData or Code?‘A’ may look like 01000001 65 may look like 01000001An instruction may look like 01000001How does the computer know the meaningof 01000001?Interpretation depends on the current instructionProgrammers rarely need to be concerned with this problem.Reason as if memory locations contain letters and numbers rather than zeroes and onesSlide 1- 12Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-WesleySecondary MemoryMain memory stores instructions and data while a program is running.Secondary memoryStores instructions and data between sessionsA file stores data or instructions in secondary memorySlide 1- 13Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-WesleySecondary Memory MediaA computer might have any of thesetypes of secondary memoryHard diskFastFixed in the computer and not normally removedFloppy diskSlowEasily shared with other computersCompact diskSlower than hard disksEasily shared with other computersCan be read only or re-writableSlide 1- 14Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-WesleyMemory AccessRandom Access Usually called RAMComputer can directly access any memory locationSequential AccessData is generally found by searching throughother items firstMore common in secondary memorySlide 1- 15Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-WesleyThe ProcessorTypically called the CPUCentral Processing UnitFollows program instructions Typical capabilities of CPU include: addsubtractmultiplydividemove data from location to locationSlide 1- 16Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-WesleyComputer SoftwareThe operating system Allows us to communicate with the computerIs a program Allocates the computer’s resourcesResponds to user requests to run other programsCommon operating systems include…UNIX Linux DOSWindows Macintosh VMSSlide 1- 17Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-WesleyDisplay 1.3Computer InputComputer input consists of A programSome dataSlide 1- 18Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-WesleyHigh-level LanguagesCommon programming languages include … C C++ Java Pascal Visual Basic FORTRAN COBOL Lisp Scheme AdaThese high – level languages Resemble human languagesAre designed to be easy to read and writeUse more complicated instructions than the CPU can followMust be translated to zeros and ones for the CPU to execute a programSlide 1- 19Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Low-level LanguagesAn assembly language command such as ADD X Y Zmight mean add the values found at x and y in memory, and store the result in location z.Assembly language must be translated to machine language (zeros and ones) 0110 1001 1010 1011The CPU can follow machine languageSlide 1-
View Full Document