Section - A - Unit-2 STORED PROGRAM CONCEPT
Section - A - Unit-2 STORED PROGRAM CONCEPT
SYSTEM BUS
Data Instruction
INPUT
OUTPUT
Levels of
Flynn's taxonomy
Single Multiple
Instruction Instruction
• Instructions are decoded by the control unit and then ctrl unit send the
instructions to the processing units for execution.
• Data Stream flows between the processors and memory bi directionally.
SISD COMPUTER SYSTEMS
Control Processor Data stream Memory
Unit Unit
Instruction stream
Characteristics
- Standard von Neumann machine
- Instructions and data are stored in memory
- One operation at a time
MISD COMPUTER SYSTEMS
M CU P
M CU P Memory
• •
• •
• •
M CU P Data stream
Instruction stream
Characteristics
- There is no computer at present that can be
classified as MISD
SIMD COMPUTER SYSTEMS
Memory
Data bus
Control Unit
Instruction stream
Data stream
Alignment network
Characteristics
- Only one copy of the program exists
- A single controller executes one instruction at a time
MIMD COMPUTER SYSTEMS
P M P M ••• P M
Interconnection Network
Shared Memory
Characteristics
- Multiple processing units
- Message-passing multicomputers
SHARED MEMORY MULTIPROCESSORS
M M ••• M
Buses,
Interconnection Network(IN) Multistage IN,
Crossbar Switch
P P ••• P
Characteristics
All processors have equally direct access to
one large memory address space
Example systems
Bus and cache-based systems
- Sequent Balance, Encore Multimax
Multistage IN-based systems
- Ultracomputer, Butterfly, RP3, HEP
Crossbar switch-based systems
- Alliant FX/8
MESSAGE-PASSING MULTICOMPUTER
Message-Passing Network Point-to-point connections
P P ••• P
M M ••• M
Characteristics
- Interconnected computers
- Each processor has its own memory, and
communicate via message-passing
Example systems
- Tree structure: Teradata, DADO
- Mesh-connected: Rediflow, Series 2010, J-Machine
- Hypercube: Cosmic Cube, iPSC, NCUBE, FPS T Series, Mark III
Multilevel View Point of A Machine
The Computer Level Hierarchy
Level 0: Digital Logic Level
OPERATING SYSTEM
COMPUTER
HARDWARE
• Users view
• Systems view
Users view
• User1: sits in front of PC, consisting of a
monitor, keyboard, mouse and system unit.
• User2: Some users sit at a terminal connected
to a mainframe or minicomputer. Other users are
accessing the same computer through other
terminals.
Users view contd……..
• User3: sit at workstation connected to networks of other
workstations and servers. These users have dedicated
resources for their use, but they also share resources
such as networking and servers – file, compute and print
servers.
• User4: handheld computers – individual users – wireless
.
Systems View
• Os is the most intimate with the hardware
• We can view it as a RESOURCE ALLOCATOR -----
LOAD R0, B
ADD R0, C Opcode of Register Address of
STORE A, R0 ADD R0 C
LOAD R0, B
LOAD R1, C Opcode of Register Register Register
ADD R2, R0, R1 ADD R2 R0 R1
STORE A, R0
Instruction Format
• Instruction word should have the complete information required to fetch and
execute the instruction
Specification
0011
0011 01 000 00011 101 00001 00000 110 00010
0010
of src2
Instruction Representation
• Examples of RISC instructions:
ADD.w R2, R0, R1
Size of Specification Specification Specification
Opcode
operands of dst of src1 of src2
• General Purpose registers (GPRs) can store both data and addresses,
i.e., they are combined Data/Address registers
• Constant registers hold read-only values (e.g., zero, one, pi, ...).
• Special Purpose registers store internal CPU data, like the program
counter which indicates where the computer is in its instruction sequence
• Every computer has its own instruction set. The ability to store
and execute , the stored program concept, is the most important
property of a general purpose computer.
OPCODE ADDRESS
Instruction Format
OPERANDS
(DATA)
ADDRESS
AR
PC
DR
ADDER AC
&
LOGIC
INPR
IR
TR
OUTR
COMMON BUS
Computer Instructions
• Computer instruction code format has 16 bits
I OPCODE ADDRESS
15 14 12 11 0
I OPCODE ADDRESS
R1
R2
R3
R4
R5
R6
R7
Load
(7 lines)
SELA { MUX MUX } SELB
3x8
A bus B bus
decoder
SELD
OPR ALU
Page 243
Output
Morris mano
• General Register Organization:—
• When a large number of registers are included
in the CPU, it is most efficient to connect them
through a common bus system. The registers
communicate with each other not only for direct
data transfers, but also while performing various
micro-operations. Hence it is necessary to
provide a common unit that can perform all the
arithmetic, logic and shift micro-operation in the
processor.
• A Bus organization for seven CPU registers:—
• Reference Diagram: Page Number 243 by M Morris Mano
• The output of each register is connected to true multiplexer (mux) to form the two
buses A & B. The selection lines in each multiplexer select one register or the input
data for the particular bus. The A and B buses forms the input to a common ALU. The
operation selected in the ALU determines the arithmetic or logic micro-operation that
is to be performed. The result of the micro-operation is available for output and also
goes into the inputs of the registers. The register that receives the information from
the output bus is selected by a decoder. The decoder activates one of the register
load inputs, thus providing a transfer both between the data in the output bus and the
inputs of the selected destination register.
• The control unit that operates the CPU bus system directs the information flow
through the registers and ALU by selecting the various components in the systems.
• R1 R2 + R3
• (1) MUX A selection (SEC A): to place the content of R2 into bus A
• (2) MUX B selection (sec B): to place the content of R3 into bus B
• (3) ALU operation selection (OPR): to provide the arithmetic addition (A + B)
• (4) Decoder destination selection (SEC D): to transfer the content of the output
bus into R1
• These form the control selection variables are generated in the control unit and must
be available at the beginning of a clock cycle.
ALU
• Arithmetic:
• Addition, Subtraction, Multiplication,
Division
• Logic:
• Comparisons
Control Unit
• Execute
• Does the decoded instruction
• Add 2+2
• Store
• Puts the answer 4 into memory
for use by another instruction
Memory
• Memory unit is needed for • Most common auxiliary
storing programs and data. memory is magnetic disks and
magnetic tapes. They are used
• Memory units that for storing programs, large
communicate directly with data files, and other backup
CPU is called MAIN MEMORY information.
• CPU logic is usually faster than main memory access time, with the result that
processing speed is limited primarily by the speed of the main memory.
• The cache is used for storing segments of programs currently being executed in the
CPU and temporary data frequently needed in the present calculations
• Random access memory, also called the • DYNAMIC RAM: stores the binary
Read/Write memory, is the temporary information in the form of electric charges
memory of a computer. that are applied to the capacitors.
(capacitors are attached to transistors) The
capacitors are provided by the inside the
• It is said to be ‘volatile’ since its contents are chip by the MOS (metal oxide transistor)
accessible only as long as the computer is transistors. The stored charge on the
on. capacitors tend to discharge with time and
the capacitors must be periodically
• The contents of RAM are cleared once the recharged by refreshing the dynamic
computer is turned off. memory.
• PROM
• EPROM
• EEPROM
• Magnetic Disk
• The Magnetic Disk is Flat, circular platter with metallic
coating that is rotated beneath read/write heads. It is a
Random access device; read/write head can be moved
to any location on the platter.
Floppy Disk
Clock Cycle or clock period (Tclock) = time required to execute the operation =I/f
microseconds.
Ex. If Clock speed is 250 MHz can perform one basic operation in the clock
period (Tclock) = 1/250=.004 µs.
NOTE: Operations such as division or floating point numbers requires more than one clock cycle
to complete the execution.
CPU’s processing of an instruction involves several steps
each of which requires at least one clock cycle:
1. Fetch the instruction from main memory M.
2. Decode the instruction's opcode.
3. Load from M any operands needed unless they are
already in CPU registers.
4. Execute the instruction via register to register operation.
5. Store the result in M.
T=N/IPS
T= total program execution time
N= Actual no. of instruction executed.
IPS= Average number of instruction executed per second
CPI= (ƒ * 106)/IPS
CPI= Average no of cycles per instruction.
ƒ = CPU’s clock frequency(MHz).
Hence T=N*CPI/ (ƒ * 106)