You are on page 1of 30

The CPU & Memory:

y
Organization

CSC159 – Computer Organization


L
Lesson Outcomes
O t
 Central Processing Unit (CPU)
 Components of the CPU (CU and ALU)
 Registers, Buses, and Clock
C
 Memory
 Types of Memory (Magnetic core, RAM, and
ROM)
 Memory Hierarchy
 Memory Operations (read/write)
 Memory Capacity

UiTM Terengganu - naza The CPU and Memory: Organization 2


Central Processing Unit (CPU)
What is the CPU?

 Interprets and carries out basic instructions that


operate a computer
 It controls the action, performs the calculations,
& manipulates the data
 Al called
Also ll d the
th processor
 With the advent of integrated circuit technology,
the entire CPU of today, resides in a micro chip 
microprocessor
i
 Miniature silicon chip found in computers that is
the heart of the computer

UiTM Terengganu - naza The CPU and Memory: Organization 3


CPU Components
 The processor contains four key
components:
Clock

Arithmetic
Control Unit Logic Unit

Registers

UiTM Terengganu - naza The CPU and Memory: Organization 4


Control Unit
 Directs and coordinates operations in the
computer
 Fetches instruction from the memory
 It contains all that the microprocessor
knows, in what is called a microprogram
(contains the entire instruction set, resides
in an internal ROM)
O )

UiTM Terengganu - naza The CPU and Memory: Organization 5


Control Unit (cont.)
(cont )
 Instruction Decoder
 Instruction decoding is the process whereby
the microprocessor interprets the bit pattern
appearing in the instruction decoder register
 The microprocessor knows “how”how to add
(through the instruction set) but does not
know “when” or “what” to add
 The word or instruction to add needs to be
decoded or interpreted by the instruction
decoder
UiTM Terengganu - naza The CPU and Memory: Organization 6
Arithmetic / Logic Unit (ALU)
 CPU componentt ththatt performs
f ti
execution
part of the machine cycle
ARITHMETIC
(addition, subtraction,
multiplication, and
division)

COMPARISON
LOGICAL
(greater than, equal
(AND, OR, NOT)
to, or less than)

UiTM Terengganu - naza The CPU and Memory: Organization 7


Register
 Temporary storage area that holds data and
instructions
 Data registers (or general purpose registers)
 Used for a variety of operations & as temporary storage
areas for data before processing
 The number of general purpose registers available depends
on the manufacturer’s design
 Address registers
 Specifically for addressing
 When data is read from memory, the address of the data
must be placed on the address bus
 Include index, page and stack registers

UiTM Terengganu - naza The CPU and Memory: Organization 8


Bus
 All of the CPU elements are connected
together in a bus structure
 A bus – parallel electrical lines or paths
connecting a source to a destination
– a common path used for specific
exchange of data between various
parts off CPU
C

UiTM Terengganu - naza The CPU and Memory: Organization 9


System Clock
 Generates precisely timed electronic pulses
 Synchronizes all computer operations
 Each tick is a clock cycle that determines when the
next machine cycle will occur
 MHz – one million ticks p
per second of system
y clock
– theoretically, capable of executing one
million instructions per second
 GHz – one billion ticks per second of system clock

UiTM Terengganu - naza The CPU and Memory: Organization 10


e-time i-time

 an instruction is fetched by the Control Unit during instruction


time (i-time) and executed by the ALU during execution time (e-
time)
 together both steps make up a single machine cycle & the
together,
process is repeated until the program is finished
 the clock drives the process by generating pulses at precisely
timed intervals

UiTM Terengganu - naza The CPU and Memory: Organization 11


Memory
 Also known as main memory / internal
memory / primary storage / working storage
 Holds programs,
programs instructions and data for
access by the CPU
 Made up of a large number of cells
cells, each
with its own address
CPU
Control Unit , ALU, I/O Interface Memory

naza The CPU and Memory: Organization 12


Types of Memory
CORE • Magnetic Core Memory

SRAM • Static Random Access Memory


y

DRAM • Dynamic Random Access Memory

ROM • Read Only Memory

Volatile Nonvolatile
Loses contents when power is Retains contents when power is
removed removed

naza The CPU and Memory: Organization 13


Magnetic Core Memory
 Uses small core of magnetic
material to hold a bit of data
 Magnetism remains after current
is removed  nonvolatile
 Expensive & slow in comparison
 Has been replaced by RAM except for few
computers where loss of data would be
severely damaging

naza The CPU and Memory: Organization 14


Random Access Memory (RAM)
 Temporary storage and working space for the
operating system and applications
 SRAM vs DRAM: both volatile but differs in technical
design

Static RAM Dynamic RAM


 Faster & requires less  Slower & needs more power
power (additional circuitry)
 Does not require  Data needs to be refreshed
refreshing periodically
 More expensive  Less expensive
 Often used as “cache  Used as main memory
