Question: CprE 381 Homework 1 [Note: This homework covers material on the construction and definition of ISAs and begins to get you introduced to MIPS. It

CprE 381 Homework 1

[Note: This homework covers material on the construction and definition of ISAs and begins to get you introduced to MIPS. It also has you start to run MIPS programs through a simulator (SPIM or MARS) that you will use going forward both in homework AND to help test your term project. A little extra time spent working with SPIM now will pay off later.]

1. ISAs a. Identify the following aspects as more RISC-like or more CISC-like i. Variable-length instructions ii. Memory-memory operations iii. Load-store architectures iv. Regular instruction formats v. Many instructions vi. Few instructions b. Identify if the following choices are ISA choices, ABI (but not ISA) choices, or micro-architecture choices (note that some of these may have multiple answers): i. Number of named registers ii. Number of cycles an instruction takes to execute iii. Whether or not immediate operands can be used directly in arithmetic instructions iv. Which register number is the stack pointer v. Which, if any, registers numbers produce constants (e.g., 0 or -1) vi. Which register numbers pass arguments to function calls vii. Which register numbers are temporary or saved viii. Addressable address range for memory operations ix. Type of adder used in the ALU x. Which instructions update the PC xi. Which bits of an instruction correspond to the opcode or an operand xii. Number of functional units in the processor

2. MIPS a. Identify three products not mentioned in lecture that use a MIPS-based processor. b. MIPS does not have a true mov instruction (mov dst, src #dest=src). Why would such a simple, basic instruction not be included in a RISC ISA? List three arithmetic or logical instructions or instruction sequences not mentioned during lecture that produce the same effect as a mov instruction. c. What does the following program do (give a description in English sentences)? xor $1, $1, $2 xor $2, $1, $2 xor $1, $1, $2 d. Assume that variables a, b, c, and d are mapped to registers $s0, $s1, $s2, and $s3, respectively. Write a MIPS program that implements a = b * 2 + c/4 + d%8 using only add, sub, addi, and, andi, or, ori, sll, and srl instructions. Since b, c, and d must not be overwritten, use as many temporary registers ($t0-$t9) as needed.

3. SPIM / MARs a. Read the introduction to SPIM simulator in P&H A.9. Note that you probably will not understand everything in this section, yet, since we have have not covered the corresponding material, but it will provide you with a reasonable overview. However, you should be able to answer: does SPIM simulate the ABI, ISA, and/or microarchitecture of MIPS? b. Load prob3.s into your simulator. Run three times with different inputs and report the result. Looking at the code, what does this program do? c. Modify prob3.s to print the mathematical floor of an average of 8 inputs (this should require adding 1 (one) line of assembly code and changing a number or two). Submit your new program as prob3_.s.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!