CSC 155 - NOTES FOR LECTURE 1, AUGUST 29, 2000

 

Web site: http://servercc.oakton.edu/~glance/lance.html

 

COMPUTER: a device capable of performing computations and making logical decisions at speeds millions or billions of times faster than human beings can.

PROGRAM: a sequence of instructions that the computer follows to solve some problem. Computers process data under the control of sets of instructions called programs.

HARDWARE: CPU (central processing unit), the memory, the Input/Output (I/O) devices (keyboard, monitor, scanner, printer, modem, hard drive, zip drive, CD reader/writer, floppy disk, mouse)

SOFTWARE: The computer programs that run on a computer - operating system, applications.

 

Computers are usually envisioned as being divided into six “logical units”:

1. Input unit. This is the receiving section of the computer. It obtains information (data and computer programs) from various input devices and places this information at the disposal of the other units so that the information may be processed. Mouse, keyboard...

2. Output unit. Takes the information that has been processed by the computer and sends it to some output device(s). Printer, disk, monitor...

3. Memory unit. For rapid access. Retains information that has been entered through the input unit so that the information may be made immediately available for processing when it is needed. Also retains processed information until that information can be placed on some output device. Includes random access memory (RAM), which is slow compared to registers. Accessing data in registers is 1000’s of times faster than accessing memory on disks. But there are only a finite number of registers, whereas disc storage is essentially limitless. Know as volatile, which means data in RAM is gone when power is shut off.

4. Arithmetic and Logical Unit (ALU): Responsible for performing calculations such as addition, subtraction... Also logical operations, such as determining the maximum of a set of numbers.

5. Central Processing Unit (CPU): Supervises the operation of the other sections. Tells the input unit when information should be read into the memory unit, tells the ALU when information from the memory unit should be utilized in calculations, and tells the output unit when to send information from the memory unit to certain output devices.

6. Secondary storage unit: Long-term, high-capacity storage. Programs or data not actively being used by the other units are normally placed on secondary storage unit (such as disks) until they are needed. Permanent memory, not affected by power to computer.

 

MEMORY ORGANIZATION. Memory is stored in binary format, using 0s and 1s. The smallest unit of storage is a bit. A bit can have low power (off - 0) or high power (on - 1). Bits are grouped into bytes, where one byte usually is 8 bits. We will get into this in chapter 2 when we discuss integers, doubles...

 

Low level language: Consider this as being the language that is understood by the computer. Each instruction lists one thing that is to be accomplished, like get some value stored in memory and put it in a register. The next instruction may go to a different memory address and store the value in another register. The third instruction may be to add those numbers and put them in another register or overright one of the first two registers. A forth instruction may be to write the result to a memory location.

 

High level language: a single statement can accomplish what would take a low level language several instructions.

 

Object Program: another name for machine language program.

 

COMPILER: translates each high-level instruction into machine language that is understood by the computer. It creates the “object code” and stores it on the disk. Can also say that it translates source programs into object programs.

 

LINKER: connects items referenced in the object file but defined outside of the object file with their definitions, producing an executable program, which is then stored on disk.

 

OPERATING SYSTEM (O/S): a program that acts as an intermediary between a user of a computer and the computer hardware. The O/S controls and coordinates the use of the hardware among the various application programs for the various users. The O/S is a resource allocator, which means it controls the use of resources, such as CPU time, memory space, file storage space, I/O devices... The O/S manages these resources, and must do so in an efficient and fair manner.

 

GRAPHICAL USER INTERFACE (GUI): used to provide a simpler and more intuitive interface betweens computers and users.

 

WHAT IS C++? Evolved from C, which evolved from B and BCPL. BCPL was developed in 1967 by Martin Richards. Ken Thompson designed B from BCPL, and used it to create early version of the UNIX O/S at Bell Labs in 1970. C was evolved from B by Dennis Ritchie at Bell Labs in 1972. C++ was developed by Bjarne Stroustrup in early 1980s at Bell Labs. C++ is known as a hybrid language, in that it is like C, but has object-oriented attributes, which we will cover later in this course. C++ was once known as C with classes. Classes will be discussed in chapter 4. Classes are essentially the encapsulation of data and functions (behavior) into a package. This ties the data and the functions together. Classes are user- or programmer-defined types. Just as an instance of a primitive type (like int) is called a variable, instances of classes are called objects.

 

ALGORITHM: Any computing problem can be solved by executing a series of actions in a specific order. A procedure for solving a problem in terms of (1) the actions to be executed, and (2) the order in which these actions are to be executed is called an algorithm.

 

PSEUDOCODE: an artificial and informal language that helps programmers develop algorithms. It is similar to everyday English - it is not a programming language. Does not need declarations of variables. Essentially, summarizes the steps necessary to accomplish some task. Can then be translated into the programming language of your choice.

 

SYNTAX OF A LANGUAGE: Specifies how programs in the language are built up. Incorrect syntax will be discovered during compilation, and will abort the creation of the object file. Syntax is actually the grammar rules of the C++ language.

 

SEMANTICS: specifies what programs do logically.