You are on page 1of 54

Edited on March 2020

LESSON OUTCOMES
Upon completion of this chapter, students should understand about:

Components of the CPU (CU and ALU)


Registers, Buses, and Clock

Types of Memory (MagneDc core, RAM, and


ROM)
Memory Hierarchy
Memory OperaDons (read/write)
Memory Capacity
WHAT IS MICROPROSSEOR?
CPU/MICROPROSSEOR

Ø Interprets and carries out basic instrucDons that


operate a computer.
Ø It controls the acDon, performs the calculaDons, &
manipulates the data.
Ø Also called the processor
² With the advent of integrated circuit technology,
the enDre CPU of today, resides in a micro chip à
Microprocessor.
² Miniature silicon chip found in computers that is
the heart of the computer.
MICROPROSSEOR
MICROPROSSEOR COMPONENTS
The processor contains four key components:
CONTROL UNIT
Contains the micro program (contains the entire instruction set, resides in
an internal ROM).
It coordinates and directs most of the operations in the computer.
Controls and interprets the execution of instructions, by following a
sequence of actions that corresponds to fetch-execute instruction cycle .
Retrieve instructions from memory then movement of data or address
from one part of the CPU to another.
To determine which instruction to be executed, CU reads the contents of the
program counter (PC)/ instruction pointer (IP).
CONTROL UNIT
Ø Instruction Decoder
§ InstrucDon decoding is the process whereby
the microprocessor interprets the bit paOern
appearing in the instrucDon decoder register.
§ The microprocessor knows “how” to add
(through the instrucDon set) but does not know
“when” or “what” to add.
§ The word or instrucDon to add needs to be
decoded or interpreted by the instrucDon
decoder.
ARITHMETIC LOGIC UNIT
Performs arithmetic and logical operations on input data.
It performs these operations as directed by the CU.
ARITHMETIC LOGIC UNIT

Comparator
• Compares the magnitude of two numbers placed in buffer registers. The
comparator, used in conjunction with Status Register, will output the results of the
comparison.

Logic Register
• Performs such logic operations as AND, OR, XOR, etc.

Control of ALU
• provides input path for control signals and facilitate the sequencing
and operation of each individual block of circuits.

Shifter
• move the contents of a register one or more positions left or right. Can
also perform a unique operation called rotate when used with status
register.
CSC159 | COMPUTER ORGANIZATION | CH3 |ZAZALEENA ZAKARIAH
REGISTERS
Ø .

Ø .

Ø .
REGISTERS
Four primary operations by registers:

Loaded with values from other locations

Added or subtracted

Shifted or rotated right or left by one or more


bits

Can be tested for certain conditions (zeros,


negative, etc).
INSTRUCTION REGISTERS
Holds the current instruction being executed.
PROGRAM COUNTER

Both a counter and a register


The address in the program counter register is always the address of
the next instruction to be executed
When the current instruction is Jinished, the program counter
generates an address and places it on the address bus
It then increments, that is, adds 1 to the address it just generated and
puts the number in the counter register
As the current instruction Ninished, it places the new address on the
address bus and again adds 1 to the register
The program counter continually generates sequential address
MAR & MDR

Memory Address Register

• Holds the address of a memory location.

Memory Data Register

• Also known as Memory Buffer Register (MBR).


• Holds data value that is being stored to or retrieved from the
memory location currently addressed by the memory address
register.
STATUS REGISTER (FLAGS)
Allow computers to keep track of special condition such as:

Arithmetic carry and overNlow

Power failure

Internal computer error


BUS
CLOCK

A device that produces periodic sequence of pulses to control the timing


of all computer operations
These pulses deNine machine cycles
During each machine cycle, some activity occurs, such as the execution of a
micro-instruction
The interval between corresponding edges of two consecutive pulses is
called the clock cycle time
The clock speed is measured by the number of ticks per second
Pulse frequencies are currently in the gigahertz range which corresponds to
billions of ticks per second
The faster the clock speed, the more instructions the processor can
execute per second
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 per second of system
clock
– theoretically, capable of executing one
million instructions per second
Ø GHz – one billion ticks per second of system
clock
CLOCK
Memory
Types of Memory
Types of Memory
Types of Memory
Volatile/RAM
THREE TYPES OF RAM

§ Less expensive, • Faster access § Stores data using

MRAM
DRAM

require less SRAM compared to magnetic charges


electrical power, DRAM § Greater storage,
and can be • Useful in very high consumes less
made smaller, speed computers power and has
with more bits of and for small faster access
storage in a single amounts of high times compared
integrated circuit. speed memory. to other types of
§ Requires extra • Does not require RAM
electronic refreshing.
circuitry that • More expensive
“refreshes” and require more
memory chips.
periodically.
Types of Memory
Non Volatile/ROM
THREE TYPES OF RAM

§ Can be • Contents can be § Similar to EEPROM


