Professional Documents
Culture Documents
UNIT1
Why COA?
• to know how system works internally
• knowledge is helpful in improving performance
• Performance-> The speed with which a computer
executes programs is affected by the design of its
instruction set, its hardware and its software,
including the operating system, and the
technology(VLSI)
---- improving technology
---- using parallelism( instruction level, multicore,
multiprocessors)
COMPUTER ARCHITECTURE Vs
COMPUTER ORGANISATION
Computer Architecure
STEPS OF EXECUTION
1. the instruction is fetched from the memory into the processor. I
2. Next, the operation to be performed is determined by the control unit.
LOAD
3. The operand at LOC is then fetched from the memory into the processor.
VALUE/DATA STORED AT LOC
4. Finally, the operand is stored in register R2.
• After completing the desired operations, the results are in processor registers.
They can be transferred to the memory using instructions such as
Store R4, LOC
--This instruction copies the operand in register R4 to memory location LOC. The
original contents of location LOC are overwritten, but those of R4 are
preserved.
NOTE: The data transfer b/w main memory and processor(registers) is done by
generating control signals– RD control signal, WR control signal by The
processor-memory interface
BUS
• A bus is a common pathway through which
information flows from one computer
component to another.
• It is a group of wires or lines that serves as a
connecting path for several devices.
• When a word is transferred over a bus, all bits
are transferred in parallel ie 1 bit per line.
Functions of Buses in Computers
• 1. Data sharing - All types of buses found in a
computer transfer data between the computer
peripherals connected to it.
• 2. Addressing - A bus has address lines, which match
those of the processor. This allows data to be sent to or
from specific memory locations.
• 3. Power - A bus supplies power to various peripherals
connected to it.
• 4. Timing - The bus provides a system clock signal to
synchronize the peripherals attached to it with the rest
of the system.
The CPU and memory are normally connected
by three groups of connections, each called a
bus: data bus, address bus and control bus
•Address bus : unidirectional : group of wires which carries
address information bits form processor to peripherals
(16,20,24 or more parallel signal lines)
•23 = 8 i.e. 3 address line is required to select 8 location
Single bus
• All units are connected to it.
• Only one transfer at a time
• Low cost
• Flexibility in attaching to different peripherals
Multiple buses
• More than one transfer at same time(concurrency)
• More cost, less time
• Eg: In two – bus structure : One bus can be used to fetch
instruction other can be used to fetch data, required for
execution.
MULTIPLE BUS STRUCTURE
Bus Terminologies
• Computers have two major types of buses:
1. System bus:- This is the bus that connects the CPU
to the main memory on the motherboard. The system
bus is also called the front-side bus, memory bus, local
bus, or host bus.
2. A number of I/O Buses, (I/O is an acronym for
input/output), connecting various peripheral devices to
the CPU. These devices connect to the system bus via a
‘bridge’ implemented in the processors' chipset. Other
names for the I/O bus include “expansion bus",
"external bus” or “host bus”.
•
Buffer registers
Need?
Different components work at different speeds like,
processor and memory operate at electronic speeds
but externals devices are relatively slow.
BUFFER REGISTERS
• are used to hold information during transfer to smooth
out the timing differences
• prevent processor from being locked by a slow I/O
device
• allow processor to rapidly switch between devices
Eg: printing process- processor transfer all data to be
printed buffer, then printer continues printing from
buffer without intervention of bus and processor.
Instructions
Instruction:
A computer must have instructions capable of performing four types of
operations:
• Data transfers between the memory and the processor registers
• Arithmetic and logic operations on data
• Program sequencing and control
• I/O transfers
Add C, A ,B // C=A+B
// store result in C
• A, B-source operands
• C-destination operands
• Advantage: Single instruction can perform the complete operation
• Disadvantage : Instruction code will be too large to fit in one word location in memory
To perform above operation (ADD A,B,C) using 2 address format, we need 2 instructions
Branch instruction are those which changes the normal sequence of execution.
This type of instruction loads a new address into the program counter, when branch (loop)
condition is satisfied.
As a result, the processor fetches and executes the instruction at this new address, called the
branch target
If the condition is not satisfied, the PC is incremented in the normal way, and the next
instruction in sequential address order is fetched and executed.
Sequence can be changed either conditionally or unconditionally.
Accordingly we have conditional branch instructions and unconditional branch instruction.
Conditional branch instruction changes the sequence only when certain conditions are met.
Unconditional branch instruction changes the sequence of execution irrespective of condition
of the results.
Eg: Adding N nos. // read
Branching
Condition codes
• CONDITIONAL CODE FLAGS: The processor keeps track of
information about the results of various operations for use by
subsequent conditional branch instructions.
• These flags are grouped together in a special processor register
called “condition code register” or “status register”
• Individual condition code flags-1 or 0.
• 4 commonly used flags.
• 1) N (negative)-set to 1 if result is –ve or else 0.
• 2) Z (zero)-set to 1 if result is 0, or else 0 .
• 3) V (overflow)-set to 1if arithmetic overflow occurs or else 0.
overflow occurs when the result of an arithmetic operation is
outside the range of values that can be represented by the number
of bits available for the operands
• 4) C(carry)-set to 1 if carry out results from operation or else 0
Memory Locations and Addresses
• The memory consists of many millions of storage cells, each of
which can store a bit of information having the value 0 or 1.
• Data is transferred to and from memory in groups of bits called
words. A word can be a group of 8 bits, 16 bits, 32 bits or 64 bits
(and growing).
Operand
1) Absolute mode
the address of the memory location(Absolute mode) where
the operand is located.
eg: A declaration such as Integer NUM1, NUM2, SUM;
In HLL , it will cause the compiler to allocate a memory
location to each of the variable.
EA= Memory_LOC
Whenever they are referenced later in the program, the
compiler can generate assembly-language instructions that
use the Absolute mode to access these variables.
Load R2, NUM1
2) Register mode
• 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
• No memory access
• Very fast execution
• Very limited address space
• Multiple registers helps performance
– Requires good assembly programming or compiler writing
Pointer to operand
Operand
1) 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
Registers
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