# July 2, 2017MIPS | MIPS 代写 | CS230 Spring 2016 – Assignment 3 Due Date: Thursday, June 30, 2016, 11:59 p.m. NOTE the different due date and time. Weight: 6% of the course grade All questions are equally weighted

CS230 Spring 2016 – Assignment 3 Due Date: Thursday, June 30, 2016, 11:59 p.m. NOTE the different due date and time. Weight: 6% of the course grade
All questions are equally weighted
• See the file MIPSinstructions.pdf, for instructions on how to assemble and execute your assembly language programs.
• The files submitted must plain text files with a .asm extension.
• Your solutions should include comments at the beginning that include your name, your Quest ID, a brief description of the program that describes how the registers
are being used.
for the markers to understand your thought process.
• The contents of the registers that are explicitly mentioned in the problem

# January 25, 2017MIPS | CMPUT 229 (Winter 2017) – Homewor

CMPUT 229 (Winter 2017) – Homework #1 Instructor: Karim Ali
Question 1: (5 points)
Consider that a processor architecture ToyProc, which was initially designed as big- endian, is changed to use little-endian byte ordering. Assuming the subset of the MIPS ISA that you are familiar with, and assuming a memory with a word-level interface, give examples of instructions whose operations will be affected by such a change in endianness.
Question 2: (5 points)
Write the C code that best corresponds to the following MIPS assembly code. Assume that registers \$s1, \$s2, and \$s3 store the values of 32-bit integers x, y, and z.
L1: beq \$s1, \$zero, L2
L2:
Question 3: (15 points)
For this question, assume that:
• p, q, i, j are 32-bit integers whose values are stored in \$s0, \$s1, \$s2, and \$s3, respectively.
• A and B are arrays of integers.
• r is a pointer declared as int *r.
• r, the base address of array A, and the base address of array B are all in the stack frame of the current function, as shown below
For each of the C statements below, give the translation into MIPS. Do not use pseudo- instructions in your code. Clearly label which MIPS instructions are for which statement.
a. (5 points) q = *r
b. (5 points) B[i] = A[j]
c. (5 points) p = q + A[B[j]] Question 4: (15 points)
Write the assembly code to implement the following C function:
int selector(int array[], int i) {
return array[array[i]];
}

# January 12, 2017MIPS | Algorithm | Minecraft-Texturen

1. An image can be stored in the memory as an array by continuously storing the individual lines with image points one behind the other.
2. At the beginning of the image there is also a header, which contains the width, height and color depth, which is the number of colors.

1.Your program should be able to read and write image files in the PGM format (binary, P5). a) 提示:To read and write files, QtSPIM, similar, or other operating system, provides different syscalls. You must calculate the value of the number from a string of digits.
To do this You need an ASCII table.

# May 22, 2016MIPS | ISA | Objectives

Objectives

The objectives of this assignment are:

1. Gain a thorough understanding of the MIPS Instruction set Architecture (ISA)

2. Familiarise you with the SPIM environment.

3. Gain understanding of assembly programming convention (mostly procedure calls).

Experiments

This assignment will give you a chance to get familiar with SPIM, a MIPS simulator, the MIPS instruction set, and the calling convention. You will learn SPIM’s basic functionality by simulating a MIPS assembly program that shows a nested routine. Seethe C version of the program below.

# May 8, 2016C | MIPS | Algorithm QuickSort algorithm

QuickSort algorithm
In this project, you will be implementing the QuickSort algorithm in MIPS. The QuickSort algorithm can be used to recursively sort an array in-place in O() running time in the average case.
Brief explanation of the terms above:
● Recursive: the main sorting function calls on itself until a trivial case is reached. This approach is also called “divide and conquer”, where a large problem is solved by breaking it down into multiple simple problems
● In-place: the algorithm runs without requiring additional memory to be allocated in during run-time. Thus, you do not need to create a temporary copy of the array in memory to implement this algorithm (unlike merge sort, for example)
● Running time: although the worst case running time for QuickSort is O(), for most array inputs it will run in O() time, which is the same time complexity as provided by algorithms like merge sort, heapsort, and binary tree sort. The main advantage of quicksort over the other average-case O() algorithms is the smaller constants associated with quicksort 

# May 5, 2016MIPS|OS

Preliminaries:
• De archive it. You will have a directory called “project”
• Within the directory, there are source files that you will complete. You will also find
two files: auto-mpg.data and auto-mpg.names. Read auto-mpg.names.
• Programing in C, using multiple source files.
Requirements:
1. Complete program files, car.[c|h], LinkedList.[c|h], car_main.c, and Makefile.

# May 4, 2016MIPS | Assembly | Algorithm | EE-352 Final Project Spring 2016

The hard copy of your final project must be submitted
Also the soft copy with executable code must be submitted online
Both submissions must show the output of all steps when A= FC1E8B15 (2’s complement), and B= 00001F9C (2’s complement)
B.H.
Part a- 200 points – Write a MIPS assembly program that reads in two signed 2’s complement integer numbers A and B entered by a user and performs the following:
1- Divides A by B by the method of repeated add/subtract without changing the representation of the numbers and produces the result (Quotient C and Remainder D) in 2’ complement format. It prints all the intermediate steps for producing the result.

# April 29, 2016MIPS | OS | HOMEWORK 8

HOMEWORK 8
1. Assume an invalidation protocol works on a snooping bus for a single cache block (X) with write-back caches. Given the sequence of CPU activities, fill in the rest of the following table. (40 points)

CPU Activity
Bus Activity
CPU A’s Cache
CPU B’s Cache
Memory

# April 25, 2016Haskell | Game | CS35101 – Computer Architecture Spring 2016

CS35101 – Computer Architecture Spring 2016
Project # 3 (25 points)
Due by Sunday, April 24, 2016 by 11:59 p.m. in Subversion
Introduction
In statistics, arithmetic mean μ (or simply mean, average, or expected value) of a series
0, 1, 3, … −1 is defined as:
Project Description
1 −1
= ∑ =0
Write an assembly program that reads a list of floating point numbers from the keyboard and displays the measure given above on the simulator’s console.
The input specifications are given below:
 The input vector should be of given size (provided by the user). For example if the input
is 10, then N=10. You MUST save this number as in integer. Later you will need to
convert it to a float. You may assume the user will not enter more than 20 numbers.
 Each element of input vector should be a 3 decimal digits number (one for integer part
and two digits after decimal point)
For example, given the following input vectors:

# April 16, 2016MIPS | OS | CIS 341 Computer Organization and Programming Systems 2016 Spring Homework 7

1. Read the page table, TLB and Cache table and answer the questions below:

l 14-bit virtual address l 12-bit physical address l Page size = 64 bytes

What would happen if a CPU needs to