Unit 1
Unit 1
AND ARCHITECTURE
SYLLABUS
OBJECTIVES:
• To learn the basic structure and operations of a computer.
• To learn the arithmetic and logic unit and implementation of
fixed-point and floating point arithmetic unit.
• To learn the basics of pipelined execution.
• To understand parallelism and multi-core processors.
• To understand the memory hierarchies, cache memories and
virtual memories.
• To learn the different ways of communication with I/O devices.
SYLLABUS
Computer Architecture
How to integrate the components to build a computer
system to achieve level of performance.
INTRODUCTION
Computer Architecture
Computer architecture encompasses the specification of
an instruction set and the functional behavior of the
hardware units that implement the instructions.
Historical perspective
constant quest of building automatic computing machines have
driven the development of computers.
Initial efforts: mechanical devices like pulleys, levers, gears.
8000 parts
Weighted 5 tons.
11 feet in length
Babbage engine
ENIAC
ENIAC - Electrical Numerical Integrated and
Calculator.
Desktop processors
1. Embedded computers
2. Personal computers
Classification in PC
Portable and Notebook computers - provide the basic features of a personal computer
in a smaller lightweight package.
Servers and Enterprise systems
Large computers capable of share large number of
users and it can be access from PC over a public or
private network.
High cost.
Input
Memory
Output
Control units
Functional Units
Five main parts
Input
Memory
Output
Control units
Functional Units
Information Handled by a
Computer
Instructions/machine instructions
Program
Data
Source program
Two classes
Primary Storage
Secondary Storage
Memory Unit
Primary Memory
Main memory
Fast
Processed in words
Address
Adjunct to the main memory, a smaller, faster RAM unit, called a cache.
Access times for secondary storage are longer than for primary
memory.
magnetic disks, optical disks (DVD and CD), and flash memory
devices.
Arithmetic and Logic Unit
Computer operations are executed in the arithmetic and logic unit
(ALU) of the processor.
When operands are brought into the processor, they are stored in high-
speed storage elements called registers.
Access times to registers are even shorter than access times to the cache
unit on the processor chip.
Output Unit
Its function is to send processed results to the
outside world.
The timing signals that govern the I/O transfers are also generated by the control unit.
Control unit is usually distributed throughout the machine instead of standing alone.
Operations of a computer:
Accept information in the form of programs and data through an input unit and store it in the
memory
Fetch the information stored in the memory, under program control, into an ALU, where the
information is processed
Individual instructions are brought from the memory into the processor which
executes operation.
Instruction
• Reads the contents of a memory location and loads them into processor register
R2.
• The original contents of location LOC are preserved register R2 are overwritten.
Basic Operational Concepts
After operands have been loaded from memory into processor
registers, arithmetic or logic operations can be performed on
them.
R4 are preserved.
IR
PC
Hardware
Software
Operating system
Defining Performance
If you were running a program on two different desktop computers,
Ans 1.5
Measuring Performance
Time is the measure of computer performance: the computer that
performs the same amount of work in the least time is the fastest.
CPU execution time or simply CPU time, is the time the CPU
spends computing for this task
Measuring Performance
CPU time can be further divided into the CPU time spent
in the program, called user CPU time, and the CPU time
spent in the operating system performing tasks on behalf of
the program, called system CPU time.
All computers are constructed using a clock that determines when events
take place in the hardware.
These discrete time intervals are called clock cycles (or ticks, clock ticks,
clock periods, clocks, cycles)
Designers refer to the length of a clock period both as the time for a
complete clock cycle (e.g., 250 picoseconds, or 250 ps) and as the clock
rate (e.g., 4 gigahertz, or 4 GHz), which is the inverse of the clock period.
CPU Performance and Its Factors
Clock rate:
Instruction Performance
CPU clock cycles = Instructions for a program X
Average clock cycles per instruction
add a, b, c
a = b + c;
d = a – e;
add a, b, c
sub d, a, e
Operations of the Computer Hardware
f = (g + h) – (i + j);
f = (g + h) – (i + j);
add $t0,$s1,$s2
Operand
MIPS Addressing Mode
Indirect
The instruction contain fields that holds memory
address which turns holds memory address of the
of the operand.
Ex
add $s0,(206A)
MIPS Addressing Mode
OPCODE OPERAND ADDRESS
206A
Operand
MIPS Addressing Mode
Register addressing
The operand held in a register and instruction
specifies register number.
Ex
add $s0,$s1,$s2
MIPS Addressing Mode
OPCODE Register no
Register bank
operand
MIPS Addressing Mode
Register indirect addressing
The instruction specifies a register and register
holds the memory address
Ex
add $s0,$s1,($s2)
MIPS Addressing Mode
OPCODE Register no
Register bank
206A
memory
operand
MIPS Addressing Mode
Relative addressing
The instruction specifies an offset of displacement
which is added to the pc to get an effective address.
MIPS Addressing Mode
Indexed addressing
The instruction specifies an offset of displacement
which is added to the index register to get an
effective address.
Ex load $s2,1050($s3)
$s2=mem[1050+$s3]
MIPS Addressing Mode
Indexed addressing
The instruction specifies an offset of displacement
which is added to the index register to get an
effective address.
Ex load $s2,1050($s3)
$s2=mem[1050+$s3]