Download CPU Memory Design Enhancement and more Lecture notes Computer Science in PDF only on Docsity!
The CPU & Memory:
Design and
Enhancements
CSC159 – Computer Organization
The CPU and Memory: Design and EnhancementsThe CPU and Memory: Organization
Lesson Outcomes
Fetch-execute Instruction Cycle
CPU Architectures
CPU Enhancements (Separate fetch/execute
unit, pipelining, multiple parallel execution
units, superscalar processing,multiprocessing)
Memory Enhancements (wide path memory
access, memory interleaving, cache memory)
UiTM Terengganu - naza^2
UiTM Terengganu - naza The CPU and Memory: Design and EnhancementsThe CPU and Memory: Organization^4
1. Fetch the next instruction from memory into the
instruction register
2. Change the program counter to point to the following
instruction
3. Determine the type of instruction just fetched
4. If the instruction use data in memory, determine where
they are
5. Fetch the data, if any, into internal CPU registers
6. Execute the instruction
7. Store the results in the proper place
8. Go to step 1 to begin executing the following
instruction
Fetch-Execute Instruction Cycle
The CPU and Memory: Design and EnhancementsThe CPU and Memory: Organization
The Little Man Computer
UiTM Terengganu - naza^5
The CPU and Memory: Design and EnhancementsThe CPU and Memory: Organization
Instruction Cycle (cont.)
Two-cycle process because both
instructions and data are in memory
Fetch
Decode or find instruction, load from memory
into register and signal ALU
Execute
Performs operation that instruction requires
Move/transform data
UiTM Terengganu - naza^7
UiTM Terengganu - naza The CPU and Memory: Design and EnhancementsThe CPU and Memory: Organization^8
Instruction Cycle - STEP 1
Transfer value in PC (address of current
instruction) into MAR, so that computer can
retrieve the instruction located at that
address
Result instruction transferred from
specified memory location to MDR
PC MAR
UiTM Terengganu - naza The CPU and Memory: Design and EnhancementsThe CPU and Memory: Organization^10
STEP 1 + STEP 2
= the FETCH phase of the instruction cycle
for every instruction
The remaining steps are instruction
dependent!
The CPU and Memory: Design and EnhancementsThe CPU and Memory: Organization
LMC vs. CPU Instruction Cycle
UiTM Terengganu - naza^11
The CPU and Memory: Design and EnhancementsThe CPU and Memory: Organization
Store Fetch/Execute Cycle
1. PC MAR Transfer the address from the
PC to the MAR
2. MDR IR Transfer the instruction to the
IR
3. IR(address) MAR Address portion of the
instruction loaded in MAR
4. A MDR* Accumulator copies data into
MDR
5. PC + 1 PC Program Counter incremented
*Notice how Step #4 differs for LOAD and STORE
UiTM Terengganu - naza^13
The CPU and Memory: Design and EnhancementsThe CPU and Memory: Organization
ADD Fetch/Execute Cycle
1. PC MAR Transfer the address from the
PC to the MAR
2. MDR IR Transfer the instruction to the
IR
3. IR(address) MAR Address portion of the
instruction loaded in MAR
4. A + MDR A Contents of MDR added to
contents of accumulator
5. PC + 1 PC Program Counter incremented
UiTM Terengganu - naza^14
UiTM Terengganu - naza The CPU and Memory: Design and EnhancementsThe CPU and Memory: Organization^16
Assume the following values are present just prior to execution of this
segment:
Program Counter: 12
Value in Memory Location 12: 530 (LOAD 30)
Value in Memory Location 13: 376 (ADD 76)
Value in Memory Location 30: 777
Value in Memory Location 76: 210
At the end of fetching step in the first instruction cycle, give the contents
of the following:
First instruction: (fetching)
PC MAR MAR = _____________
MDR IR IR = _____________
UiTM Terengganu - naza The CPU and Memory: Design and EnhancementsThe CPU and Memory: Organization^17
Assume the following values are present just prior to the execution of this segment:
Program Counter: 45 Value in Memory Location 44: 398 (ADD 98) Value in Memory Location 45: 599 (LOAD 99) Value in Memory Location 46: 123 Value in Memory Location 98: 777 Value in Memory Location 99: 210
At the end of each step in the instruction cycle, give the contents of the following:
PC MAR MAR = __________ MDR IR IR = __________ IR [address] MAR MAR = __________ MDR A A = __________ PC + 1 PC PC = __________
UiTM Terengganu - naza The CPU and Memory: Design and EnhancementsThe CPU and Memory: Organization^19
CPU Architectures (cont.)
Most CPU architectures today are loosely
categorized into:
1. CISC – Complex Instruction Set Computers
2. RISC – Reduced Instruction Set Computers
UiTM Terengganu - naza The CPU and Memory: Organization^20
CISC
Few general-purpose registers Large number of specialized instructions
Wide variety of addressing techniques Instruction words of varying sizes
RISC Many registers
Limited & simple instruction set
Register-oriented limited memory access Fixed length, fixed format instruction word Limited addressing modes