CSCI341 Lecture 30, Building a Datapath RECALL... The datapath is - - PowerPoint PPT Presentation

csci341
SMART_READER_LITE
LIVE PREVIEW

CSCI341 Lecture 30, Building a Datapath RECALL... The datapath is - - PowerPoint PPT Presentation

CSCI341 Lecture 30, Building a Datapath RECALL... The datapath is a representation of the flow of information (data, instructions) through the CPU Implemented as combination of circuitry and combinatorial & sequential chips


slide-1
SLIDE 1

CSCI341

Lecture 30, Building a Datapath

slide-2
SLIDE 2

RECALL...

  • The “datapath” is a representation of the flow of information

(data, instructions) through the CPU

  • Implemented as combination of circuitry and combinatorial &

sequential chips

  • “State” is created through clocking and edge-triggered flip-

flops

slide-3
SLIDE 3

DATAPATH ELEMENTS

  • A component that operates on or “holds” data
  • Memory, registers, ALU, adders, etc.
slide-4
SLIDE 4

PROGRAM COUNTER (PC)

  • Memory unit that increments or can be set to a value
  • Value represents an instruction address
slide-5
SLIDE 5

INSTRUCTION FETCH

  • PC tells memory to send instruction at PC’s address to CPU

control circuitry

  • Increment program counter, in preparation for next instruction
slide-6
SLIDE 6

INSTRUCTION FETCH

What’s in here? A magic elf?

slide-7
SLIDE 7

EXAMPLE

add $t1, $t2, $t3 “Read $t2 and $t3, add them together, and write to $t1.”

slide-8
SLIDE 8

add $t1, $t2, $t3 “Read $t2 and $t3, add them together, and write to $t1.”

EXAMPLE (REGISTER FILE)

slide-9
SLIDE 9

add $t1, $t2, $t3

EXAMPLE

9 10 8 32

  • p

rs rt rd shamt fn

slide-10
SLIDE 10

EXAMPLE

add $t1, $t2, $t3

9 10 8 32

  • p

rs rt rd shamt fn 000000 01001 01010 01000 00000 100000

Let’s wire it up!

slide-11
SLIDE 11

EXAMPLE

lw $t0, 0($t1)

35 9 8

  • p

rs rt address 100011 01001 01000 0000 0000 0000 0000

Let’s wire it up!

slide-12
SLIDE 12

BRANCHING

beq $t1, $t2, somewhere What must happen in order for this to work? j somewherElse What about this?

slide-13
SLIDE 13

DELAYED BRANCH

MIPS branching results in the subsequent instruction to be executed, regardless of the branch condition. Why? Pipelining & branches (more on this later).

slide-14
SLIDE 14

MIPS DATAPATH

  • Try to execute all instructions in one clock cycle
slide-15
SLIDE 15

MIPS DATAPATH (R-TYPE)

slide-16
SLIDE 16

MIPS DATAPATH (GENERAL)

slide-17
SLIDE 17

HOMEWORK

  • Reading 26
  • Finish Project 6, “Healthy” Beverages

no such thing as magic.