{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Lab2 - length_loop length of the string lb $t3($t2 load the...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
1 COMP 4300 Computer Architecture Laboratory Assignment 2: Single vs. Multi-cycle Machines Dr. Xiao Qin Auburn University http://www.eng.auburn.edu/~xqin [email protected] Fall, 2010
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
2 Introduction From your accumulator-based machine to a General Purpose Register (GPR) machine Why not extend your stack-based machine?
Background image of page 2
3 More Registers Add 32 general-purpose registers Names: $0 - $31 Parse an instruction stream to find out which registers are used in each instruction. e.g., lb $t3, ($t1)
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
4 More Instructions Your accumulator-based machine: LOAD, STO, ADD, MULT and END . You need to implement: ADDI , B , BEQZ , BGE , BNE , LA , LB , LI , SUBI , and SYSCALL .
Background image of page 4
5 More Instructions LA , LB , LI ## read the string S: la $a0, string_space li $a1, 1024 li $v0, 8 # load "read_string" code into $v0. syscall la $t1, string_space # A = S. la $t2, string_space # we need to move B to the end
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Background image of page 6
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Background image of page 8
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: length_loop: # length of the string lb $t3, ($t2) # load the byte at addr B into $t3. beqz $t3, end_length_loop # if $t3 == 0, branch out of loop. 6 More Instructions (cont.) 7 Attention • To make Lab 3 simpler, you will need to start thinking five separate functional units right now. • Keep track of the time required by each functional unit 8 Performance Comparison • Take the example program written in MIPS assembler • Convert it into a source file for your simulator • The instructions should stay the same • You must lay out the code and data in memory and calculate the proper values for the offset and label values • Keep track of the total number of instructions executed ( IC ), and the total number of cycles spent in execution ( C ). • Speed-up = [8*IC] / C...
View Full Document

{[ snackBarMessage ]}

Page1 / 8

Lab2 - length_loop length of the string lb $t3($t2 load the...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon bookmark
Ask a homework question - tutors are online