COMP541 Completing the MIPS Datapath - PowerPoint PPT Presentation

About This Presentation
Title:

COMP541 Completing the MIPS Datapath

Description:

Real computers have flash memory to boot CPU or go to configuration utility. On (very) old computers had to enter boot program on front panel ... – PowerPoint PPT presentation

Number of Views:21
Avg rating:3.0/5.0
Slides: 28
Provided by: Montek5
Learn more at: http://www.cs.unc.edu
Category:

less

Transcript and Presenter's Notes

Title: COMP541 Completing the MIPS Datapath


1
COMP541Completing the MIPS Datapath
  • Montek Singh
  • Mar 27, 2007

2
Datapath Lab
  • Last Fridays lab Included this
  • Need more also memory/control

3
Next few labs
  • March 30 lw and sw and branching
  • April 6 Complete CPU (Holiday?)
  • Add VGA, keyboard/joystick

4
Next Lab
  • Implement the lw and sw instructions.
  • The address for lw/sw generated by ALU
  • Format
  • sw r1, 100(r2)
  • Store contents of register 1 to
  • address r2 100
  • Implement branch instructions

5
Store Word
  • Easier
  • Just disable writing to register
  • Set an address and write to memory
  • Could use second memory port and write on same
    cycle as next instruction
  • Lets look at block diagram

6
Block Diagram (just lw/sw)
7
R-Type and lw/sw
8
Load Word
  • Need to determine memory address
  • Using ALU
  • Then need to read memory and write to register

9
Careful
  • If you use one memory port, your instruction will
    disappear
  • You could use the other memory port
  • Could add an instruction register
  • More complex control
  • Harvard Architecture another possibility

10
Sign Extension
  • Dont get sidetracked into complexity
  • Just extend value of bit 15 to upper 16 bits
  • How?

11
Branching
  • Add beq (branch on equal)
  • That should give enough breadth to actually write
    full programs

12
Resulting MIPS Datapath
13
With Control
14
Memory
  • Addressing
  • Byte address or word address?

15
The MIPS Datapath
16
Expanding Memory Block
  • First lets look in detail at data memory block
  • See how to add block memories
  • Add I/O

17
Memory Block Signals
Mem Write 1 bit
Address 32 bits
Write Data 32 bits
Read Data 32 bits
Mem Read 1 bit
18
Using 2 Block RAMs
  • Illustration from book
  • Lets work it out for Block RAMs
  • Specs next

19
Block RAM Specs
  • Try 2 256x16

20
Adding More Memory
  • Illustration from text
  • Could add 2 more block RAMs to increase mem to
    512 words

21
Memory Map
  • Refers to how physical memory is populated
  • In our example, memory from 0 to 511
  • Its in two blocks, but thats invisible to
    programmer

22
Another Portion of Memory
  • Lets see how to add a block of x8 character
    memory for the VGA
  • Need to make 24 bits be zero

23
Memory Map
0
Instruction and Data Memory
Empty
01 0000 0000 -256
Character Memory
10 0000 0000 512
24
Adding I/O
  • Look at memory-mapped I/O
  • Conceptually like this

25
In Reality
  • Isolated from CPU
  • On standard buses
  • PCI
  • Ours will be simpler
  • Just memory addresses

26
Later
  • Youll add joystick or keyboard (or both) into
    memory locations that you can read

27
How Does Processor Begin?
  • One way is to initialize PC to 0
  • Make sure to have instructions there
  • Real computers have flash memory to boot CPU or
    go to configuration utility
  • On (very) old computers had to enter boot program
    on front panel
Write a Comment
User Comments (0)
About PowerShow.com