Review
MIPS Program Data Segment Text Segment # an example of iteration to compute the sum of every other word .data start: .word 1, 0, 1, 0, 1, 0, 1, 0 .word 1, 0, 1, 0, 1, 0, 1, 0 .text .globl main main: la $t0, start #load start address of array addi $t1, $t0,128 # address of end of array of 64 words add $t2, $zero, $zero #initialize sum loop: lw $t3, 0($t0) #fetch array element add $t2, $t2, $t3 # update sum addi $t0, $t0, 8 # point to next address bne $t1, $t0, loop # if not done, start next iteration li $v0, 10 #load program termination code syscall Data Segment Text Segment Check the class resources page for link to QtSpim simulator
ECE 2020 Datapath X Y http://ece2020.ece.gatech.edu/readings/datapaths/1-cycle-dp.pdf Sample problems at http://ece2020.ece.gatech.edu/problems/datapaths/index.html