Coa ch-1
Coa ch-1
ORGANIZATION
AND
ARCHITECTURE
2
COMPUTER TYPES
Input Arithmetic
and logic
Memory
Output Control
I/O Processor
5
Input Unit
6
Output Unit
7
Memory Unit
• The function of memory unit is to store programs and data
• There are 2 classes of storage:
• Primary Storage:
• Fast memory that operates at electronic speeds
• The memory contains a large number of semiconductor storage cells,
each capable of storing 1 bit of information
• These cells are processed in groups of fixed size called word
• The number of bits in each word is known as word length
• Range from 16 to 64 bits
• To provide easy access to any word in the memory, a distinct
address is associated with each word location
• Addresses are numbers that identify successive locations
8
Memory Unit
9
Memory Unit
• Secondary Storage:
• Is used when large amount of data and many programs have to be
stored
• It contains infrequently accessed information
• Additional & cheaper memory
• Ex: Magnetic disks and tapes & optical disks (CD-ROMs)
10
Arithmetic And Logic Unit
11
Arithmetic and Logic Unit (ALU)
12
Control Unit (CU)
13
Operation of a Computer - Summarized
14
Information Vs Instructions
15
Information Vs Instructions
16
Basic Operational Concepts
17
Connection between the processor and memory
19
Different parts of a processor
20
Execution of an instruction
21
Steps involving Instruction Fetch & Execution
INSTRUCTION FETCH :
22
Steps involving Instruction Fetch & Execution
23
Steps involving Instruction Fetch & Execution
INSTRUCTION EXECUTION :
24
Steps involving Instruction Fetch & Execution
25
Steps involving Instruction Fetch & Execution
26
Execution of an instruction
• MOVE #1,R2 • R2 1
29
The “fetch-execute cycle” – Example Instruction
MOVE NUM1,R1
• Fetch • Execute
• MAR [PC] • MAR NUM1
• PC [PC] + 1 • MDR [MEM([MAR])]
• MDR [MEM([MAR])] • R1 [MDR]
• IR [MDR]
30
Another Example
ADD #1,R1
• Fetch • Execute
• MAR [PC] • R1 1 + [R1]
• PC [PC] + 1
• MDR [MEM([MAR])]
• IR [MDR]
31
Bus Structures
32
Single-bus Structure
Input Output Memory Processor
33
Single-bus Structure
34
Simplified Illustration of a Bus
35
Single-bus Structure
• It’s basic feature is it’s low cost and flexibility for attaching
peripheral devices
• Once buffer is loaded, the printer can start printing without intervention by the
processor
• Prevents high-speed processor from being blocked to a slow i/o device during
a sequence of transfers.
37
Two-Bus Structure
I/O bus
Input
Memory
Output
38
Two-Bus Structure
• The processor interacts with the memory through a
memory bus and handles input/output functions over
I/O bus.
• The memory bus is also called the front side bus, local bus, system bus,, processor
bus or host bus.
• Connects CPU with memory
39
Performance
41
The Processor Cache
Main Cache
memory memory Processor
Bus
42
The Processor Cache
• At the start of execution, all pgm instructions & the required data
are stored in main memory
• Later, if the same instruction/ data item are needed a second time,
it is read directly from the cache
43
The Processor Cache
44
Processor Clock
45
Processor Clock
• Terminology:
• Million - Mega (M) = 106
47
Units of Performance Measurement
• MIPS: Million instructions per second
48
Techniques to improve performance
49
Pipelining and Superscalar Operation
50
Pipelining and Superscalar Operation
51
Pipelining
I1 I2 I3
F1 E1 F2 E2 F3 E3
Sequential Execution
Clock 1 2 3 4
I1 F1 E1
Legends:
I2 F2 E2 I – instruction
F – Fetch
I3 E- Execute
F3 E3
Pipelined Execution 52
Pipelining
53
A 2-issue Superscalar execution
• Fetch 2 instructions every clock
1 2 3 4 5
Time [clocks]
I1 F1 E1
I2 F2 E2
I3 F3 E3
I4 F4 E4
I5 F5 E5
I6 F6 E6
Instr.uctions
54
Clock Rate
55
Instruction Set: CISC & RISC
56
CISC vs RISC
57
Compiler
58
Performance Measurement
• The only parameter that describes the performance of a
computer is the execution time T
59
Performance Measurement
SPEC ratio of 50 means comp. under test is 50 times faster than ref. comp.
60
Performance Measurement
n
SPEC ratio = SPECi
n
i =1
Where,
n – number of pgms in the suite
SPECi – ratio for the pgm i in the suite
61
CHAPTER 2
MACHINE INSTRUCTIONS
AND PROGARMS
62
Memory Locations & Addresses
• Word - group of n bits; n is word length
• Word length ranges from 16 to 64 bits
63
64
Encoded information in a 32 bit word
65
Contd..
66
Address Space
• Address Space of the computer :- The maximum no. of addressable
locations
• With
• k bit address, Address Space= 2k addresses
• 24 bit, A.S=224=16M
• Note : 210=1K
220=1M
230=1G
240=1T
67
Units of Memory
68
Example 1
69
Example 2
70
Memory Operations
• Two basic operations
• Load ( Read or Fetch )
• copy content of a memory location to processor
• Memory contents remain unchanged
• Store (or Write )
• Transfer an information item from processor to a memory location
• Destroys the former contents of that location
• Processor sends the address of desired mem loc
• Read/write one word/byte at a time
• Processor reg. – capable of holding a word used as
source/ destination of transfer.
• When a Byte is to be transferred
- byte located in lower-order position in the reg. is transferred
71
Instructions & Instruction Sequencing
72
• Two types of notations are used to represent the instructions
73
REGISTER TRANFER NOTATION
• Locations involved in Data transfer are:
Location Symbolic names
Memory LOC, A, NUM
Processor register R0, R5
I/O sub system registers DATAIN, OUTSTATUS
74
RTN - Examples
• R1 [LOC]
Means that the contents of location named LOC is transferred into processor
register R1.
• R3 [R1] + [R2]
Add the contents of register R1 and R2, and then place the sum into register
R3
75
ASSEMBLY LANGUAGE NOTATION
• Move LOC,R1
Means that the contents of location LOC is transferred into processor
register R1.
• Add R1,R2,R3
Add the contents of register R1 and R2, and then place the sum into
Register R3.
76
Instruction Execution
& Straight Line Sequencing
Consider a pgm. for C[A]+[B]
77
Program C[A]+[B] in memory
78
Straight Line Sequencing
80
Contd…
• Instruction Execution Phase :
• The operation code of IR is decoded by control unit
• Specified operation is performed using ALU circuits
• Operation may also involve fetching operands from memory or Registers
• Result is stored in destination location
• Increment the contents of PC to point to next instruction
81
A straight-line pgm. to add a list of n numbers
82
Branching
Using a loop to add n numbers.
83
Contd..
84
Contd..
85
Contd…
86
Condition Codes
• Condition code flags : Indicate the data condition or
status after an arithmetic/logical operation
C=1 Z=0
S=1
V=0
90
Acknowledgement
Internet
91