The Processor: Datapath and Control - PowerPoint PPT Presentation

1 / 32
About This Presentation
Title:

The Processor: Datapath and Control

Description:

ALU, multiplexor, memory, adder, sign-extender. Single-cycle datapath. Control ... PLA Implementation. All of the logic is combinational ... – PowerPoint PPT presentation

Number of Views:41
Avg rating:3.0/5.0
Slides: 33
Provided by: homeE
Category:

less

Transcript and Presenter's Notes

Title: The Processor: Datapath and Control


1
??? ?? ??Lecture 9
  • The Processor Datapath and Control
  • Oct. 24, 2008
  • ? ??

2
In This Lecture
  • Abstract view of the processor
  • Building blocks
  • Register file
  • ALU, multiplexor, memory, adder, sign-extender
  • Single-cycle datapath
  • Control

3
The Processor Datapath Control
  • We're ready to look at an implementation of the
    MIPS
  • Simplified to contain only
  • memory-reference instructions lw, sw
  • arithmetic-logical instructions add, sub, and,
    or, slt
  • control flow instructions beq, j
  • Generic Implementation
  • use the program counter (PC) to supply
    instruction address
  • get the instruction from memory
  • read registers
  • use the instruction to decide exactly what to do

4
MIPS Datapath and Control
5
Abstract View of the Implementation
  • Two types of functional units
  • elements that operate on data values
    (combinational logic)
  • elements that contain state (state elements)

6
State Elements
  • Clocks used in state elements
  • when should an element that contains state be
    updated?
  • Level-sensitive latch
  • Edge-triggered flip-flop

(cycle time)
7
D flip-flop
  • Output changes only on the clock edge

8
Our Implementation
  • An edge triggered methodology
  • Typical execution
  • read contents of some state elements,
  • send values through some combinational logic
  • write results to one or more state elements

9
Register File read
  • Built using D flip-flops
  • A register 32 D flip-flops
  • Register file 32 registers
  • Two register addresses and two data outputs
    (because an R-type instruction requires two
    resister data for operands)

10
Register File - write
  • Thus, a register file requires
  • Three addresses, two for read and one for write
  • RA, RB, RW
  • One data input for write
  • busW
  • Write enable
  • Two data output
  • busA, busB
  • Clock

11
Timing Diagram of Register File
RW
RA
RB
Write Enable
5
5
5
  • read is simply combinational
  • write is edge-triggered

busA
busW
32
32 32-bit Registers
32
busB
Clk
32
Clk
access time
RA
7
12
27
data of Reg7
BusA
data of Reg12
RW
15
22
18
BusW
456
-6822
123
933
474
Write Enable
Data is written here Reg18 933
12
Elements for Instruction Fetch
  • Basic Instruction Fetch Unit

13
Elements for R-format Instructions
  • Two elements for R-format
  • Rrd lt- Rrs op Rrt

14
Elements for Load/Store Instuctions
  • Additional elements for Load/Store
  • Rrt lt- MemRrs SignExtimm16

15
Datapath for a Branch (beq)
  • If (Rrs Rrt)
  • PC lt- PC 4 ( SignExt(imm16) x 4 )
  • Else PC lt- PC 4

16
Datapath for lw/sw and R-type
17
Putting it Altogether
18
Control
  • Selecting the operations to perform (ALU,
    read/write, etc.)
  • Controlling the flow of data (multiplexor inputs)
  • Information comes from the 32 bits of the
    instruction

19
Three Instruction Classes
  • Op. 6 bits and funct. 6 bits can be used to
    generate control signals
  • I-type an J-type instructions only have op. 6
    bits
  • R-type instructions have both op. 6 bits and
    funct. 6 bits

R I J
20
Control with Local Decoding
Main Control
ALU Control
21
ALU Control (ALUctr)
22
Truth Table for ALU Control
  • Can turn into gates

23
Control for R-type Instruction
op
rs
rt
rd
shamt
funct
Field
3126
2521
2016
1511
105
50
bit position
  • ALUSrc 0
  • ALUOp 10
  • MemtoReg 0
  • RegDst 1
  • RegWrite 1
  • MemRead 0
  • MemWrite 0
  • Branch 0

24
Control for load instruction
op
rs
rt
address
Field
3126
2521
2016
150
bit position
  • ALUSrc 1
  • ALUOp 00
  • MemtoReg 1
  • RegDst 0
  • RegWrite 1
  • MemRead 1
  • MemWrite 0
  • Branch 0

25
Control for branch equal
op
rs
rt
address
Field
3126
2521
2016
150
bit position
  • ALUSrc 0
  • ALUOp 01
  • MemtoReg X
  • RegDst X
  • RegWrite 0
  • MemRead 0
  • MemWrite 0
  • Branch 1

26
Datapath Extended for jump

27
Truth Table for Main Control
28
Control Implementation
  • Simple combinational logic (truth tables)

PLA Implementation
29
Our Simple Control Structure
  • All of the logic is combinational
  • We wait for everything to settle down before we
    execute the next instruction
  • Cycle time determined by length of the longest
    path (lw in this case)

30
Performance of Single Cycle Datapath
  • Calculate cycle time assuming negligible delays
    except
  • memory (200ps), ALU and adders (100ps),
    register file access (50ps)
  • Minimum Cycle Time gt 600ps!

31
Where we are headed
  • Single Cycle Problems
  • what if we had a more complicated instruction
    like floating point?
  • wasteful of cycle time
  • One Solution
  • use a smaller cycle time
  • have different instructions take different
    numbers of cycles
  • a multicycle datapath

32
HW 4
  • Exercise 4-10, 14, 17, 45, 46
  • Due on 11/4 (Tue)
Write a Comment
User Comments (0)
About PowerShow.com