Testing of MIPS Processor
Testing of MIPS Processor
Technology, Lahore.
Lab 14
Test the working of MIPS Processor
Introduction :
This last lab is to test the MIPS machine codes as the final step. Write and test a MIPS assembly
code that adds from 1 to 200 (C8hex) and then stores the result at a memory location on your
own processor. This time, connect the clock to the system clock (50MHz) or a divided slower
clock. In order to display the final result, use an infinitive loop of loads. This can be achieved
through displaying the signal read_data to the seven segment display output. The seven segment
display is used because it is a faster display technology. Your assembly code should look like
MIPS code that computes 1+2+3+, ....,+ 200=20100=4e84hex.
L1: ....
beq $1,$2, L2 -- bne can be implemented by beq and j combination
j L1
L2: --- Assume that the addition result is in $5
sw $5, 3($0) --- Save the addition result at mem[3]
L3: lw $5, 3($0) --- Create an infinitive loop to display the result stored in memory
j L3 --- to the seven segment display.
Above method should allow you to test your processors loop (branch) capability. One common
mistake students make is not recognizing the instructions implemented. Remember that you only
implemented rformat, lw, sw, addi, beq, and j instructions. Your program can use only these
instructions.Another important feature you should test is the reset capability. Resetting your
processor should produce the same result, that is, it should be able to repeat the execution of the
addition program. This is because the processor starts from PC=0 when a reset is applied, and
thus your code ends up executing the infinitive loop again.