coa
coa
ORGANIZATION
AND
ARCHITECTURE
Functional Units
Input Arithmetic
and logic
Memory
Output Control
I/O Processor
2
Input Unit
• Input Unit reads the data
• The most common Input devices are Keyboard,
joystick, trackballs, microphone and mouse
3
Output Unit
• Counterpart of I/P unit
• Its function is to send processed results to
outside world
• The familiar example of output device is
printer (various types)
4
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
5
• Memory in which any location can be reached in a
short and fixed amount of time after specifying its
address is RAM
• Time required to access one word is called the
memory access time
• Memory of a computer is normally implemented as
a memory hierarchy of 3 or 4 levels of
semiconductor RAM units with different speeds &
sizes
• The small, fast, units are called caches
• The largest & slowest unit is referred to as the
main memory
• Primary storage is expensive
6
• 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)
7
Arithmetic And Logic Unit
• ALU performs all the arithmetic and logic
operations
• For ex: addition, multiplication, division,
comparison etc
• Any operation is initiated by bringing the
required operands into the processor, where
the operation is performed by the ALU
• When operands are brought into the
processor, they are stored in high- speed
storage elements called registers
8
• Each register can store one word of data
• Access time to registers are faster than cache
unit
• CU & ALU are many times faster than other
devices connected to a computer system
• This enables a single processor to control a
number of external devices such as keyboards,
displays, magnetic & optical disks, sensors &
mechanical controllers
9
Control Unit
• It controls the entire operations of the computer
• The control unit is the nerve centre that sends control
signals to other units and senses their states
• The timing signals that govern the I/O transfers are
generated by control circuits
• Timing signals are signals that determine when a
given action is to take place
• Data transfers b/w processor & memory are also
controlled by CU through timing signals
• A large set of control lines (wires) carries the signals
used for timing & synchronization of events in all units
10
Operation of a Computer - Summarized
11
Basic Operational Concepts
• For processing, individual instructions are brought from memory into
the processor, which executes the specified operations
• Data to be used as operands are also stored in memory
• A typical instruction may be:
Add A,R0
• Adds the operand at memory location A to the operand in register R0
and store the result in R0
• The original content of A is preserved, whereas R0 are overwritten
• Instruction requires several steps
Load A, R1
Add R1,R0
• The first instruction transfers the contents of A into the processor
register R1
• The second instruction adds the contents of R1 and R0 and places the content
in R0
12
Connection between the processor and memory
Control
Unit
Arithmetic
Logic Unit
13
• CPU = ALU + CU + registers
• Diff: types of registers are:
• IR (instruction register):
• Holds the instruction that is currently being executed
• Its o/p is available to control circuits, which generate the timing
signals that control the various processing elements involved in
executing the instruction
• PC (program counter):
• Keeps track of the execution of a pgm
• Contains the memory address of next instruction to be fetched &
executed
• During the execution of an instruction, the contents of PC are
updated to correspond to the address of next instruction that is to
be fetched from the memory
• PC points to the next instruction that is to be fetched from memory
14
• n general- purpose registers (R0 thru’ Rn-1):
• are used for holding data, intermediate results of operations.
• They are also known as scratch-pad registers.
15
Computer Instructions
• Assembly Language
• Register Transfer
Notation
• MOVE NUM1,R1
• R1 ← [NUM1]
• MOVE #1,R2
• R2 ← 1
• ADD #1,R1
• R1 ← 1 + [R1]
• ADD R1,R2
• R2 ← [R1] + [R2]
16
The “fetch-execute cycle”
• Fetch the instruction whose address is
in the program counter
• Increment the PC so it holds the
address of the next instruction
• Execute the instruction just fetched
• Fetch the next instruction
• Etc.
17
Steps involving Instruction Fetch & Execution
INSTRUCTION FETCH
18
• The addressed word (here it is the first
instruction of the program) is read out of
memory and loaded into the MDR
19
INSTRUCTION EXECUTION
21
• Fetching the operands from the memory requires
sending the memory location address to the
MAR and initiating a Read cycle
• The operand is read from the memory into the
MDR and then from MDR to the ALU
• The ALU performs the desired operation on one
or more operands fetched in this manner and
sends the result either to memory location or to
a GP register
22
Example Instruction
MOVE NUM1,R1
• Fetch • Execute
• MAR ← [PC] • MAR ← NUM1
• PC ← [PC] + 1 • MDR ← [MEM([MAR])]
• MDR ← [MEM([MAR])] • R1 ← [MDR]
• IR ← [MDR]
23
Another Example
ADD #1,R1
• Fetch • Execute
• MAR ← [PC] • R1 ← 1 + [R1]
• PC ← [PC] + 1
• MDR ← [MEM([MAR])]
• IR ← [MDR]
24
Bus Structures
• A group of lines that serves as a
connecting path for several devices is
called a bus
• Bus must have lines for
• Data
• Address
• Control
25
Single-bus Structure
Memor Process
Input Output
y or
27
• Transfer of a character from a processor to a
character printer
• Processor sends the character to the
printer buffer
• Once buffer is loaded, the printer can start
printing without intervention by the
processor
• The system bus is also called the front
side bus, memory bus, local bus, or
host bus.
28
29
Simplified Illustration of a Bus
30
Two-Bus Structure
I/O bus
Input
Memory
Processor
Output
31
• The bus is said to perform two distinct functions
by connecting the I/O units with memory and
processor unit with memory. The processor
interacts with the memory through a memory bus
and handles input/output functions over I/O bus.
32
• Million - Mega (M)
• Billion - Giga (G)
• 500 million cycles/sec – 500 MHz
• Clock period is 2 ns
• 1250 million cycles/sec – 1.25 GHz
• Clock period is 0.8 ns
33
Processor Clock
• Processor circuits are controlled by a timing
signal called a clock
• The regular time intervals are known as
clock cycles
• To execute machine instructions the
processor divides the action into a sequence
of steps such that each step can be
completed in one clock cycle
• The length P of one clock cycle is an
important performance parameter of
processor 34