You are on page 1of 27

INTRODUCTION TO COMPUTER SYSTEMS AND PROGRAMMING

Week 2

THE PROCESSING UNIT


and
TYPES OF PROCESSING

2-1
INTRODUCTION TO COMPUTER SYSTEMS AND PROGRAMMING

CENTRAL PROCESSING UNIT


It is the "brain" of the computer
it reads and executes program instructions, performs
calculations, and makes decisions.
It is responsible for storing and retrieving information on disks
and other media.
It also handles information on from one part of the computer to
another like a central switching station that directs the flow of
traffic throughout the computer system.
It is the essential component of a computer because it is the part
that executes the programs and controls the operation of all
the hardware.
The CPU resides inside a box known as the system unit, along
with various support devices and tools for storing information.

2-2
INTRODUCTION TO COMPUTER SYSTEMS AND PROGRAMMING

CENTRAL PROCESSING UNIT


Powerful computers may have several processors
handling different tasks, although there will
need to be one central processing unit
controlling the flow of instructions and data
through the subsidiary processors.

2-3
INTRODUCTION TO COMPUTER SYSTEMS AND PROGRAMMING

MAIN COMPONENTS OF THE CPU

2-4
INTRODUCTION TO COMPUTER SYSTEMS AND PROGRAMMING

CONTROL UNIT
The control unit must communicate with both the arithmetic/logic
unit and memory.
The functions performed by the control unit vary greatly by the
internal architecture of the CPU, since the control unit really
implements this architecture.
The control unit performs the tasks of fetching, decoding,
managing execution and then storing results.
The control unit uses the instruction contained in the Instruction
Register to decide which circuits need to be activated. It co-
ordinates the activities of the other two units as well as all
peripheral and auxiliary storage devices linked to the computer.
The control unit instructs the arithmetic logic unit which
arithmetic operations or logical operation is to be performed. It
is literally in control.

2-5
INTRODUCTION TO COMPUTER SYSTEMS AND PROGRAMMING

MEMORY UNIT
The Memory Unit is the part of the computer that
holds data and instructions for processing.
Although it is closely associated with the CPU, in
actual fact it is separate from it.
Memory associated with the CPU is also called
primary storage, primary memory, main storage,
internal storage and main memory.

2-6
INTRODUCTION TO COMPUTER SYSTEMS AND PROGRAMMING

RAM ,RANDOM ACCESS MEMORY


It is really the main store.
It is the place where the programs and software we load gets
stored
When the Central Processing Unit runs a program, it fetches the
program instructions from the RAM and carries them out. If the
Central Processing Unit needs to store the results of
calculations it can store them in RAM. Random Access
Memory can have instructions read from it by the CPU and also
it can have numbers or other computer data written to it by the
CPU.
The more RAM in your computer, the larger the programs you can
run.
When we switch a computer off, whatever is stored in the RAM
gets erased.

2-7
INTRODUCTION TO COMPUTER SYSTEMS AND PROGRAMMING

ROM, READ ONLY MEMORY


ROM is "built-in" computer memory containing data
that normally can only be read, not written to.
ROM contains the programming that allows your
computer to be "booted up" or regenerated each
time you turn it on.
The data in ROM is not lost when the computer power
is turned off.
The ROM is sustained by a small long-life battery in
your computer.
If you ever do the hardware setup procedure with your
computer, you effectively will be writing to ROM.

2-8
INTRODUCTION TO COMPUTER SYSTEMS AND PROGRAMMING

Arithmetic Logic Unit


The accumulator is
used to
accumulate
results. It is the
place where the
answers from
many
operations are
stored
temporarily The other general-
before being purpose registers
put out to the hold data on
computer's which operations
memory. are to be
performed by the
arithmetic logic
unit.

2-9
INTRODUCTION TO COMPUTER SYSTEMS AND PROGRAMMING

ARITHMETIC AND LOGIC UNIT


The arithmetic logic unit executes arithmetic and
logical operations.
Arithmetic operations include addition, subtraction,
multiplication and division.
Logical operations compare numbers, letters and
special characters.

2-10
INTRODUCTION TO COMPUTER SYSTEMS AND PROGRAMMING

Comparison operations
Comparison operations test for three conditions:
 Equal-to condition
 Less-than condition
 Greater-than condition

Relational operations (=, <, >) are used to describe the


comparison operations used by the arithmetic logic
unit.

2-11
INTRODUCTION TO COMPUTER SYSTEMS AND PROGRAMMING

LOGIC FUNCTIONS
The arithmetic logic unit performs logic
functions such as AND, OR and NOT.

2-12
INTRODUCTION TO COMPUTER SYSTEMS AND PROGRAMMING

STEPS, CPU PERFORMS WHEN


EXECUTING AN INSTRUCTION
MACHINE CYCLE
THE INSTRUCTION TIME THE EXECUTION TIME

1. The control unit gets the 3. The arithmetic logic unit


instruction from performs the actual
memory. operation on the data.
2. The control unit decides 4. The result of the
what the instruction operation is stored in
means and directs the memory or a register
necessary data to be
moved from the memory
to the arithmetic logic
unit.
2-13
INTRODUCTION TO COMPUTER SYSTEMS AND PROGRAMMING

