Assignment on Microcode, SPIM - Introduction to Computer Engineering | ECE 2030, Assignments of Electrical and Electronics Engineering

Material Type: Assignment; Professor: Yalamanchili; Class: Intro to Computer Engr; Subject: Electrical & Computer Engr; University: Georgia Institute of Technology-Main Campus; Term: Spring 2008;

Typology: Assignments

Pre 2010

Uploaded on 08/04/2009

koofers-user-dft
koofers-user-dft 🇺🇸

10 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Yalamanchili
GEORGIA INSTITUTE OF TECHNOLOGY
School of Electrical and Computer Engineering
ECE 2030: Sections C & D
Spring 2008
Assignment #5
No late assignments will be accepted.
This assignment has two parts with two due dates.
Part I: Due date: Monday, April 7th, 2008, midnight (not Sunday night)
electronically to your TA.
Microcode
1. Write the microcode to compute the expression R1 = [(R4-(3*R6))/4] + 1024
2. Write the microcode to reverse the order of the bytes stored at memory location 0x1024
and store the result in memory location 0x1028.
3. The word at memory location 0x1000 has the address of the first word of an array of four
words. Compute the sum of the elements of the array and have this sum stored in register
R5.
SPIM
A string was encrypted with the following sequence of operations.
For each character (byte) of the string:
1. Add 4 to the byte
2. XOR the result with the corresponding byte of a key (provided below)
3. Subtract 2 from the result
Repeat for next byte until end of string.
The resulting string after encryption was “Y@XCQLe” (Does not include the quotation
marks). The key used was “*+-26%#” (Does not include the quotation marks). Your task is to
write a SPIM program that uses the resulting string and key as input and produces the
decrypted string and store the decrypted string back in the data segment. Print the decrypted
string to the screen. Code to print a string can be found in the example code provided for
Assignment 4.
Do this by reversing the operations for encryption. You can store the input and output strings
in memory using data directives as you did in Assignment 4. Note: To decrypt you have to
perform operations above in reverse order and perform the inverse operation in each step, i.e.,
pf3

Partial preview of the text

Download Assignment on Microcode, SPIM - Introduction to Computer Engineering | ECE 2030 and more Assignments Electrical and Electronics Engineering in PDF only on Docsity!

GEORGIA INSTITUTE OF TECHNOLOGY

School of Electrical and Computer Engineering

ECE 2030: Sections C & D

Spring 2008

Assignment

No late assignments will be accepted.

This assignment has two parts with two due dates.

Part I: Due date: Monday, April 7 th, 2008, midnight (not Sunday night)

electronically to your TA.

Microcode

  1. Write the microcode to compute the expression R1 = [(R4-(3*R6))/4] + 1024
  2. Write the microcode to reverse the order of the bytes stored at memory location 0x and store the result in memory location 0x1028.
  3. The word at memory location 0x1000 has the address of the first word of an array of four words. Compute the sum of the elements of the array and have this sum stored in register R5.

SPIM

A string was encrypted with the following sequence of operations. For each character (byte) of the string:

  1. Add 4 to the byte
  2. XOR the result with the corresponding byte of a key (provided below)
  3. Subtract 2 from the result Repeat for next byte until end of string.

The resulting string after encryption was “Y@XCQLe” (Does not include the quotation marks). The key used was “*+-26%#” (Does not include the quotation marks). Your task is to write a SPIM program that uses the resulting string and key as input and produces the decrypted string and store the decrypted string back in the data segment. Print the decrypted string to the screen. Code to print a string can be found in the example code provided for Assignment 4.

Do this by reversing the operations for encryption. You can store the input and output strings in memory using data directives as you did in Assignment 4. Note: To decrypt you have to perform operations above in reverse order and perform the inverse operation in each step, i.e.,

if you multiplied by 4 during one step of encryption, you divide by 4 to decrypt. This part does not have to use iteration.

Submission Guidelines : You must submit your assignment electronically to your section TA. Place “ECE 2030 Assignment 5 Part I” in the subject line. The microcode should be completed electronically using the microcode template placed on the section webpage under “Supplemental Readings and Notes” associated with each lecture.

Grading Guidelines: Here are the grading guidelines for the SPIM component of the assignment.

  • Program compiles without errors (and seems generally correct): 35 pts
  • Program executes correctly: (additional) 50 pts
  • Documentation and description of the program: 15 points
    • Documentation takes the form of well commented code.

Suggestions :

  • Write and test blocks of code first. For example, the block of code that prints the string to the screen.
  • Use breakpoints to help in debugging.
  • Use single step mode as the final resort in debugging. It is time consuming but gives you the most information.