1 comp541 datapaths i montek singh mar 8, 2007. 2topics over next 2/3 classes: datapaths basic...

28
1 COMP541 COMP541 Datapaths I Datapaths I Montek Singh Montek Singh Mar 8, 2007 Mar 8, 2007

Upload: milo-williamson

Post on 18-Jan-2018

217 views

Category:

Documents


0 download

DESCRIPTION

3 Parts of CPUs  Datapath The registers and logic to perform operations on them The registers and logic to perform operations on them  Control unit Generates signals to control datapath Generates signals to control datapath

TRANSCRIPT

Page 1: 1 COMP541 Datapaths I Montek Singh Mar 8, 2007. 2Topics  Over next 2/3 classes: datapaths  Basic register operations Book sections 7-2 to 7-6 and 7-8

1

COMP541COMP541

Datapaths IDatapaths I

Montek SinghMontek Singh

Mar 8, 2007Mar 8, 2007

Page 2: 1 COMP541 Datapaths I Montek Singh Mar 8, 2007. 2Topics  Over next 2/3 classes: datapaths  Basic register operations Book sections 7-2 to 7-6 and 7-8

2

TopicsTopics Over next 2/3 classes: datapathsOver next 2/3 classes: datapaths Basic register operationsBasic register operations

Book sections 7-2 to 7-6 and 7-8Book sections 7-2 to 7-6 and 7-8 Computer datapathsComputer datapaths

First part of Chapter 10First part of Chapter 10

Page 3: 1 COMP541 Datapaths I Montek Singh Mar 8, 2007. 2Topics  Over next 2/3 classes: datapaths  Basic register operations Book sections 7-2 to 7-6 and 7-8

3

Parts of CPUsParts of CPUs DatapathDatapath

The registers and logic to perform operations on themThe registers and logic to perform operations on them Control unitControl unit

Generates signals to control datapathGenerates signals to control datapath

Page 4: 1 COMP541 Datapaths I Montek Singh Mar 8, 2007. 2Topics  Over next 2/3 classes: datapaths  Basic register operations Book sections 7-2 to 7-6 and 7-8

4

Memory and I/OMemory and I/O Are connected to the data/control in and out Are connected to the data/control in and out

lineslines Example: register to memory opsExample: register to memory ops

Page 5: 1 COMP541 Datapaths I Montek Singh Mar 8, 2007. 2Topics  Over next 2/3 classes: datapaths  Basic register operations Book sections 7-2 to 7-6 and 7-8

5

MicrooperationsMicrooperations Basic operations of the datapathBasic operations of the datapath

Example: moving data from one register to anotherExample: moving data from one register to another Not necessarily microprogrammed controlNot necessarily microprogrammed control

Just a description of operationsJust a description of operations Microoperation expected to complete in one Microoperation expected to complete in one

clockclock Register transfer notation, nextRegister transfer notation, next

Page 6: 1 COMP541 Datapaths I Montek Singh Mar 8, 2007. 2Topics  Over next 2/3 classes: datapaths  Basic register operations Book sections 7-2 to 7-6 and 7-8

6

Register Transfer Language (RTL)Register Transfer Language (RTL) Registers named in uppercaseRegisters named in uppercase

PC, IR (instruction), R3PC, IR (instruction), R3 Little endianLittle endian

Page 7: 1 COMP541 Datapaths I Montek Singh Mar 8, 2007. 2Topics  Over next 2/3 classes: datapaths  Basic register operations Book sections 7-2 to 7-6 and 7-8

7

RTRT Transfer from R1 to R2Transfer from R1 to R2

R2 R2 R1R1 R2 is destinationR2 is destination R1 is sourceR1 is source

ConditionalConditional If(K1 = 1) then (R2 If(K1 = 1) then (R2 R1)R1) K1: R2 K1: R2 R1 as a shorter formR1 as a shorter form

Page 8: 1 COMP541 Datapaths I Montek Singh Mar 8, 2007. 2Topics  Over next 2/3 classes: datapaths  Basic register operations Book sections 7-2 to 7-6 and 7-8

8

