COMPUTER SYSTEM A computer system is made of two major components: hardware and software. The computer hardware is the physical equipment. The software is the collection of programs (instructions) that allow the hardware to do its job. 1.1.1 Computer Hardware The hardware of a computer system consists of six parts: a central processing unit (CPU), main memory, secondary storage, the input system, the output system, and the communication system. These components are connected together by what is called a bus. Figure 1.1 shows these six components and their connection. Central Processing Unit (CPU) The central processing unit (CPU) consists of the arithmetic-logical unit (ALU), the control unit, and a set of registers to hold data temporarily while being processed. The control unit is the traffic cop of the system; it coordinates all the operations of the system. The ALU In this chapter, we describe the components of a computer system and discuss the general ideas behind computer languages. The overview provided in this chapter will help prepare you for future chapters. You can skip the chapter in the first reading and return to it when you have a better understanding of programming.
Introduction to Computers and Programming Languages Objectives After you have read and studied this chapter, you should be able to: Discuss the two major components of a computer: hardware and software. Describe the six parts of hardware: CPU, primary memory, secondary storage, input system, output system, and communication system. Describe the two major categories of software: system software and application software. Describe the evolution of computer languages from machine languages, to assembly languages, and to high-level languages. Discuss four different paradigms of computer languages: procedural, object-oriented, functional, and logic. Describe the two steps of program design: understand the problem and develop a solution. Describe the multistep procedure that transforms a program written in the C++ language to an executable program. 2 Chapter 1 Introduction to Computers and Programming Languages executes instructions such as arithmetic calculations and comparisons among data. Figure 1.2 shows the general idea behind a central processing unit. Primary Memory Primary memory is where programs and data are stored temporarily during processing. The contents of primary memory are lost when we turn off the computer. Figure 1.3 shows primary memory in more detail. Each storage location in memory has an address, much like a street address, that is used to reference the memory’s contents. The addresses in Figure 1.3(a) are shown on the left as numbers ranging from zero to (n – 1), where n is the size of memory. In Figure 1.3(b) the address is shown symbolically as x.