Computer Organization AND Architecture: A.Shenbagharaman, Ap/Cse
Computer Organization AND Architecture: A.Shenbagharaman, Ap/Cse
ORGANIZATION
AND
ARCHITECTURE
A.SHENBAGHARAMAN, AP/CSE
COMPUTER
ORGANISATION
AND
ARCHITECTURE
• The components from which computers are
built, i.e., computer organization.
• In contrast, computer architecture is the science
of integrating those components to achieve a
level of functionality and performance.
• It is as if computer organization examines
the lumber, bricks, nails, and other building
material
• While computer architecture looks at the design
of the house.
UNIT-I INTRODUCTION
ENTERPRISE SYSTEM
(MAINFRAME)
•More computational power
•Larger storage capacity
•Used for business data processing in large
organization
•Commonly referred as servers or super
computers
SERVER SYSTEM
SUPER COMPUTERS
• Peripheral devices
– Used to expand the
computer’s input, output and
storage capabilities.
Basic
Terminology
• Input
– Whatever is put into a computer system.
• Data
– Refers to the symbols that represent facts, objects, or ideas.
• Information
– The results of the computer storing data as bits and bytes; the
words, numbers, sounds, and graphics.
• Output
– Consists of the processing results produced by a computer.
• Processing
– Manipulation of the data in many ways.
• Memory
– Area of the computer that temporarily holds data waiting to be
processed, stored, or output.
• Storage
– Area of the computer that holds data on a permanent basis when it is
not immediately needed for processing.
Basic Terminology
Calvin College
FUNCTIONAL UNITS
OF COMPUTER
• Input Unit
• Output Unit
• Memory
• Bus Structure
The Big
Picture
Processor
Input
Control
Memory
ALU
Output
• NOTHING
ELSE!
INPUT UNIT:
OUTPUT UNIT:
T1 Enable R1
T2 Enable R2
T4
•Control unit works with
a reference signal called
T1 processor clock
•Two types are RAM or R/W memory and ROM read only memory
W/R
0 1 1
CS RD
A0
PROCESSOR
1 0 0
A1
1 0 1
A2 ADDRESS BUS
1 1 0
D7 D0
D0 D7
1 1 1
DATA BUS
Cont:-
•Clock speed
Example 2
A computer has 128 MB of memory. Each word in this computer
is eight bytes. How many bits are needed to address any single
word in memory?
Solution
The memory address space is 128 MB, which means 227.
However, each word is eight (23) bytes, which means that we
have 224 words. This means that we need log2 224, or 24 bits, to
address each word.
Assignment of byte
addresses
• Little Endian (e.g., in DEC, Intel)
» low order byte stored at lowest
address
» byte0 byte1 byte2 byte3
• Programmers/protocols should be
careful when transferring binary data
between Big Endian and Little Endian
machines
• In case of 16 bit data, aligned words begin
at byte addresses of 0,2,4,
………………………….
• In case of 32 bit data, aligned words begin
at byte address of 0,4,8,………………………….
• In case of 64 bit data, aligned words begin
at byte addresses of 0,8,16,
………………………..
• In some cases words can start at an
arbitrary byte address also then, we say
that word locations are unaligned
MEMORY
OPERATIONS
• Today, general‐purpose computers use a set of instructions called
a
program to process data.
• R2 [LOCN
]
• R4 [R3] +
[R2]
ASSEMBLY
LANGUAGE
• NOTATION
RTN is easy to(ALN)
understand and but cannot
be used to represent machine instructions
• Mnemonics can be converted to
machine language, which processor
understands using assembler
Eg:
1. MOVE LOCN, R2
2. ADD R3, R2, R4
TYPE OF
INSTRUCTION
Three address instruction
}
Begin execution here i Move A,R0
Add B,R0 i
3-instruction program
+4 Move R0,C
. segment
.
i+8 .
A
.
.
.
C
• PC – Program counter: hold the address of the
next instruction to be executed
• Straight line sequencing: If fetching and executing
of instructions is carried out one by one from
successive addresses of memory, it is called
straight line sequencing.
• Major two phase of instruction execution
• Instruction fetch phase: Instruction is fetched
form memory and is placed in instruction
register IR
• Instruction execute phase: Contents of IR is
decoded and processor carries out the operation
either by reading data from memory or registers.
BRANCHING
• N– 1 if results are
Negative Negative 0 if results
are Positive 1 if results
• Z – Zero are Zero
0 if results are Non
• V– zero
• C –
Overflow 1 if arithmetic overflow
Carry 0 ifoccurs
there is0 no
noncarry
overflow
from occurs
MSB
bit 1 if carry and from MSB bit
Figure Format and different instruction types
Processing the instructions
Simple computer, like most computers, uses machine cycles.
During the execute phase, the instruction is executed and the results are
placed in the appropriate memory location or the register.
Once the third phase is completed, the control unit starts the cycle again,
but now the PC is pointing to the next instruction.
The process continues until the CPU reaches a HALT instruction.
Types of Addressing Modes
The different ways in which the location of the
operand is specified in an instruction are referred to
as addressing modes
• Immediate Addressing
• Direct Addressing
• Indirect Addressing
• Register Addressing
• Register Indirect Addressing
• Relative Addressing
• Indexed Addressing
Immediate
• Operand Addressing
is given explicitly in the
instruction
• Operand = Value
• e.g. ADD 5
– Add 5 to contents of accumulator
– 5 is operand
• No memory reference to fetch data
• Fast
• Limited range
Instruction
opcode
operand
Direct
Addressing
• Address field contains address of operand
• Effective address (EA) = address field (A)
• e.g. ADD A
– Add contents of cell A to accumulator
– Look in memory at address A for operand
• Single memory reference to access data
• No additional calculations to work out effective
address
• Limited address space
Direct Addressing
Diagram
Instruction
Opcode Address A
Memory
Operand
Indirect Addressing
(1)
• Memory cell pointed to by address
field contains the address of (pointer
to) the operand
• EA = [A]
– Look in A, find address (A) and look there
for operand
• e.g. ADD (A)
– Add contents of cell pointed to by contents of A
to accumulator
Indirect Addressing
(2)
• Large address space
• 2n where n = word length
• May be nested, multilevel, cascaded
– e.g. EA = (((A)))
• Draw the diagram yourself
• Multiple memory accesses to find
operand
• Hence slower
Indirect Addressing
Diagram Instruction
Opcode Address
A Memory
Pointer to operand
Operand
Register Addressing
(1)
• Operand is held in register named in
address field
• EA = R
• Limited number of registers
• Very small address field needed
– Shorter instructions
– Faster instruction fetch
Register Addressing
(2)
• No memory access
Operand
Register
Indirect
• Addressing
C.f. indirect addressing
• EA = [R]
• Operand is in memory cell pointed to
by contents of register R
• Large address space (2n)
• One fewer memory access than
indirect addressing
Register Indirect
Addressing
Diagram
Instruction
Opcode Register Address
R Memory
Registers
Instruction
Opcode Register Constant Value
R Memory
Registers
• Emphasis on hardware
• Includes multi-clock complex
instructions
• Memory-to-memory:
"LOAD" and "STORE"
incorporated in
instructions
• Small code sizes,
high cycles per
second
• Transistors used for storing
complex instructions
Con’s
• Emphasis on software
• Single-clock,
reduced instruction
only
• Register to register:
"LOAD" and "STORE"
are independent
instructions
• Low cycles per second,
large code sizes
• Spends more transistors
on memory registers
Performanc
e
• The CISC approach attempts to
minimize the number of instructions
per program, sacrificing the number
of cycles per instruction. RISC does
the opposite, reducing the cycles per
instruction at the cost of the
number of instructions per
program.
Characteristics of RISC Vs CISC
processors
No RISC CISC
1 Simple instructions taking one Complex instructions taking
cycle multiple cycles
2 Instructions are executed by Instructions are executed by
hardwired control unit microprogramed control
unit
3 Few instructions Many instructions