CMPEN 331 Exam 2 Lecture 9

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/12

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

13 Terms

1
New cards

control unit

The [blank] is responsible for setting all the
control signals so that each instruction is executed
properly.

• The input is the 32-bit instruction word.
• The outputs are signals to the datapath.

Most of the signals can be generated from the
instruction opcode alone, and not the entire 32-bit
word.

To illustrate the relevant control signals, we will show
the route that is taken through the datapath by R-
type, lw, sw, and beq instructions.

The speed of this unit is critical to clock cycle time (CCT)

2
New cards

to generate control signals

The control unit needs 13 bits of inputs.
• Six bits make up the instruction’s opcode.
• Six bits come from the instruction’s func field.
• It also needs the Zero output of the ALU.

The control unit generates 10 bits of output, corresponding to the signals mentioned on the previous slide.


You can build the actual circuit by using different strategies.

3
New cards

single cycle clock cycle

Uses the clock cycle inefficiently – the clock cycle must be
timed to accommodate the slowest instruction
• especially problematic for more complex instructions like floating
point (FP) multiply

May be wasteful of area since some functional units (e.g.,
adders) must be duplicated since they can not be shared
during a clock cycle
but

Single cycle datapath is simple and easy to understand

Not used much today (mainly due to very long CCT)

4
New cards

datapath

contains all the functional units and
connections necessary to implement an instruction set
architecture • For our single-cycle implementation, we use two separate
memories, an ALU, some extra adders, and lots of multiplexers.
• MIPS is a 32-bit machine, so most of the buses are 32-bits wide

5
New cards

control unit

tells the datapath what to do, based on
the instruction that’s currently being executed.
• Our processor has ten control signals that regulate the datapath.
• The control signals can be generated by a combinational circuit
with the instruction’s 32-bit binary encoding as input.

6
New cards

single cycle

type of cycle where:

• CPI: always 1
• All the instructions have same speed
• Clock cycle: long (governed by the slowest instruction)

• each instruction takes one clock cycle

7
New cards

multi cycle

type of cycle where:

• CPI > 1 (depends on instruction type)
• Faster instructions finish earlier
• Clock cycle: short (governed by the slowest stage)

• each stage takes one clock cycle

8
New cards

pipelining

• Start fetching and executing the next instruction before
the current one has completed

• Under ideal conditions and with a large number of
instructions, the speedup from pipelining is
approximately equal to the number of pipe stages

• Fetch (and execute) more than one instruction at a time

9
New cards

pipelining

• Divide the instruction processing cycle into distinct “stages” of
processing
Ensure there are enough hardware resources to process one
instruction in each stage
Process a different instruction in each stage
• Instructions consecutive in program order are processed in consecutive
stages

• Benefit: Increases instruction processing throughput
(IPC=1/CPI)
• Outside the memory system, the effective operation of the
pipeline is usually the most important factor in determining the
CPI of the processor
30

10
New cards

a pipelined MIPS processor

Start the next instruction before the current one has
completed
• improves throughput - total amount of work done in a given time
• instruction latency (execution time, delay time, response time –
time from the start of an instruction to its completion) is not
reduced and may increase slightly

• clock cycle (pipeline stage time) is limited by the slowest stage
• for some stages don’t need the whole clock cycle (e.g., WB)
• for some instructions, some stages are wasted cycles (i.e., nothing is done during that cycle for that instruction)

11
New cards

structural hazards

attempt to use the same resource by two
different instructions at the same time

12
New cards

data hazards

attempt to use data before it is ready
• An instruction’s source operand(s) are produced by a prior
instruction still in the pipeline

13
New cards

control hazards

attempt to make a decision about program
control flow before the condition has been evaluated and the
new PC target address calculated
• branch and jump instructions, exceptions

Explore top flashcards