CA Notes Chapter1
CA Notes Chapter1
Hardware
Software
The memory of the computer contains storage for instructions and data. It is
the RAM and the CPU can access any location in memory at random and
retrieve the binary information within a fixed interval of the time.
Software
System software.
Application software
1. Information.
2. Formats.
3. Instruction sets
4. Addressing modes.
For example the CPU cannot do both reading an instruction from memory and
reading/writing data from/to the memory simultaneously because
the instructions and data use the same signal pathways and memory.
Memory
Arithmetic Logic
Unit
Control unit
Accumulator
or
Input Output
HARVARD ARCHITECTURE
These early machines had limited data storage, entirely contained within the
data processing unit, and provided no access to the instruction storage as
data , making loading and modifying programs an entirely offline process.
The CPU can read both an instruction and data from memory at the same
time, even without a cache, leading to double the memory bandwidth. A
Harvard architecture computer can thus be faster for a given circuit
complexity because instruction fetches and data access do not contend for a
single memory pathway.
Different program and data bus widths are possible, allowing program and
data memory to be better optimized to the architectural requirements. E.g.: If
the instruction format requires 14 bits then program bus and memory can be
made ”hit wide, while the data bus and data memory remain 8-bit wide.
program and data are stored in the program and data are stored and
Programs and data are stored and some handled by different subsystem
memory and managed by the handled
by different subsystems.
Can be slower because programs and Can he must faster under certain
data are stored in some memory and are conditions.
to be managed by a single system.
Functions of computer
Both the structure and functioning of a computer are, in essence, the basic
functions that a computer can perform. In general terms, there are
only four:
• Data processing
• Data storage
• Data movement
• Control
The computer, of course, must be able to process data.The data may take a
wide variety of forms, and the range of processing requirements is broad.
However, we shall see that there are only a few fundamental methods or types
of data processing.
The computer must be able to move data between itself and the outside world.
The computer’s operating environment consists of devices that serve as either
sources or destinations of data. When data are received from or delivered to a
device that is directly connected to the computer, the process is known as
input–output(I/O), and the device is referred to as a peripheral. When data
are moved over longer distances, to or from a remote device, the process is
known as data communications.
Finally, there must be control of these three functions. Ultimately, this control
is exercised by the individual(s) who provides the computer with instructions.
Within the computer, a control unit manages the computer’s resources and
orchestrates the performance of its functional parts in response to those
instructions.
By Usha Kamala B T,VVFGC,Tumakuru. Page 5
Computer Architecture, IIIBCA Chap:1
Structure of computer
2. The CPU fetches those instructions sequentially one-by-one from the main
memory, decodes them and performs the specified operation on associated
data operands in ALU.
OPCODE OPERAND/s
ADD LOCA, R0
This instruction is an addition operation. The following are the steps to
execute the instruction:
Step 1: Fetch the instruction from main memory into the processor
Step 2: Fetch the operand at location LOCA from main memory into the
processor
Step 3: Add the memory operand (i.e. fetched contents of LOCA) to the
contents of register R0 Step 4: Store the result (sum) in R0.
INSTRUCTIONS
The major responsibility of the instruction execution is with the CPU. The i
nstruction execution takes place in the CPU registers. Let us, first discuss f
ew typical registers which are commonly available in some of the machines.
Format of instruction.
Instruction Cycle
The Processing needed for a single instruction (fetch and execution) is ref
erred to as instruction cycle. The instruction cycle consist of the fetch cycl
e and the execute cycle. Program execution terminates if the electric pow
er supply is discontinued or some sort of occurs unrecoverable error, or by a
program itself.
For fetch cycle, in typical CPU program counter is used. Program counter k
eeps track of the Instruction which is to be fetched next. Normally next instr
uction in sequence is fetched next as programs are executed in sequence. T
he fetched instruction is in the form of binary code and is loaded into an in
struction and do the required action. In general, these actions can be div
ided into following categories :
Data transfer
From the CPU to memory or from memory to CPU, or From CPU to I
/O or I/O to CPU.
Data Processing:
A logic or arithmetic operation may be performed by CPU on the data.
Sequence control:
This action may require alteration of sequence of execution. For ex
ample, an instruction from location 100 on execution may specifies that the
next instruction should be fetched from location200. On execution of such a
instruction the Program counter which was having location value 101 (he ne
xt instruction to be fetched in case where memory word is equal to register si
ze) will be modified to contain a location value 200
Please note that in the above state diagram some states may be bypassed w
hile some may be visited more than once. The instruction cycle shown in abo
ve figure consist of following
states/stages:
First the address of next instruction is calculated based on the width
of instruction and memory organization.For example, if in a computer
an instruction is of 16 bits and if memory is organized as16-bit words
Interrupts
The term interrupt is defined loosely to any exceptional event that causes CPU
to temporarily transfer its control from currently executing program to a
different program which provides service to the exceptional event.
Types of Interrupts :
There are 3 types of interrupts. They are
1. External interrupts.
2. Internal interrupts.
3. Software interrupts.
INTERNAL INTERRUPTS are also called Traps. They arise from illegal or
erroneous use of an instructions or data. The error condition usually occurs
due to premature termination of instruction execution.
1. Register overflow
2. Attempt to divide by zero.
3. Invalid operations code.
4. Stack overflow
5. Protection violation.
For example, a supervisor call instruction provides means for switching from
a CPU user mode to supervisor mode. A complex input output transfer
procedure may be assigned to supervisor mode. But a program written by a
user must run in the user mode. When an input or output transfer is required,
the supervisor mode is requested by means of a supervisor call instruction.
This instruction caused a software interrupt that stores the old CPU state and
brings in a new PSW that belongs to the supervisor mode. The calling program
must pass information to the operating system in order to specify the
particular task requested.
How does the CPU know that an interrupt has occurred? the CPU can be
interrupted by providing a control line. this line, also known as Interrupt
request line ,connects the source/sources of interrupts to the CPU. the
interrupt signal is then stored in a register of the CPU. this register is
periodically tested by the CPU to determine the occurrence of an interrupt.
once CPU knows that an interrupt has occurred then the CPU need to execute
an interrupt servicing program which tries to remove/service the
condition/device which has caused the interrupt. In general , each source of
interrupt requires different interrupt servicing program to be executed. The
CPU is normally assigned the address of the interrupt servicing program to
be executed. Considering this requirement let us work out the steps which
CPU must take when an interrupt occurs.
The CPU must find out the source of the interrupt as this will determine
which interrupt service program is to be executed.
The CPU then acquires the address of the interrupt service routine
which are normally stored in the memory.
What happens to the program it was executing? this program need to
be interrupted till the CPU executes the interrupt service program.do
we need to do something for this program? Well the context of this
program is to be saved. We will discuss about this a bit later.
Finally, the interrupt service program is executed by the CPU ,till the
completion of the program. The end of this program is marked by a
RETURN statement. After that the control is passed back to the
interrupted program.
A user program can perceive the interrupt as. The interruption of the
execution in between. the execution resumes as soon as the interrupt
processing is completed. Therefore, the user program need not contain any
special code for interrupt handling. This job lies with the processor and
the operating system which in turn are also responsible for suspending the
execution of the user program and later interrupt handling resumes the
user program from the same point.
Multiple interrupts
It is very much possible to have multiple interrupts occurring at the same
time. For example, the data may be received by a program from a
communication line and on the other side it is printing results an interrupt
will be generated by the printer on completion of every print operation, while
the communication line controller will be generating the interrupt on arrival
of a unit of data. Since, these two interrupts are independent, therefore, the
communication interrupt may occur while the printer interrupt is being
processed.
not allow other interrupts to be processed).If an interrupt occur while the first
interrupt is being processed then it will remain pending till the interrupts
have been enabled again. Therefore, in this scheme the first few instructions
in the processing of an interrupt is completed, then the processor enables the
interrupts and checks whether any other interrupt has occurred. Thus, in
this approach interrupts are handled in the sequential order.
The main drawback of this approach is that it does not consider the relative
priority or time critical nature of some interrupts. For example, while
inputting from a communication line, the data needed to be accepted quickly
so that room can be made for more input . In case, the first burst of data
processed before the second burst arrives, data may be lost.
For such cases another scheme in which priorities for interrupts is defined is
followed. This scheme allows the higher priority interrupt a lower priority
interrupt program in between.
For example, let us assume a system with three input/ouput devices :printer,
disk, and communication line. Let us assume that these have priorities of 1,2
and 3 respectively. priority 3 is the highest while 1 is lowest case in our case.
An instance of program execution is shown with multiple interrupt in figure.
initially the user program is being executed by the CPU till the point A where
a printer interrupt occurs. CPU acknowledges the printer interrupt by placing
the context of user program on the system stack and starts executing the
interrupt servicing program (ISP) for the printer, before the ISP of printer is
INTERCONNECTION STRUCTURES
CPU
Memory and
input/output component
(a) Input/output to central processor :in this structure all exchanges between
Input/output device and memory pass through the CPU. it is a simple and
inexpensive structure but reduces the CPU throughout as CPU is tied up in
doing input-output tasks which are normally considerably slower than that
of CPU operations.
Bus Interconnection
Shared bus:In a shared bus only one source can transmit at a time while one
or more than one receive that signal. Figure shows the diagram of shared bus.
A system bus may consist of 50 to 100 separate lines. These lines can be
broadly categorized into three functional groups:
The data bus provides path for moving data between the system modules. It
normally consist of 8,16 or 32 bit separate lines. The number of lines in data
bus is called the width of data bus. Thus, a data bus width limits the
The address bus is used to designate the source of data for data bus. As the
memory maybe divided into linear array of bytes or words ,therefore ,for
reading or writing any information on to memory CPU need to specify the
address of a particular location.This address is supplied by the address bus.
Thus the width of address bus specifies the maximum possible memory
supported by a system. for ex, if system has 16 bit wide address bus then it
can have main memory size equivalent to 2^16=64k.the role of control line
(bus)is to control for transmission of command and timing signals(which
validate data address)between the system modules.
some of control lines of bus are required for: bus request ,bus grant,
providing clock signal, providing reset signals, reading/writing to I/O devices
or memory etc.
1) Bus Types
2) Method of Arbitration
3) Timing
4) Bus Width
5) Data Transfer Type
6) Block Data Transfer
1) Bus Types
A) Dedicated
A line is permanently assigned either to one function.
An example of functional dedication is the use of separate dedicated
address and data line.
B) Multiplexed
Using the same lines for multiple purpose.
Eg:- Address and data information may be transmitted over the same
set of lines.
At the beginning of the data transfer the address is placed on the
bus and the address valid line is activated.
The address is then remove from the same bus line is used for data
transfer.
C) Physical Dedication
The use of multiple buses, each of which connects to only a subset of
modules.
2) Method of Arbitration
Determining who can use the bus at a particular time.
A) Centralized
A single hardware device called the bus controller or arbiter allocate
time on the bus.
The device may be a separate or a part of a processor.
Some of the arbitration schemes are;daisy chaining, polling,
independent requesting
B) Distributed
There is no centralized controllers.
Each module contains assess control logic and the modules act
together.
3) Timing
A) Synchronous Timing
Bus includes a clock line upon which a clock transmits a regular
sequence of alternating 1's and 0's
A single 1-0 transition is referred to as a clock cycle or bus cycle.
All other devices on the bus can read the clock line.
All events start at the beginning of a clock cycle
B) Asynchronous Timing
The occurrence of one event on a bus follows and depends on the
occurrence of a previous event.
Harder to implement and text than synchronous timing.
4) Bus Width
The width of data bus has an impact on the data bus has an impact
on the system performance.
The wider data bus, the greater number of bit transferred at one time.
The wider address bus, the greater range of location that can be
referenced.
Bus arbitration: Another important aspect of the system where buses are
used is the control of a bus. In most of the systems more than one module
need control of the bus. For expamle, Input/Output modules may need
control of the bus for transferring data to memory. Similarly, CPU also needs
the bus for various data transfer. Suppose
1. daisy chaining
2. polling
3. independent requesting
Earlier when programming was done using assembly language, a need was
felt to make instruction do more task because programming in assembly was
tedious and error prone due to which CISC architecture evolved but with up
rise of high level language dependency on assembly reduced RISC
architecture prevailed.
operations just like a load command will load data, store command will
store the data.
Characteristic of RISC –
1. Simpler instruction, hence simple instruction decoding.
2. Instruction come under size of one word.
3. Instruction take single clock cycle to get executed.
4. More number of general purpose register.
5. Simple Addressing Modes.
6. Less Data types.
7. Pipeline can be achieved.
Complex Instruction Set Architecture (CISC) –
The main idea is that a single instruction will do all loading, evaluating and
storing operations just like a multiplication command will do stuff like
loading data, evaluating and storing it, hence it’s complex.
Characteristic of CISC –
1. Complex instruction, hence complex instruction decoding.
2. Instruction are larger than one word size.
3. Instruction may take more than single clock cycle to get executed.
4. Less number of general purpose register as operation get performed in
memory itself.
5. Complex Addressing Modes.
6. More Data types.
Both approaches try to increase the CPU performance
RISC: Reduce the cycles per instruction at the cost of the number of
instructions per program.
CISC: The CISC approach attempts to minimize the number of
instructions per program but at the cost of increase in number of cycles
per instruction.
CISE RISC
1. Large number of instructions 1. Fewer instructions.
2. Emphasis is in hardware 2. Emphasis is on software
3. It includes multi-clock 3. It includes single-clock,
complex instruction reduced instruction only
4. Memory-to-memory: “LOAD” 4. Register to register: “LOAD”
and “STORE” incorporated in and Store” are independent
instructions instructions
5. Code size is small but 5. Code size is large but
complex. High cycles per simple. Low cycles per
second. second
6. Transistors are used for 6. More transistors are used
storing complex instructions for memory registers
7. Variable length instruction 7. Fixed length instruction
format format
8. Large variety of addressing 8. Few addressing modes
modes
Parallel Processing
Parallel processing is a method of simultaneously breaking up and running
program tasks on multiple microprocessors, thereby reducing processing
time. Parallel processing may be accomplished via a computer with two or
more processors or via a computer network. Parallel processing is also called
parallel computing.
Parallel processing is particularly useful when running programs that perform
complex computations, and it provides a viable option to the quest for cheaper
computing alternatives. Supercomputers commonly have hundreds of
thousands of microprocessors for this purpose. Parallel processing should not
be confused with concurrency, which refers to multiple tasks that run
simultaneously.
Parallel System
These systems are also called as tightly –coupled systems due to the
high degree of resource sharing.
In parallel system, multiple CPUs are used simultaneously to execute
a program.
A program is broken into discrete parts that can be solved
concurrently.
Each part is further broken down to a series of instructions and
instructions from each part execute simultaneously on different CPUs.
Multi processing systems are available in two types- asymmetric
multiprocessing and symmetric multi processing.
Asymmetric multiprocessing:
-In this system there is a master slave relationship.
-A master CPU can execute the operating system routines and handle I/O.
-The remaining CPUs have no I/O capability and thus are called attached
processors.
Symmetric multiprocessing:
-All the CPUs are equally capable of running the system programs such as
the operating system kernel and I/O service routines.
Advantages of Parallel System:
1. Saves money
2. Increased reliability
3. Increased throughput
Disadvantages of Parallel System:
1. Implementation is complex
2. Requires resource management and protection
PowerPC
In 1975, IBM started the 801 minicomputer project that launched the RISC
movement.
In 1975, 801 minicomputer projects by IBM introduced the RISC. Then the
Berkeley RISC I processor was introduced.
In 1986, IBM introduced the commercial RISC workstation product called RT
PC which was not commercially successful due to performance of other
competitors.
In 1990, IBM introduced IBM RISC System/6000 which has
RISC-like superscalar machine.
POWER architecture.
IBM alliance with Motorola (68000 microprocessors), and Apple, (used 68000
in Macintosh) and produced PowerPC architecture which was
Derived from the POWER architecture.
Superscalar RISC
PowerPC Family is:
601: Quickly to market. 32-bit machine.
603: 32 bit low-end desktop and portable.
Lower cost and more efficient implementation
604: Desktop and low-end servers, 32-bit machine.
Much more advanced superscalar design. Greater performance
620: High-end servers, 64-bit architecture.
740/750: Also known as G3, two levels of cache on chip.
G4: Increases parallelism and internal speed.
G5: Improvements in parallelism and internal speed, 64-bit organization.
QUESTIONS
One Mark Questions