Code Trace Exercise
Consider the following program. A breakpoint is set at bkpt. Trace the program as it is executed.
Indicate the values of registers t1, t4, t6, and v0 each time a breakpoint is hit and at the end of the
program. In add
1. This program would not compile , this program will compile if the code is changed to the
following and the changes are explained below:
CSE 341: Computer Organization Spring 2011
Solution to QZ #1
Week of 2/14/11
Duration: 25 minutes
Question 1: (5 points)
Write the following sequence of code into MIPS assembler:
x = x + y + z - q;
Assume that x, y, z, q are stored in registers $s1
Due: Wednesday, November 30 at 11:59 PM
Your task is to implement a 16-bit ripple carry adder, a 16-bit carry lookahead adder, and a 16-bit carry
select adder in Verilog HDL and compare them in terms of per
Test Data Set in Project Writeup
Note that in the examples, user input is shown in blue and output in red
Virtual Memory Basics
Main memory acts as a cache for secondary storage
All for efficient & safe sharing of memory among multiple programs
Remove programming burdens of a small, limited amount of main memory
Consider the single cycle datapath discussed in class. Answer the following question based
on this architecture.
1. Determine the control signals for the single cycle datapath shown below for the instruction
SW $t5, 16($a1)
1. Represent -928.578125 as a single precision floating point number.
2. What number is represented by 0x97803400 in single precision floating point format?
3. Given the following information regarding a benchmark program run
1. Which write policy in a cache would be most appropriate for each of the following:
a. A system which is designed for data intensive applications where a large number of
writes and stores are common.
b. A safety critical sy
Homework #5 Solutions
1. Scenario A:
Write back Due to the large number of loads and stores, a significant amount of time might be spent
unnecessarily updating the memory hierarchy if a write through policy were used. This might result
1. When RAM (physical memory) is full and a page needs to be swapped, where is the page that is
2. Is virtual memory direct mapped, set associative, or fully associative? Why?
3. Is physical memory smaller or
Homework #6 Solutions
1. Swap space on the hard drive.
2. Fully associative. It is important to utilize the entire capacity of physical memory before a page is
replaced because the penalty on a page fault is severe.
# y = 65 * x - y + 39
# Load x
# Load y
# Begin Multiplication (65 * x)
sll $t2, $t0, 6
# 64 * x via shifting
add $t2, $t2, $t0 # 65 * x via (64 * x) + x
# End Multiplication