Csa 1.1
Csa 1.1
Function:
# Both the structure and functioning of a computer simple. In general terms, there are
only four basic functions that a computer can perform:
1. Data processing: Data may take a wide variety of forms, and the range of
processing requirements is broad.
2. Data storage: Even if the computer is processing data on the fly (i.e., data come
in and get processed, and the results go out immediately), the computer must
temporarily store at least those pieces of data that are being worked on at any
given moment
3. Data movement: The computer’s operating environment consists of devices that
serve as either sources or destinations of data.
4. Control: Within the computer, a control unit manages the computer’s resources
and orchestrates the performance of its functional parts in response to
instructions
Structure:
# There are four main structural components of the computer.
1. Central processing unit (CPU): Controls the operation of the computer and
performs its data processing functions; often simply referred to as processor.
2. Main memory (RAM): Stores data.
3. I/O: Moves data between the computer and its external environment.
1 JYOTI PRAKASH MOHANTA, ASST. PROF. OF COMP. SC., F. M. AUTO. COLLEGE, BALASORE
Lecture#1 The Computer System
# The most interesting and in the most complex component is the CPU. Its major
structural components are as follows:
1. Control unit: Controls the operation of the CPU and hence the computer.
2. Arithmetic and logic unit (ALU): Performs the computer’s data processing
functions.
3. Registers: Provides storage internal to the CPU.
4. CPU interconnection: Some mechanism that provides for communication
among the control unit, ALU, and registers.
2 JYOTI PRAKASH MOHANTA, ASST. PROF. OF COMP. SC., F. M. AUTO. COLLEGE, BALASORE
Lecture#1 The Computer System
# All contemporary computer designs are based on concepts developed by John von
Neumann at the Institute for Advanced Studies, Princeton.
# Such a design is referred to as the von Neumann architecture and is based on
three key concepts:
1. Data and instructions are stored in a single read–write memory.
2. The contents of this memory are addressable by location, without regard to
the type of data contained there.
3. Execution occurs in a sequential fashion (unless explicitly modified) from one
instruction to the next.
Hardwired Program:
# If there is a particular computation/operation to be performed, a configuration of logic
components designed specifically for that computation could be constructed.
# We can think of the process of connecting the various components in the desired
configuration as a form of programming.
# The resulting “program” is in the form of hardware and is termed a hardwired
program.
Software:
# Suppose we construct a general-purpose configuration of arithmetic and logic
functions.
# This set of hardware will perform various functions on data depending on control
signals applied to the hardware. With general-purpose hardware, the system
accepts data and control signals and produces results.
3 JYOTI PRAKASH MOHANTA, ASST. PROF. OF COMP. SC., F. M. AUTO. COLLEGE, BALASORE
Lecture#1 The Computer System
2. COMPUTER FUNCTION:
4 JYOTI PRAKASH MOHANTA, ASST. PROF. OF COMP. SC., F. M. AUTO. COLLEGE, BALASORE
Lecture#1 The Computer System
# Program counter (PC) holds the address of the instruction to be fetched next.
Processor always increments the PC after each instruction fetch so that it will fetch
the next instruction in sequence.
# The fetched instruction is loaded into a register in the processor known as the
instruction register (IR).The instruction contains bits that specify the action the
processor is to take.
# In general, these actions fall into four categories:
1. Processor-memory: Data may be transferred from processor to memory or
from memory to processor.
2. Processor-I/O: Data may be transferred to or from a peripheral device by
transferring between the processor and an I/O module.
3. Data processing: The processor may perform some arithmetic or logic
operation on data.
4. Control: An instruction may specify that the sequence of execution be
altered.
5 JYOTI PRAKASH MOHANTA, ASST. PROF. OF COMP. SC., F. M. AUTO. COLLEGE, BALASORE
Lecture#1 The Computer System
6 JYOTI PRAKASH MOHANTA, ASST. PROF. OF COMP. SC., F. M. AUTO. COLLEGE, BALASORE
Lecture#1 The Computer System
# The execution cycle for a particular instruction may involve more than one reference
to memory. Also, instead of memory references, an instruction may specify an I/O
operation.
# With these additional considerations in mind a more detailed look at the basic
instruction cycle is presented in the bellow Figure:
7 JYOTI PRAKASH MOHANTA, ASST. PROF. OF COMP. SC., F. M. AUTO. COLLEGE, BALASORE
Lecture#1 The Computer System
Interrupts:
# All computers provide a mechanism by which other modules (I/O, memory) may
interrupt the normal processing of the processor.
# The most common classes of interrupts are:
Program: Generated by some condition that occurs as a result of an instruction
execution, such as arithmetic overflow, division by zero, attempt to execute an
illegal machine instruction, or reference outside a user’s allowed memory space.
Timer: Generated by a timer within the processor. This allows the operating
system to perform certain functions on a regular basis.
I/O: Generated by an I/O controller, to signal normal completion of an operation,
request service from the processor, or to signal a variety of error conditions.
Hardware Failure: Generated by a failure such as power failure or memory
parity error.
# Interrupts are provided primarily as a way to improve processing efficiency.
# Consider an example. The user program performs a series of WRITE calls
interleaved with processing.
# Code segments 1, 2, and 3 refer to sequences of instructions that do not involve I/O.
The WRITE calls are to an I/O program that is a system utility and that will perform
the actual I/O operation.
8 JYOTI PRAKASH MOHANTA, ASST. PROF. OF COMP. SC., F. M. AUTO. COLLEGE, BALASORE
Lecture#1 The Computer System
9 JYOTI PRAKASH MOHANTA, ASST. PROF. OF COMP. SC., F. M. AUTO. COLLEGE, BALASORE
Lecture#1 The Computer System
1 JYOTI PRAKASH MOHANTA, ASST. PROF. OF COMP. SC., F. M. AUTO. COLLEGE, BALASORE
0
Lecture#1 The Computer System
MULTIPLE INTERRUPTS:
# Two approaches can be taken to dealing with multiple interrupts.
# The first is to disable interrupts while an interrupt is being processed. A disabled
interrupt means that the processor can and will ignore that interrupt request
signal.
# If an interrupt occurs during this time remains pending and will be checked by the
processor after the processor has enabled interrupts.
# When a user program is executing and an interrupt occurs interrupts are disabled
immediately.
# After the interrupt handler routine completes, interrupts are enabled before resuming
the user program and the processor checks to see if additional interrupts have
occurred.
1 JYOTI PRAKASH MOHANTA, ASST. PROF. OF COMP. SC., F. M. AUTO. COLLEGE, BALASORE
1
Lecture#1 The Computer System
# The drawback to the preceding approach is that it does not take into account relative
priority or time critical needs.
# A second approach is to define priorities for interrupts and to allow an interrupt of
higher priority to cause a lower-priority interrupt handler to it be interrupted.
# As an example, consider a system with three I/O devices: a printer, a disk, and a
communications line, with increasing priorities of 2, 4, and 5, respectively.
# A user program begins at t = 0. At t = 10 a printer interrupt occurs; user information
is placed on the system stack and execution continues at the printer interrupt
service routine (ISR).
1 JYOTI PRAKASH MOHANTA, ASST. PROF. OF COMP. SC., F. M. AUTO. COLLEGE, BALASORE
2
Lecture#1 The Computer System
1 JYOTI PRAKASH MOHANTA, ASST. PROF. OF COMP. SC., F. M. AUTO. COLLEGE, BALASORE