TransferTransfer Transfer at the clock edgeTransfer at the clock edge When K1 is highWhen K1 is high n bits widen bits wide

Page 9: 1 COMP541 Datapaths I Montek Singh Mar 8, 2007. 2Topics  Over next 2/3 classes: datapaths  Basic register operations Book sections 7-2 to 7-6 and 7-8

9

SymbolsSymbols Note memory transfersNote memory transfers

Page 10: 1 COMP541 Datapaths I Montek Singh Mar 8, 2007. 2Topics  Over next 2/3 classes: datapaths  Basic register operations Book sections 7-2 to 7-6 and 7-8

10

Syntax not Verilog (but similar)Syntax not Verilog (but similar)

Page 11: 1 COMP541 Datapaths I Montek Singh Mar 8, 2007. 2Topics  Over next 2/3 classes: datapaths  Basic register operations Book sections 7-2 to 7-6 and 7-8

11

Types of MicrooperationsTypes of Microoperations Transfer – have just looked atTransfer – have just looked at ArithmeticArithmetic LogicLogic ShiftShift

Page 12: 1 COMP541 Datapaths I Montek Singh Mar 8, 2007. 2Topics  Over next 2/3 classes: datapaths  Basic register operations Book sections 7-2 to 7-6 and 7-8

12

ArithmeticArithmetic Basic ops (not multiply, divide)Basic ops (not multiply, divide)

R0 R0 R1 + R2R1 + R2 Subtraction by 2’s complementSubtraction by 2’s complement

Page 13: 1 COMP541 Datapaths I Montek Singh Mar 8, 2007. 2Topics  Over next 2/3 classes: datapaths  Basic register operations Book sections 7-2 to 7-6 and 7-8

13

Notation is Shorthand for Notation is Shorthand for HardwareHardware ConsiderConsider and and

Note overflowNote overflowand carry registersand carry registers

211:1 RRRKX 1211:1 RRRXK

Page 14: 1 COMP541 Datapaths I Montek Singh Mar 8, 2007. 2Topics  Over next 2/3 classes: datapaths  Basic register operations Book sections 7-2 to 7-6 and 7-8

14

Logic MicrooperationsLogic Microoperations

OR notation a little confusingOR notation a little confusing

