Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

ine each of the following instructions. Assume that each instruction is independ

ID: 3599859 • Letter: I

Question

ine each of the following instructions. Assume that each instruction is independent and with the initial condition before the next instruction. For each instruction show the entire Examine each of the following instructions. Assume that each in , ts of each destination register. Show your work in the Work column if needed (to 32-bit conten get partial credits). Register File Memory Contents St0 0x0000743C Stl0x00007448 St20x000000B1 St3= 0x00000006 0x74500xBCDEF012 0x744c 0x9A785630 0x7448 0xEF05C738 0x74440x95DE50FO 0x7440 0x23456789 0x743c 0xCDEF0123 0x7438 0x89AB1234 St5= 0x00000000 St6 0x000080AC Instruction lb $t5,-15 ($tl) lhu $t5,0xfffo ($tl) lw $t5, 0x14 ($tO) srl $t5,St4,5 lui $t5, 0x123 andi $t5, $t4,7 xor $t5, $t2,$t3 slt $t5,$t4, Stl Result St5 = $t5 = Work $t5 = $t5 =

Explanation / Answer

package com;

import java.awt.Graphics;
import java.awt.Graphics2D;
import java.util.ArrayList;
import java.util.Random;

import javax.swing.JPanel;

public class Graph extends JPanel {
public Graph() {
setSize(500, 500);
}

@Override
public void paintComponent(Graphics g) {
Graphics2D gr = (Graphics2D) g; // This is if you want to use Graphics2D
// Now do the drawing here
ArrayList<Integer> scores = new ArrayList<Integer>(10);

Random r = new Random();

for (int i : scores) {
i = r.nextInt(20);
System.out.println(r);
}

int y1;
int y2;

for (int i = 0; i < scores.size() - 1; i++) {
y1 = (scores.get(i)) * 10;
y2 = (scores.get(i + 1)) * 10;
gr.drawLine(i * 10, y1, (i + 1) * 10, y2);
}
}
}