HPC Lecture3
HPC Lecture3
ALU Registers
Control
Memory
Bus
3
Inside the Processor…
Control hardware: Hardware to manage
instruction execution
ALU: Arithmetic and Logical Unit (hardware
to do arithmetic, logical operations)
Registers: small units of memory to hold
data/instructions temporarily during
execution
4
Aside: About Memory
What is memory?
Something that can remember things
There are different kinds of memory in a
computer system
Some remember by the state an electrical circuit
is in e.g., SRAM
Others remember by the amount of electrical
charge stored in a capacitor e.g., DRAM – “Memory”
Yet others remember by magnetic or optical
properties e.g., Hard disk drive/Mag Tape, VCD/DVD
They can vary substantially in their speed
and capacity
5
Inside the Processor…
Control hardware: Hardware to manage
instruction execution
ALU: Arithmetic and Logical Unit (hardware
to do arithmetic, logical operations)
Registers: small units of memory to hold
data/instructions temporarily during
execution
There are 2 kinds of registers in a CPU
1. Special purpose registers
2. General purpose registers
6
Special Purpose Registers
These are used for specific purposes by the
control hardware
Program Counter (PC): used to remember
the location in memory of the instruction
currently being executed
Instruction Register (IR): used to remember
that instruction
Processor Status Register: used to
remembers status information about current
state of processor, e.g., whether an
arithmetic overflow has occurred
7
General Purpose Registers
Available for use by the programmer
Useful for remembering frequently used data
Why is it a good idea to do this?
8
Why use General Purpose Registers?
There is a large speed disparity between the
processor (CPU) and the memory where
instructions and data are stored
Consider a 1 GHz processor
This frequency corresponds to a 1 nanosecond time
scale
milli (10-3), micro (10-6), nano (10-9)
G (giga) 230 for memory; 109 for frequency, disk size
Memory: ~ 100 nanosecond time scale
Aside: More on nanosecond
Speed of light: ~ 300,000 km/sec or ~ 0.3 m/nsec
9
General Purpose Registers.
Available for use by the programmer
Useful for remembering frequently used data
A typical processor today has 32 GPRs, say
R0, R1,…, R31
The operands to an instruction could come
either from registers or from main memory
10
Basic Computer Organization
General Purpose
Registers
CPU Integer
Control
Main
Special Purpose
MMU Cache Memory Registers
PC
IR
Bus Status
register
11
Main Memory
Holds instructions and data
View it as a sequence of locations, each
referred to by a unique memory address
If the size of each memory location is 1 Byte,
we call the memory byte addressable
This is quite typical, as the smallest data
(character) is represented in 1 Byte
Larger data items are stored in contiguous
memory locations, e.g., a 4Byte float would
occupy 4 consecutive memory locations
12
Terms: Byte ordering
In Hexadecimal (0,1,2,…,A,B,C,D,E,F)
Data 1A C8 B2 46 F0 8C 1E DF
Byte Address 400 401 402 403 404 405 406 407
13
Byte ordering
Data 1A C8 B2 46 F0 8C 1E DF
Byte Address 400 402 404 406
14
Byte ordering.
Data 1A C8 B2 46 F0 8C 1E DF
Byte Address 400 402 404 406
15
Byte ordering..
Data 1A C8 B2 46 F0 8C 1E DF
Byte Address 400 402 404 406
16