summary of previous lecture
play

Summary of previous lecture number representation: usually twos - PowerPoint PPT Presentation

Summary of previous lecture number representation: usually twos complement, but other representations possible choice depends on hardware size, performance, development time, availability of design tools etc ALU: develop


  1. Summary of previous lecture • number representation: usually two’s complement, but other representations possible • choice depends on hardware size, performance, development time, availability of design tools etc • ALU: • develop efficient, regular bit-level design from obvious word-level design • size/performance trade-offs in different architectures e.g. ripple-carry adder versus carry-select adder dt10 2011 5.1

  2. Datapath and control: 3-step derivation (3 rd Ed: p.284-314, 4 th Ed: p.300-330) • separate datapaths for: – register-based instructions e.g. add, sub – memory-access instructions e.g. lw, sw – branch instructions e.g. beq, j • combined datapath for all instructions – add multiplexors • use correct part for each instruction – control signals for multiplexors + ALU dt10 2011 5.2

  3. Register-based instructions • select read/write registers from operands • select ALU operation from opcode and function field • add $5, $6, $7 # reg[5] = reg[6] + reg[7] dt10 2011 5.3

  4. Memory access instructions: load • lw $5, offset($6) # reg[5] = M[reg[6] + offset] assume data memory to return value in same cycle dt10 2011 5.4

  5. Memory access instructions: store • sw $5, offset($6) # M[reg[6] + offset] = reg[5] dt10 2011 5.5

  6. Combine datapaths for R-type and memory instructions: R-type flow • 1 register file, 1 ALU • ALU input mux: data from register or instruction • register write mux: data from ALU or memory dt10 2011 5.6

  7. Combine datapaths for R-type and memory instructions: memory flow • 1 register file, 1 ALU • ALU input mux: data from register or instruction • register write mux: data from ALU or memory dt10 2011 5.7

  8. Branch instructions • beq $5, $6, L dt10 2011 5.8

  9. Combined datapath: without instruction memory dt10 2011 5.9

  10. Combined datapath: with instruction memory dt10 2011 5.10

  11. Combined datapath for R-type dt10 2011 5.11

  12. Combined datapath for load dt10 2011 5.12

  13. Combined datapath for branch dt10 2011 5.13

  14. ALUOp (from control unit) ALU ALU control ALU function control control code input • from opcode and fn code, determine ALU control constant lecture on ALU from opcode specify instruction type dt10 2011 5.14

  15. ALU control: optimisation insert don’t cares (Xs) since 11 never arises • K-map for rightmost bit: F0 or F3 • combine ALUOp: ALUOp1 and (F0 or F3) dt10 2011 5.15

  16. Identify control signals • ALU: ALUOp • control 4 mux: RegDst, ALUSrc, MemtoReg, PCSrc • storage: Register Write, Memory Read/Write dt10 2011 5.16

  17. Control signal summary dt10 2011 5.17

  18. R-type instruction (1) dt10 2011 5.18

  19. R-type instruction (2) dt10 2011 5.19

  20. R-type instruction (3) dt10 2011 5.20

  21. R-type instruction (4) dt10 2011 5.21

  22. Load instruction (1) dt10 2011 5.22

  23. Load instruction (2) dt10 2011 5.23

  24. Load instruction (3) dt10 2011 5.24

  25. Load instruction (4) and (5) dt10 2011 5.25

  26. Branch instruction (1) dt10 2011 5.26

  27. Branch instruction (2) dt10 2011 5.27

  28. Control unit for single-cycle datapath • combinational circuit: no registers • 6-bit opcode input e.g. lw 100011 (35 ten ) • 9-bit output, control mux, ALU, read/write op • e.g. lw: mux memory/register ALU ------ -------------------- ------ RegDst = 0 MemRead = 1 ALUOp = 0 Branch = 0 MemWrite = 0 MemtoReg = 1 RegWrite = 1 ALUSrc = 1 dt10 2011 5.28

  29. Load instruction (1) • lw $5,offset($6) dt10 2011 5.29

  30. Load instruction (2) • lw $5,offset($6) dt10 2011 5.30

  31. Load instruction (3) • lw $5,offset($6) dt10 2011 5.31

  32. Load instruction (4) and (5) • lw $5,offset($6) dt10 2011 5.32

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend