Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Lab # 3 Instruction Set Architecture Last weeks modules discussed how computers represent information. In this week's modules we are looking at how computers store

Lab # 3

Instruction Set Architecture

Last weeks modules discussed how computers represent information. In this week's modules we are looking at how computers store and interpret data and instructions.

The goals of this week's lab are to: 1) understand how the MIPS Instruction Set Architecture represents data and instructions in computer memory as well as 2) learn how to interpret a MIPS instruction in memory using the MARS MIPS Simulator.

Objectives:

In the hands-on section of this lab we are looking at how data is organized in the MIPS architecture, how data is stored in registers and in main memory, and the basic MIPS instructions to manipulate that data.

The following are the primary objectives of this lab session:

Introduction to MIPS data types

Understand MIPS architecture data alignment requirements

Perform basic arithmetic in the MARS Simulator

Recognize data overflow

Load data from memory into MIPS registers

Store data into memory from MIPS registers

Perform basic load store operation in the MARS Simulator

Use logical operations to make a decision to dictate program flow

Instructions:

Understand the Application

You will create two int variables, myId and nLet as follows:

myId = The sum of the numbers in your Foothill College student ID. (This is the sum of an 8-digit number; not to confuse it with your social security # or a password, which it is not).

nLet = The number of letters in your family (last) name.

In order to receive any credit for this assignment, these two values must match what I have for you on my class roster.

Your program will compute some values based on these two numbers, so that each student will have a unique output.

The Program Spec

The following expressions assume that you have stored the sum of the numbers of your student ID (i.e. the variable myId) into the $s0 register, and the number of letters in your last (family) name (i.e. the variable nLet) into the $s1 register. Load these variables as immediate values into the save registers as specified.

Your program should compute and display the results for the following expressions:

expression1: nLet + myId

expression2: nLet - myId

expression3: nLet * 4

expression4: even adjust(nLet + myId) /2

The action of even adjust will require your program to make a decision (prior to executing expression4) as to whether or not the sum of nLet + myId (i.e. expression1) is even or not. If the original sum is odd subtract 1. Either way (i.e. an even or odd sum for expression1) proceed to execute expression4.

Write a MIPS program that computes and display the results of these four expressions.

Your program display in the MARS Run I/O window should look something like this (although the values will differ for each student):

My family name is Student

My Student ID is 12345678

The value of myId is 36

The number of characters in my last name is 7

The expression result values will be in the temporary registers (i.e. store expression1 in $t1, expression2 in $t2, etc. ...).

Here are some tips and REQUIREMENTS:

1. The first thing your program needs to do is print out your family (last name), your student ID, your myId value and your nLet value. Create strings and use the print_print syscall to display this information to the MARS Run I/O window.

1. Load immediate values for myId and nLet in $s0 and $s1. Retain these original saved values (i.e. do not write expression results into these save registers).

2. Store expressioni in temporary register ti. Temporary register $t1 can be modified if an even adjustment is needed in expression1.

3. Use shift operations for the multiply and divide expressions.

4. Be sure that your program makes a decision as to whether or not your expression1 is even or odd.

5. Ensure that your solution is well organized. Provide comments to organize your source code. Include a register use list in your program header file.

Deliverables:

Part 1 Lab Session: Submit the following four pieces of information:

1) .asm source file: yourNameLab3.asm (i.e. Ann Foothill's lab 3 would be named annFoothillLab3.asm).

2) A screenshot of the Mars Messages window to verify that the assemble operation completed successfully for your .asm program.

3) A screenshot of the Run I/O window to verify the run of your .asm program.

4) A screenshot of the Registers panel.

Note: (.txt, .png, .docx, .jpg) file(s) of your choice) can be used to present the screenshots for item 2-4) Item 1) must be a .asm file. No zip files.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Expert Oracle Database Architecture

Authors: Thomas Kyte, Darl Kuhn

3rd Edition

1430262990, 9781430262992

More Books

Students also viewed these Databases questions

Question

=+ What is the role of government in bargaining?

Answered: 1 week ago

Question

=+ Who is the negotiation partner at company level?

Answered: 1 week ago