FOUNDATIONS OF COMPUTER SCIENCE
HARISH MORWANI
[email protected]
1.1 THE COMPUTER AS A BLACK BOX DATA PROCESSOR You can think of a computer as a data processor. Using this definition, a computer acts as a black box that accepts input data, processes the data, and creates output data.
Although this model can define the functionality of a computer today, it is too general. It is not clear how many types or sets of operations a machine based on this model can perform.
PROGRAMMABLE DATA PROCESSOR
This model adds one extra element to the computer: the program. A program is a set of instructions written in a computer language that tells the computer what to do with data. In the new model, the output data depend on the combination of two factors: the input data and the program.
A PROGRAM
Same program, different input data
Same input data, different programs
1.2 VON NEUMANN MODEL Every computer today is based on the von Neumann model. It is based on three ideas.
FOUR SUBSYSTEMS The model defines a computer as four subsystems: memory, arithmetic logic unit, control unit, and input/output.
• Memory Memory is the storage area. It is where programs and data are stored during processing. • Arithmetic Logic Unit (ALU) The ALU is where calculation and logical operations take place. • Control Unit The control unit controls the operations of the memory, ALU, and the input/output subsystem. It controls all the hardware operations. • Input/Output The input subsystem accepts input data and the program from outside the computer; the output subsystem sends the result of processing to the outside.
PRIMARY MEMORY 1. VOLATILE IN NATURE
• It is useful for execution of a program. Whenever a program needs to be executed, it should be loaded in Primary Memory
2. LIMITED STORAGE
SECONDARY MEMORY 1. NON-VOLATILE IN NATURE
2. LARGE STORAGE
CENTRAL PROCESSING UNIT (CPU) Key Features • Brain of the Computer • Contains ALU and CU • Responsible for the overall functioning of the computer
STORED PROGRAM CONCEPT The von Neumann model states that the program must be stored in memory. This is totally different from the architecture of early computers in which only the data were stored in memory. Both the data and programs should have the same format because they are stored in memory. They are, in fact, stored as binary patterns (a sequence of 0s and 1s ) in memory.
SEQUENTIAL EXECUTION OF INSTRUCTIONS A program in the von Neumann model is made of a finite number of instructions. In this model, the control unit fetches one instruction from memory, interprets it, and then executes it.
1.5 COMPUTER SOFTWARE PROGRAMS MUST BE STORED AS A SEQUENCE OF INSTRUCTIONS Another requirement of the model is that the program must be a sequence of instructions. Each instruction operates on one or more data items.
ALGORITHMS The step-by-step solution is called an algorithm.
LANGUAGES A computer language has a limited number of symbols and also a limited set of words .
1.6 HISTORY MECHANICAL MACHINES (BEFORE 1930) BIRTH OF ELECTRONIC COMPUTERS (1930-1950)
• Early Electronic Computers The early computers of this period did not store the program in memory; all were programmed externally. The first general-purpose, totally electronic computer was made by John Mauchly and J.Presper Eckert and was called ENIAC (Electronic Numerical Integrator and Calculator). It was completed in 1946. • Computers Based on the von Neumann Model The first computer based on von Neumann’s idea was made in 1950 at the University of Pennsylvania and was called EDVAC (Electronic Discrete Variable
COMPUTER GENERATIONS (1950-PRESENT) Computer built after 1950 are following, more or less, the von Neumann model. The computers has become faster, smaller, and cheaper, but the principle is almost the same. Each generation witnesses some major change in hardware or software (but not the model). • First Generation (roughly 1950-1959) The first generation is characterized by the emergence of commercial computers. Computers were bulky and used vacuum tubes as electric switches.
• Second Generation (roughly 1959-1965) Second-generation computers used transistors instead of vacuum tubes. This reduced the size of computers as well as their cost. Two high-level programming languages, FORTRAN and COBOL , were invented and made programming easier.
• Third Generation (roughly 1965 -1975 ) The invention of integrated circuit (transistors, wiring, and other components on a single chip) reduced the cost and size of computers even further. Minicomputers appeared on the market. Software industry was born.
• Fourth Generation (approximately 1975-1985) The fourth generation saw the appearance of microcomputers. Advances in the electronics industry allowed whole computer subsystems to fit on a single circuit board. This generation also saw the emergence of computer networks. • Fifth Generation (approximately 1985-NOW) The fifth generation witnessed the appearance of laptop and palmtop computers, improvements in secondary storage media (CD-ROM, DVD, etc.), the use of multimedia, and the phenomenon of virtual reality.
SUMMARY Computer science, in this text, means issues related to a computer. A computer is a programmable data processor that accepts input data and programs and outputs data. A program is a set of instructions executed sequentially that tells the computer what to do with data. Every computer today is based on the von Neumann model.
SUMMARY (continued) The von Neumann model specifies a memory subsystem, an arithmetic logic unit subsystem, a control unit subsystem, and an input/output subsystem. Data and programs are stored in computer memory. A step-by-step solution to a problem is called an algorithm. A program is written in a computer language.
Thanks !