Chapter 3 - CPU and Memory (Organization)
Chapter 3 - CPU and Memory (Organization)
LESSON OUTCOMES
ORGANIZATION
The machine cycle
▪ Briefly explain about memory
CHAPTER 3 Volatile vs non-volatile
Example of memory
Memory operation
Memory capacity
1 2
1 2
CPU/Microprocessor
3 4
3 4
5 6
1
20/3/2019
❑ Performs arithmetic and logical operations on input data. ❑ Temporary storage area that holds data and instructions
❑ It performs these operations as directed by the CU. ❑ 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
7 8
7 8
Register Register
❑ The CU contains several important registers: ❑ The CU also contain several 1-bit registers, known as
▪ Program counter (PC) register - holds address of current instruction status register or flags.
being executed
▪ Instruction register (IR) - holds actual instruction being executed
❑ This flags allow computers to keep track of special
currently by the computer condition such as:
▪ Memory address register (MAR) - holds address of a memory location
Arithmetic
Memory data register (MDR) - holds a data value that is being stored
▪
to or retrieved from the memory location currently addressed by MAR
carry and Power failure
overflow
❑ Although the MAR and MDR are part of the CPU, operationally
these two registers are more closely associated with memory
itself (will discussed in more detail in memory section) Internal
computer
9
error 10
9 10
Register Clock
❑ Most registers support four primary types of operations: ❑ A device that produces periodic sequence of pulses to control the
timing of all computer operations
❑ These pulses define machine cycles
Loaded with values from other locations ❑ Each tick is a clock cycle that determines when the next machine
cycle will occur
❑ The clock speed is measured by the number of ticks per second
Added or subtracted ❑ The faster the clock speed, the more instructions the processor can
execute per second
❑ MHz - one million ticks per second of system clock
Shifted or rotated right or left by one or more bits
- theoretically, capable of executing one million instructions per
Can be tested for certain conditions (zeros, second
negative, etc). ❑ GHz – one billion ticks per second of system clock
11 12
11 12
2
20/3/2019
13 14
13 14
15 16
15 16
❑ Memory / main memory / primary storage / working ❑ Random Access Memory (RAM)
storage ▪ Temporary storage and working space for the operating system and
❑ Holds programs/instructions and data for access by the applications
CPU ▪ Used to store program and user data.
❑ Made up of a large number of cells, each with its own ▪ Readable and rewritable (volatile).
address ▪ Two types of RAM: Static RAM (SRAM) Dynamic RAM (DRAM)
❑ Can be divided into two: ◼ Faster & requires less power ◼ Slower & needs more power
(additional circuitry)
Volatile Nonvolatile ◼ Does not require refreshing ◼ Data needs to be refreshed
periodically
Loses contents when power is Retains contents when power is
removed removed ◼ More expensive ◼ Less expensive
◼ Often used as “cache memory” ◼ Used as main memory
17 18
17 18
3
20/3/2019
19 20
21 22
21 22
23 24
23 24
4
20/3/2019
25 26
25 26
27 28
M = 2k
2. Number of bits in the address field of the instruction set
(determines how many memory locations can be directly
addressed from the instruction)
29 30
29 30
5
20/3/2019
31 32
c) Largest address
128 MB = capacity in bytes - 1
= 134217728 –1
33
= 134217727 34
33 34
Exercise
c) Largest address
35 36
35 36