CSc 252 Homework 4
Version 1.0
June 27, 2011
Homework 4 Solutions to Problems Turned-In
5. turnin this one (20 points) The Caller
passes 3 arguments to the function kilo. The Callers $fp
Caller needs to preserve the $t3 register. The
function kilo want
CSc 252 Homework 3
Version 1.0
June 20, 2011
Homework 3
Due: 6:00 p.m. Thursday, June 25th.
Turnin: Problems 5, 8, and 9. Solutions to the other problems are attached.
How to Turnin:
Bring your homework to class.
Bring your homework to my ofce and ha
First Name: _
Last Name: _
Sample Quiz #7
CSc 252, Spring 2014
Use only these MIPS instructions in answering the questions that need MIPS solutions.
Category
Instruction
add
add
immediate
subtract
Arithmetic
multiply
signed
multu
unsigned
divide
si
CSc 252 Program 1
Version 1.0
Program 1: Array Practice
Program due: Thursday, September 29th, 11:59 p.m.
Write a MIPS program named prog1.s.Your program will use an array labeled values. The
number of words in the array will be stored in a word labeled n
CSc 252 Homework 4
Version 1.0
Homework 4
Due: 10:30am Tuesday, O ct. 18, 2011
Turnin: T wo solutions: 3, and 4. To receive credit for your solutions, you must show your
work where applicable. Solutions to the remaining problems are attached.
1. For the f
Solutions to Quiz #2 CSc 252, Summer 2011
Questions 1, 2, 3, 4, 5, 6 and 7 assume the following MIPS code, which sets up memory
locations: erie, drgw, cbq, epsw, fwd and newline. The code then loads the values of some of
these variables into the indicated
Solutions to Quiz #1 CSc 252, Summer 2011
1. (10 points) Given the two, 16-bit signed, twos complement, binary numbers:
!
a = 1000 1010 1101 0010 8ad2 35,538
!
b = 0101 0000 0111 1001 5079 20,601
a.) What is the result of a+b? Is there overow? b.) What is
Solutions to Quiz #4 CSc 252, Summer 2011
1. (10 points) The Caller sends 2
Callers $fp
Callers stack
Callers $sp
delta's $fp
contents of $a3
parameters to the procedure delta. The Caller
does not need to preserve any $t registers.
The procedure delta nee
package dicetray;
/*
* Model the tray of dice in the game Boggle.
* A DiceTray can be constructed with a 4x4 array of characters for testing.
*
* This does not include the 16 Boggle dice or the second constructor that
* simulates rolling 16 dice int
Solutions to Quiz #3 CSc 252, Summer 2011
1. (10 points) For
the logic circuit shown a
to the right, complete b
the truth table. For the
labeled gates, G1, G2, G3, G4,
G5, G6, and G7 state the
output for the given c
input values of a, b and
c. Note that t
CSc 252 Homework 2
Version 1. 0
Homework 2
Due: 10am Tuesday, Sep. 20, 2011
Turnin: Three solutions: 1 g, 1 h, and 2 g. To receive credit for your solutions, you must show
your work where applicable. Solutions to the remaining problems are attached.
In an
CSc 252 Homework 1
Version 1.0
June 6, 2011
Solutions to Problems Turned In
1. Assume that 16-bit, twos complement, binary numbers are being used in this problem.
Some binary arithmetic and conversions. For each of the pairs of numbers below, compute:
CSc 252 Program 2
Version 1.0
Program 2: Swapping Numbers
Program due: Thursday, October 13th, 11:59p.m.
Write a program, named prog2.s, that will swap adjacent values in an array of integers. The
array will be named numbers. The memory location numValues
CSc 252 Homework 1
Version 1.0
Homework 1
Due: 10am Tuesday, Sep. 06, 2011
Turnin: Four solutions: 1 iv, 1 v, 5 and 9. To receive credit for your solutions, you must show
your work where applicable. Solutions to the remaining problems are attached.
1. Ass
CSc 252 Homework 4 !
Version 1.0!
June 27, 2011
Homework 4
Due: 6:00 p.m. on Thursday, June 30th.
Turnin: Problems 5, 11 and 12. The others are practice for the quiz. Solutions to the practice
problems are attached.
How to Turnin:
Bring your homework to
CSc 252 Homework 5
Version 1.0
July 5, 2011
Homework 5
Due: nothing to turn in for this assignment. These exercises are intended to help you in
reviewing pipelining for the Final Exam.
Turnin: nothing.
1. Using a drawing similar to Slide 25 of 7 Pipeli
Storing Information Digitally
Read: Sections 2.4, 3.1, 3.2
Binary Basics:
Why binary numbers?
In a digital computer, all information is represented using the binary number system.
It is easy to build fast electronic circuits that operate on the basis of t
CSc 252 Homework 3
Version 1.0
February 23, 2014
Homework 3
Due: 6:00 pm Thursday, February 27th
Turnin: Four solutions: 5, 13, 15, and 20. To receive credit for your solution, you must show
your work where applicable. Solutions to the remaining probl
First Name: _
Last Name: _
Sample Quiz #2
CSc 252, Spring 2014
The questions on this quiz assume the following MIPS code, which sets up memory locations:
shiloh, sumter, antietam, aramis, porthos, athos, dumas, monte, and cristo. The
code then loads
First Name: _
Last Name: _
Sample Quiz #3
CSc 252, Fall 2015
This is a 30 minute quiz, and contains 5 questions on 7 pages worth a total of 55 points. It is a
closed-book, closed-notes quiz. Foreign-language-to-English dictionaries and calculators are
all
CSc 252 Program 1
Version 1.0
February 6, 2014
Program 1: Printing, Multiplying, Subtracting
Program due: Thursday, February 13th, 9 p.m.
Write a MIPS program named prog1.s. The program will perform up to three actions on six
values. The action(s) per
First Name: _
Last Name: _
Sample Quiz #3
CSc 252, Fall 2013
This is a 30 minute quiz, and contains 6 questions on 4 pages worth a total of 54 points. It is a
closed-book, closed-notes quiz. Foreign-language-to-English dictionaries and calculators a
First Name: _
Last Name: _
Sample Quiz #4
CSc 252, Spring 2014
Use only these MIPS instructions in answering the questions that need MIPS solutions.
Category
Instruction
Example
add
add
add
immediate
addi $s1, $s2, 17
subtract
Meaning
$s1, $s2, $s3
CSc 252 Testing Programs
Version 1.0
February 6, 2014
Testing CSc 252 Programs
This document describes how to use the testing script along with the provided test cases with
your programs for CSc 252. The technique will be the same for each programmi
CSc 252 MIPS to lectura
Version 1.0
February 6, 2014
Getting your MIPS program to lectura
To use the provided testing script, you will need to copy your MIPS program to lectura. This
page contains the instructions for copying your program from the depa
MIPS Introduction
Read: Chapter 2 and Appendix B (4th edition)
The appendix is available as http:/pages.cs.wisc.edu/~larus/HP_AppA.pdf from spim website.
Note: The on-line version is named Appendix A. It is the same as the 4th editions Appendix B.
Lang
CSc 252 Program 5
Version 1.0
November 5, 2015
Program 5: Average
Program due: Thursday, November 12th, 9:00 p.m.
Write a program named prog5.s. The program will compute baseball batting percentages. The
formulas for computing these for a player are based
Topic 5 Procedures in MIPS
Reading: Section 2.8, pages 112-122 (4th) or 96-106 (5th); Spim Appendix Section A.6, pages A-22 to A-33
Overview:
Structure programs:
Make them easier to understand, and
Make code segments easier to re-use.
Problems:
Want to ca