Lecture Note 1 For "Computer Programming"
Lecture Note 1 For "Computer Programming"
Electronic Computers
The advance of semiconductor technology has made computing affordable.
The reduction in price and improvement in performance has made computer
much more affordable and powerful.
The first important improvement of so-called computer is from mechanical to
electronic in 1930s.
The first large-scale digital computer ENIVAC was built in 1946 by
University of Pennsylvania.
The first generation computer, built between 1939 and 1957, used
vacuum tubes, which consumed a lot of power and space. They tend to
overheat and burn out quickly; as a result they were expensive and
unreliable. They are mainly for scientific use due to its high costs.
The second-generation computers use transistors instead of vacuum
tubes. They use less power, take up less space, and become more
reliable and less expensive. Now the computers become more affordable
and more business can use them.
The third-generation computers use integrated circuit (IC) technology
that integrates many electronic components into a single silicon chip, to
make computers faster, smaller, and cheaper.
The forth generation computers take one step further and introduce
Large-scale integration (LSI) and Very Large Scale Integration (VLSI)
so that we can package an entire processor into a single chip.
Programming has evolved from a tedious error-prone job to machine-
Components of a Computer
There are four basic components in a computer system.
Central Processing Unit (CPU)
The main purpose of CPU is to process data in main memory. CPU is
capable of arithmetic and logic operation on data stored in main memory.
Main memory
The computer software (or program) and the data it wants to manipulate
are stored in main memory. The instruction of program are fetched from
memory by CPU and executed. The data are also stored in memory to
retain their value, or state.
Secondary storage
The secondary storage provides large, non-volatile, and inexpensive
storage for program and data.
Input/Output (I/O) devices
I/O devices provide channels to transmit/receive data to/from a
computer.
Memory consists of cells, which are indexed by address.
A cell consists of several bytes. Each byte has 8 bits.
Memory can be random access memory (RAM) or read-only memory
(ROM), or FLASH.
RAM can only store data temporarily, i.e. it is a volatile storage device.
Secondary storage provides semi-permanent storing capability.
Hard disk is the most popular secondary storage devices for its high capacity
and low costs.
CPU is a complicated chip to handle all the computation within a computer.
It has registers and cache memory to store the instruction and data retrieved
from main memory, and complicated decoding circuit to determine what
action should be performed, and an ALU (arithmetic and logic unit) with
circuit to carry out the actual computation.
1.3
computer hardware.
Software can be classified into two categories system software and
application software. System software prepares a computer to be use by a
user, e.g., operating system, compiler, editor, etc. Application software
performs a particular task for the user, e.g., Microsoft Office, Winamp, Tomb
Raider, etc.
A high level language lets you write high level construct to express abstract
ideas, instead of low-level machine instructions. However, computer
hardware can only understand machine language, therefore a high-level
construct to low-level machine language translator, or compiler, is needed.
A high level language can address memory cell by names, rather than
address.
Different types of programming language
Fortran -- Formula Translation, mainly for scientific and engineering
people.
C/C++ -- System software.
Pascal -- Mainly for teaching purposes.
COBOL -- Mainly for business and banking purposes.
ADA -- Military related control programs with high software reliability.
1.4