EPROM

EEPROM

FLASH ROM
programmed by programmed and (erased and
the user erased by the written).
§ Contents of user § The only
EPROM can be • writable memory difference is that it
erased by using a concept is faster and more
exposing it to called Fowler- flexible than
ultra-violet light. Nordheim EEPROM.
tunneling § Can erase and
• Rewriting can be write data in
done by erasing blocks rather than
memory cells one byte at a
selectively, then time.
writing new data
into those cells.
Memory Hierarchy
Speed

• Measured by access time and data


transfer rate.
• Access time: average time it takes a
computer to locate data and read it
Ø millisecond = one-thousandth of a
second
• Data transfer rate: amount of data that
moves per second
Memory operation
(read / write)
The processor needs to read data from memory and write
data to memory.
This requires the use of:

Memory Data
Bus Memory Register/
Address
(address bus, Memory Buffer
data bus and
Register
Register
control bus) (MAR)
(MDR/MBR)
Memory operation: Little Man Computer
Memory operation: Little Man Computer
Memory operation

Registers differ from memory:


• Used to hold a binary value temporarily for storage, for
manipulaDon, and/or for simple calculaDons.
• Unlike memory, where every address is just like every
other address each register wired within , each register
wired within the CPU serves a parDcular purpose.
• They are not addressed as a memory locaDon would be,
but instead are manipulated directly by the CU during
execuDon of instrucDons.
Memory operation
BUS
Memory operation
MEMORY ADDRESS REGISTER (MAR)
Holds the
address in the
memory that is to
be “opened” for
data
Connected to a
decoder that
interprets the
address and
activate a single
address line into
the memory.
Memory operation
MEMORY DATA REGISTER (MDR)
Connected to every
cell in the memory
unit
Each bit of the MDR is
connected in a
column to the
corresponding bit of
every location in
memory (but only a
single row of cells is
activated at any
given time, thus, only
one memory location
is addressed at any
one time)
Memory operation
READ OPERATION
CPU copies an address from some register in the CPU to
the memory address register (MAR)
At the same time, the CPU sends a message to the
memory unit that the memory transfer is retrieval (READ)
from memory
CPU then momentarily turns on the switch that connects
the MDR with the register, and transfer takes place
between MDR and memory
The data will then be transferred to the appropriate
register in the CPU

*Memory content will remain intact while the content of


MDR will be replaced by the new data from memory
Memory operation
WRITE OPERATION
CPU copies an address from some register in the CPU to
the memory address register (MAR)
At the same time, the CPU sends a message to the
memory unit that the memory transfer is store (WRITE) to
memory.
CPU then momentarily turns on the switch that connects
the MDR with the register, and data transfer takes place
between the register and MDR.
The data will then be transferred from the MDR to the
memory location as specified in the MAR
Memory Capacity

The size of a memory is defined by


the address scheme
If an address scheme has m bits,
the maximum number of cells
directly addressable is 2^m.
If a memory has n cells, the cells
will have addresses 0 to n-1.
Eg: A memory with 32 cells would
have addresses 0 to 31
Memory Capacity
Memory Capacity
Eg: If the address scheme consists of 16 bits,
the size of the memory would be 64K
16 bit address = 216 => size of memory is
64K
Note:
◦ 1 byte = 8 bits
◦ 1 word = 16 to 64 bits
Memory Capacity
Eg Question:
Given a computer’s memory specification is 128MB
RAM. Calculate the:
◦ memory capacity in bytes
◦ address size
◦ largest address
(5 marks)
Memory Capacity
Eg Question:
Given a computer’s memory specification is 128MB
RAM. Calculate the:
1) memory capacity in bytes
2) address size
3) largest address
(5 marks)
Memory Capacity
Solution:
1) 1K = 1024 bytes = 2^10
1M = 1024 x 1024 = 2^10 x 2^10 = 2^20
Memory capacity = 128 * 1024 * 1024
= 134217728 bytes
(2 marks)
Memory Capacity
2) Address size
128 MB = 128 * 2^20
= 2^7 * 2^20
= 2^27
= 27 bits
(2 marks)
3) Largest address = 134217728 –1
= 134217727
(1 mark)
Byte Ordering
There are two types of bytes ordering

§ Bytes are § Bytes are

Little endian
Big endian

numbered from numbered from


left to right right to left
§ Usually for § Usually for Intel
Motorola family family (8086)
(6800)
Byte Ordering
Big endian
Register Content
Given the following AX 22FF
contents in register
AX: MOV [8002],AX
Register AX
22 FF
The following
instruction is
executed:0 Memory Address Content
8002 22
8003 FF
Byte Ordering
Little endian
Given the following Register Content
contents in register
AX: MOV [8002],AX 22 FF
Register AX
The following 22 FF
instruction is
executed: Memory Address Content
8002 FF
8003 22

You might also like