HOW CPU WORKS?

2-14
INTRODUCTION TO COMPUTER SYSTEMS AND PROGRAMMING

DEFINITION: MICROPROCESSOR
In a microcomputer, the CPU is contained on a single silicon chip called the
microprocessor.
A microprocessor is a computer processor on a microchip.
It's sometimes called a logic chip.
It is the "engine" that goes into motion when you turn your computer on.
A microprocessor is designed to perform arithmetic and logic operations
that make use of small number-holding areas called registers.
Typical microprocessor operations include
adding, subtracting, comparing two
numbers, and fetching numbers from one
area to another.
When the computer is turned on, the
microprocessor is designed to get the
first instruction from the Basic
Input/Output System (BIOS) that comes
with the computer as part of its memory.

2-15
INTRODUCTION TO COMPUTER SYSTEMS AND PROGRAMMING

DATA PROCESSING
Processing data requires the
access to data stored in files.
Data may be stored in sequential
files or in on-line direct access
files.
It may be processed in batch mode
or a record at a time

6-16
INTRODUCTION TO COMPUTER SYSTEMS AND PROGRAMMING

SOME FILE PROCESSING MODES


 File and Database Processing

 Batch Processing

 On-Line Processing

6-17
INTRODUCTION TO COMPUTER SYSTEMS AND PROGRAMMING

FILE AND DATABASE PROCESSING


File processing involves operations on data that is already in
machine-readable format. It may involve conversion into a final
human-readable output such as a management report or into
some other alternative machine-readable format required for
further processing operations. File processing may be
approached in many ways depending upon the technologies
that are available and the types of application that are being
served.
Databases hold integrated database files and applications share
the same data. Database processing is much more efficient and
effective than "flat" file processing when the files are used for
storing business data. File and Database Processing

6-18
INTRODUCTION TO COMPUTER SYSTEMS AND PROGRAMMING

B
A
T
C
H
PROCESSING
6-19
INTRODUCTION TO COMPUTER SYSTEMS AND PROGRAMMING

ADVANTAGES AND DISADVANTAGES


OF BATCH PROCESSING
Advantages Disadvantages
response time not time between recording and
critical processing of source
need to process large documents is long
volume of data re-run normally required if
computer efficiency errors are encountered
is more important than data not current (i.e. not up-
response time (efficient to-date)
use of CPU) error correction is more
difficult
6-20
INTRODUCTION TO COMPUTER SYSTEMS AND PROGRAMMING

BATCH CONTROLS
 Transaction

 The Batch Total

6-21
INTRODUCTION TO COMPUTER SYSTEMS AND PROGRAMMING

ON-LINE PROCESSING
 In on-line processing, the data records in a file
or database table are immediately accessible
without reading through a sequential file.
 Input data enters the computer directly as soon
as it is being transacted. This information will
be processed immediately and updated into the
master file.
 It does not provide as much efficiency, security
and control as batch file processing.

6-22
INTRODUCTION TO COMPUTER SYSTEMS AND PROGRAMMING

ADVANTAGES AND DISADVANTAGES


OF ON-LINE PROCESSING
Advantages Disadvantages
enter CPU time is used less efficiently
availability of random arrival of transactions, terminal
information for operator process each transaction separately
decision making more expensive than batch processing
more accurate Examples of some of the many on-line systems
data capture include:
schedules suits Electronic funds transfer systems (EFTS)
user Library information systems
Hospital administration systems
Teletext systems

6-23
INTRODUCTION TO COMPUTER SYSTEMS AND PROGRAMMING

REAL-TIME PROCESSING SYSTEM


 Real-time systems are computer systems that
process input data quickly enough for the results to
influence the activities currently taking place.
 Transactions are entered and processed
immediately.
 sometimes referred to as transaction processing
systems.
 Decisions are made on the results produced by the
computer system and these have a direct impact on
the ongoing activities.

6-24
INTRODUCTION TO COMPUTER SYSTEMS AND PROGRAMMING

SIMPLE DEFINITION OF
REAL-TIME PROCESSING SYSTEM
One which controls the environment by
receiving data processing them and
returning results sufficiently quickly to
affect the functioning of the environment
at that time example, ATM SYSTEM when
you withdraw cash from your account and
your account balance is updated
immediately at the point of withdrawal.

6-25
INTRODUCTION TO COMPUTER SYSTEMS AND PROGRAMMING

ADVANTAGES AND DISADVANTAGES


OF REAL-TIME PROCESSING SYSTEM
Advantages

Response time is very critical and sufficiently

quick

Disadvantages

Expensive hardware and software

Very complex in terms of hardware and software


6-26
INTRODUCTION TO COMPUTER SYSTEMS AND PROGRAMMING

OFF-LINE PROCESSING SYSTEM


Off-line procedures are sometimes used prior to batch
processing.
Data is entered via a terminal but does not go directly
to the main CPU.
Instead it is stored in a high speed medium such as
tapes for future processing in batch mode.
Minicomputers are frequently used for off-line
operations such as formatting, editing and verifying
data before it enters to the main CPU.

6-27

You might also like