memory”

naza The CPU and Memory: Organization 15


Read Only Memory (ROM)

 ROM chips are nonvolatile


non olatile and cannot be
changed by the user
 CPU can read,
read or retrieve data and programs
but the computer cannot write
 To store firmware that contain special
instructions
 Needed to start a computer
 Give keyboard keys their special capabilities
 Put characters on screen

naza The CPU and Memory: Organization 16


Read Only Memory (ROM) cont.
cont

 Newer ROMs can be erased & rewritten:


 EEPROM – Electrically Erasable
Programmable
g ROM
 Flash ROM
 Allow rewritingg by
y erasing
g memory y cells
selectively, then writing new data into those
cells
 Flash ROM is faster & more flexible  used
in hand phones, MP3 players and digital
cameras
naza The CPU and Memory: Organization 17
Memory Hierarchy
Device Typical Access Times Throughput Rate
CPU Registers

Cache Memory (SRAM) 15 to 30 nanoseconds


Conventional Memory (DRAM) 50 to 100 nanoseconds

Expanded Storage (RAM) 75 to 500 nanoseconds

Hard Disk Drive 10 to 50 milliseconds 600 to 6,000 KB/sec


Floppy Disk 95 milliseconds 100 to 200 KB/sec
CD-ROM 100 to 600 milliseconds 500 to 4,000 KB/sec
Tape .55 and up seconds 2 000 KB/sec (cartridge)
2,000

naza The CPU and Memory: Organization 18


Speed

 Measured by access time and data transfer


rate
 Access time: average time it takes a
computer
p to locate data and read it
 millisecond = one-thousandth of a second
 Data transfer rate: amount of data that
moves per second

naza The CPU and Memory: Organization 19


Memory Operations: Little
Littl Man
M Computer
C t

naza The CPU and Memory: Organization 20


Memory Operations: Little
Littl Man
M Computer
C t

naza The CPU and Memory: Organization 21


Memory Operations (cont.)
(cont )
Registers differ from memory:
 Used to hold a binary value temporarily for
storage,
g for manipulation, and/or for simple
calculations
 Unlike memory, where every address is just like
every other address
address, each register wired within
the CPU serves a particular purpose
 They are not addressed as a memory location
would be, but instead are manipulated directly by
the CU during execution of instructions

naza The CPU and Memory: Organization 22


Memory Operations (cont.)
(cont )

1. PC  Holds address of current instruction


being executed
2. IR  holds actual instruction being
executed currently by the computer
3. MAR  holds
h ld address
dd off a memory
location
4
4. MDR  holds a data value
al e that is being
stored to or retrieved from the memory
location currently addressed by MAR
naza The CPU and Memory: Organization 23
Memory Operations: Relationship
between MAR, MDR and Memory
Address Data

naza The CPU and Memory: Organization 7-24


Memory Operations (cont.)
(cont )
 MAR & MDR act as an interface between CPU &
memory
 Each cell in memory unit holds one bit of data
 C ll are organized
Cells i d in
i rows
 Each row consists of a group of one or more bytes
(word)
 MAR holds address in memory that is to be
“opened” for data
 MAR connected to a decoder that interprets the
address & activates a single address line in
memory

naza The CPU and Memory: Organization 25


Memory Operations (cont.)
(cont )

naza The CPU and Memory: Organization 7-26


Memory Operations (cont.)
(cont )

naza The CPU and Memory: Organization 7-27


Memory Capacity
 2 factors determine the capacity
p y of memory
y in
a computer
1. Number of bits in the MAR
 For a MAR of width k bits, the number of
possible memory addresses is
M = 2k
2. Number of bits in the address field of the
instruction set
10101010 100100100100100111000000
0 7 8 31

naza The CPU and Memory: Organization 28


Memory Capacity
 The size of the instruction word,
word in bits,
bits
depends on the particular CPU,
particularly the design of its instruction
set
 Modern computers usually have a word
size of 16, 32, or 64 bits. Many other
sizes have been used in the past,
p ,
including 8, 12, 18, 24, 36, 39, 40, 48, and
60 bits

naza The CPU and Memory: Organization 29


Memory Capacity
Memory Size In Bytes Formula
1 kilobyte (KB) 1024 210

1 megabyte (MB) 1024 x 1024 220

1g
gigabyte
gaby e (G
(GB)) 1024
0 x 1024
0 x 1024
0 230

1 terabyte (TB) 1024 x 1024 x 1024 x 1024 240

A computer
computer’s
s memory specification is 128KB RAM.
RAM Calculate:
 Memory capacity in byte
128 x 1024 bytes = 131 072 bytes
 Address size
128 KB = 27 x 210 = 217
 Address size = 17 bits
 L
Largest
t address
dd
217 – 1 = 131 071
naza The CPU and Memory: Organization 30

You might also like