Make Commands - Introduction to Engineering - Previous Exam, Exams of Biomedical Engineering

Main points of this past exam are: Make Commands, Complete, Inputs, Outputs, Registers, Invalid Inputs, Program

Typology: Exams

2012/2013

Uploaded on 04/01/2013

nishaa
nishaa 🇮🇳

4.3

(13)

56 documents

1 / 4

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Problem 1 (10 points): MP3 Warmup
In order to allow for more interesting patterns in “Life” it is necessary to use a larger board.
Try writing the code for a subroutine that gets one character of user input that could be either ‘0’-
‘9’ or ‘A’ - ‘V’ and returns the binary value of 0-31 as needed.
Specifics
1. Open a terminal, and type 'ece190' (yes, you need to run the 'ece190' script).
2. Execute 'cd mp3`
3. Execute 'ls -l' and you will see ‘mp3.asm'. If you do not please contact your TA
immediately.
4. MAIN is complete and given, and calls PRINT_ROW 16 times (one call per row).
5. GET_INPUT needs to meet the following specification:
Inputs: NONE
Outputs: R0 - Numeric equivalent of number entered by user.
Registers must be callee-saved.
Note: No invalid inputs (i.e. ‘Z’) will be given to the program.
6. No test vector files or make commands have been provided.
pf3
pf4

Partial preview of the text

Download Make Commands - Introduction to Engineering - Previous Exam and more Exams Biomedical Engineering in PDF only on Docsity!

Problem 1 (10 points): MP3 Warmup In order to allow for more interesting patterns in “Life” it is necessary to use a larger board. Try writing the code for a subroutine that gets one character of user input that could be either ‘0’- ‘9’ or ‘A’ - ‘V’ and returns the binary value of 0-31 as needed. Specifics

  1. Open a terminal, and type 'ece190' (yes, you need to run the 'ece190' script).
  2. Execute 'cd mp3`
  3. Execute 'ls - l' and you will see ‘mp3.asm'. If you do not please contact your TA immediately.
  4. MAIN is complete and given, and calls PRINT_ROW 16 times (one call per row).
  5. GET_INPUT needs to meet the following specification:
    • Inputs: NONE
    • Outputs: R0 - Numeric equivalent of number entered by user.
    • Registers must be callee-saved.
    • Note: No invalid inputs (i.e. ‘Z’) will be given to the program.
  6. No test vector files or make commands have been provided.

Problem 2 (10 points): Debugging For this part, you will be given a LC-3 assembly language program with a few bugs. Your task is to find the bugs by inspection and/or by debugging with the LC-3 simulator and fix them. The program only contains a few bugs (3-4) which you must fix by inserting, deleting, or modifying only a few lines of code (3-6). You may not change the input/output location/format or behavior of the program specified in the program description (in other words, you may only change what is not specified). Modification of non-buggy code and excessive modification of buggy code will be penalized. We suggest copying the code to a temporary location for experimental modification. Problem Description: This program is given an unsigned binary value at x430A, computes (value / 7) (integer division) and writes the result to x430B. Assume that the input value is less than xE000. Specifics

  1. Open a terminal, and type 'ece190' (yes, you need to run the 'ece190' script).
  2. Execute 'cd debug`
  3. Execute 'ls - l' and you will see ‘debug.asm'. If you do not please contact your TA immediately.
  4. Code is complete and given, but buggy.
  5. Fix bugs and save the solution in ‘debug.asm’.
  6. No test vector files or make commands have been provided.

Specifics

  1. Open a terminal, and type 'ece190' (yes, you need to run the 'ece190' script).
  2. Execute 'cd min' and 'ls - l'. You should see 'min.asm'. If you do not, please contact your TA immediately.
  3. MAIN code is complete and given.
  4. GET_INPUT needs to meet the following specification:
    • Inputs: table size and table data from user; table address from memory
    • Outputs: m[x4001] = table size, m[m[x4000..x4000+size- 1 ]] = table data
  5. FIND_MIN needs to meet the following specification:
    • Inputs: table address, table size, and table data from memory
    • Outputs: m[m[x4002]] = min value
  6. CONVERT_HEX is complete and given, and follows the following specs:
    • Inputs: [R 2 - R0] - ASCII user inputs (high-low)
    • Outputs: R0 - 16 - bit result
    • Example: [R 2 - R0] = [x0041 x0033 x0046] => R0 = x 0 A 3 F
  7. Unless otherwise specified as output, all registers must be callee-saved.
  8. Commands that are available for your use:
    • 'make' – assemble program
    • 'make test-input' - assemble program and test the GET_INPUT routine
    • 'make test-min' - assemble program and test the FIND_MIN routine
    • test vector inputs (common to both routines) can be found in vectors.txt
  9. You are responsible for making your own test cases in addition to the ones provide; we strongly suggest you do so.
  10. All subroutines will be individually tested and graded (so finding the minimum value while entering data in GET_INPUT will do you no good for FIND_MIN).