shows two types of syntax for ORsshows two types of syntax for ORs211:)21( RRRKK

Page 15: 1 COMP541 Datapaths I Montek Singh Mar 8, 2007. 2Topics  Over next 2/3 classes: datapaths  Basic register operations Book sections 7-2 to 7-6 and 7-8

15

Shift MicrooperationsShift Microoperations Here just the basic one-bit shiftsHere just the basic one-bit shifts

Bit falls off the end, zero shifted inBit falls off the end, zero shifted in

Page 16: 1 COMP541 Datapaths I Montek Singh Mar 8, 2007. 2Topics  Over next 2/3 classes: datapaths  Basic register operations Book sections 7-2 to 7-6 and 7-8

16

Multiplexer-Based TransfersMultiplexer-Based Transfers ConsiderConsider

Which can also be expressed asWhich can also be expressed as

Block diagram nextBlock diagram next

20)12()10()11( RRthenKifelseRRthenKif

20:21,10:1 RRKKRRK

Page 17: 1 COMP541 Datapaths I Montek Singh Mar 8, 2007. 2Topics  Over next 2/3 classes: datapaths  Basic register operations Book sections 7-2 to 7-6 and 7-8

17

Multiplexer Block DiagramMultiplexer Block Diagram

Detailed block diagram nextDetailed block diagram next

20:21,10:1 RRKKRRK

Page 18: 1 COMP541 Datapaths I Montek Singh Mar 8, 2007. 2Topics  Over next 2/3 classes: datapaths  Basic register operations Book sections 7-2 to 7-6 and 7-8

18

DetailedDetailed

Simpler version is Simpler version is easier to follow easier to follow and to deriveand to derive

Page 19: 1 COMP541 Datapaths I Montek Singh Mar 8, 2007. 2Topics  Over next 2/3 classes: datapaths  Basic register operations Book sections 7-2 to 7-6 and 7-8

19

Bus-Based TransfersBus-Based Transfers How about when there are lots of registers?How about when there are lots of registers?

Beyond a certain point muxes become unwieldyBeyond a certain point muxes become unwieldy Can use buses and send data over common Can use buses and send data over common

set of wiresset of wires

Page 20: 1 COMP541 Datapaths I Montek Singh Mar 8, 2007. 2Topics  Over next 2/3 classes: datapaths  Basic register operations Book sections 7-2 to 7-6 and 7-8

20

Simple CasesSimple Cases

One muxOne mux One output One output

bus bus

Page 21: 1 COMP541 Datapaths I Montek Singh Mar 8, 2007. 2Topics  Over next 2/3 classes: datapaths  Basic register operations Book sections 7-2 to 7-6 and 7-8

21

TransfersTransfers Can’t be as generalCan’t be as general Only single sourceOnly single source About ½ the hardwareAbout ½ the hardware

Page 22: 1 COMP541 Datapaths I Montek Singh Mar 8, 2007. 2Topics  Over next 2/3 classes: datapaths  Basic register operations Book sections 7-2 to 7-6 and 7-8

22

Three-State BusThree-State Bus Remember three-state drivers Remember three-state drivers

allow having multiple outputs allow having multiple outputs share wireshare wire

Have to control so only one is Have to control so only one is assertedasserted

Example nextExample next

Page 23: 1 COMP541 Datapaths I Montek Singh Mar 8, 2007. 2Topics  Over next 2/3 classes: datapaths  Basic register operations Book sections 7-2 to 7-6 and 7-8

23

Same Example with 3-StateSame Example with 3-State One R outputOne R output

Enable controlsEnable controls Load controls which Load controls which

latcheslatches Fewer wiresFewer wires Especially important Especially important

outside chipoutside chip

Page 24: 1 COMP541 Datapaths I Montek Singh Mar 8, 2007. 2Topics  Over next 2/3 classes: datapaths  Basic register operations Book sections 7-2 to 7-6 and 7-8

24

Memory TransfersMemory Transfers Usually one or more buses associated with Usually one or more buses associated with

memorymemory AddressAddress DataData

Note that memory can be slower, so may have Note that memory can be slower, so may have to use complex timingto use complex timing Address on one clock cycleAddress on one clock cycle Data latched at later clock cycleData latched at later clock cycle

Page 25: 1 COMP541 Datapaths I Montek Singh Mar 8, 2007. 2Topics  Over next 2/3 classes: datapaths  Basic register operations Book sections 7-2 to 7-6 and 7-8

25

DatapathDatapath Blue signals Blue signals

generated by generated by controlcontrol

A&B buses to ALUA&B buses to ALU B can be constant B can be constant

from memoryfrom memory Can also send addr Can also send addr

and dataand data

Page 26: 1 COMP541 Datapaths I Montek Singh Mar 8, 2007. 2Topics  Over next 2/3 classes: datapaths  Basic register operations Book sections 7-2 to 7-6 and 7-8

26

R1R1R2+R3R2+R3 SignalsSignals

Load enableLoad enable A, B selectA, B select MB SelectMB Select MF SelectMF Select G SelectG Select Destination (D)Destination (D)

What about What about timing?timing?

Page 27: 1 COMP541 Datapaths I Montek Singh Mar 8, 2007. 2Topics  Over next 2/3 classes: datapaths  Basic register operations Book sections 7-2 to 7-6 and 7-8

27

TimingTiming All can occur in one clock, butAll can occur in one clock, but Signals must be available in time to propagate Signals must be available in time to propagate

through muxes, ALU and through muxes, ALU and Be at R inputs by next posedgeBe at R inputs by next posedge

Go back and look at pathGo back and look at path

Page 28: 1 COMP541 Datapaths I Montek Singh Mar 8, 2007. 2Topics  Over next 2/3 classes: datapaths  Basic register operations Book sections 7-2 to 7-6 and 7-8

28

NextNext Look at specific MIPS designLook at specific MIPS design

Next timeNext time Continue design review of ALUContinue design review of ALU Look at shifterLook at shifter