Homework 1 Solution

$30.00 $24.90

Description

This is a warm-up project whose objective is for you to set up the infrastructure you need for subsequent assignments. Help is available through piazza on our course t-square site, during TA office hours (http://www.ece.gatech.edu/academic/courses/ece2035/help/index.html), and by sending email to ece2035-help@ece.gatech.edu. There are also helpful links to tutorials and primers here: http://www.ece.gatech.edu/academic/courses/ece2035/assignments/index.html.

HW1-1: The goal of this part is to use a Linux/Unix environment and become familiar with its facilities. Toward this end, you must either acquire/access and run an appropriate Linux/Unix distribution that fits your computing environment or connect to a machine in the Klaus 1448 Linux cluster. The following are some the options available:

Terminal shell on Mac OS X

Linux Bash shell on Windows 10 (Anniversary Update): installation guide

VMware on Windows 8 or 10: installation guide Virtual Box on Windows 8.1

Dual booting Ubuntu 12.04 and Windows 7 Red Hat on Linux machines in Klaus room 1448 Running native Ubuntu (e.g., 14.04.3 LTS)

Once you do this, then perform the following exercises.

  1. Create and edit a text file that contains the following:

    • Tell one interesting fact about yourself.

    • Which Linux/Unix distribution are you using (e.g., Ubuntu 14.04.03)?

    • The method you are using to run Linux/Unix (e.g., one of the options above).

  1. Find a suitable application to capture a screenshot which shows your text file open in an editor, running under Linux/Unix.

  2. Submit your screenshot in jpeg format in a file of size no greater than 200K.

In order for your solution to be properly received and graded, there are a few requirements.

  1. The file must be named HW1-1.jpg.

  1. The file must be less than 200K bytes.

  2. Your solution is due on the T-square site at 5:00pm on Monday, 29 January 2018. It will be accepted without penalty until 11:55pm.

Please note that for all solutions uploaded to T-square, all filenames must be exactly as specified, including proper capitalization and file extension (e.g., HW1-1.jpg, HW1-2.c, etc.).

HW1-2: The goal of this part of the project is to modify a short C program, compile it using the GNU C Compiler gcc, and run it. A program shell HW1-2-shell.c is provided. You must copy/rename it to HW1-2.c and modify it to compute the following.

The shell program has an integer array declared and initialized as the global variable A. Your task

is to compute the value max [ ] . Your program should print out the maximum magnitude

$%&%'(

using the print statement in the shell code. Be sure to try multiple test cases, but do not change the declaration of the global variables (you should change only their initial values. Note that your program may NOT use any library functions other than printf.

You should open a “terminal window” to run gcc under Linux/Unix (type man gcc for compiler usage or look up GCC online documentation on the internet). If you do not have gcc installed, you

1

ECE 2035 Homework 1

can use “sudo apt-get install gcc” (see this article or this one for quick tutorials on apt-get and installing packages).

Note that in the terminal window, you can enter any of the Linux commands (such as ls, cd, cp; for reference see http://ece2035.ece.gatech.edu/assignments/Linux_Cmd_Cheatsheet.pdf). Use the Linux command cd to change your current working directory to the directory in which you placed the shell program. For example,

> cd ~/Documents/2035/hw1

or

> cd /mnt/c/Users/Linda/2035/hw1

You can list the files in that directory using

> ls -la

You can copy a file using cp or rename a file using mv (move a file to a new file). For example:

> cp HW1-2-shell.c HW1-2.c

You can use any of the available text editors normally found on Linux, including vi, vim, and emacs. Using the text editor of your choice modify the HW1-2.c program to compute the span as described above.

Once you write your program, you can compile and run it using the Linux command line:

  • gcc HW1-2.c –g –Wall –o HW1-2

  • ./HW1-2

You should become familiar with the compiler options specified by these flags.

In order for your solution to be properly received and graded, there are a few requirements.

  1. The file must be named HW1-2.c.

  1. Your name and the date should be included in the header comment.

  1. Do not #include any additional libraries.

  1. In the starting shell program, it is especially important not to remove or modify any print statements since they will be used in the grading process.

  1. Your solution must include proper documentation and appropriate indentation.

  2. Your solution is due on the T-square site at 5:00pm on Monday, 29 January 2018. It will be accepted without penalty until 11:55pm.

HW1-3: The goal of this part is for you to install MiSaSiM, modify a short assembly program HW1-3-shell.asm, simulate, test and debug it in MiSaSiM. The MiSaSiM simulator can be installed according to the instructions at http://lindawills.ece.gatech.edu/misasim/. Copy or rename the shell program to HW1 -3.asm and modify it to compute the maximum magnitude as in HW1-2. Store the maximum computed in the memory location labeled max. The array A contain exactly 16 signed integers. Be sure to try multiple test cases by changing the initial values.

In order for your solution to be properly received and graded, there are a few requirements.

  1. The file must be named HW1-3.asm.

  1. Your name and the date should be included in the beginning of the file.

  1. The starting shell program should not be modified except for the replacement of the com-ment “# write your code here…”

  1. Your program must store its result at the memory location labeled max when it returns. This answer is used to check the correctness of your code.

  1. Your program must return to the operating system via the jr $31 instruction. Programs that include infinite loops or produce simulator warnings or errors will receive zero credit.

  1. Your solution must include proper documentation.

  1. Your solution is due on the T-square site at 5:00pm on Monday, 29 January 2018. It will be accepted without penalty until 11:55pm.

Honor Policy: In all programming assignments, you should design, implement, and test your own code. Any submitted assignment containing non-shell code that is not fully created and debugged by the student constitutes academic misconduct. The only exception to this is that you may use code provided in tutorial-0.zip or in the examples on the course website as a starting point for your programs (http://ece2035.ece.gatech.edu/examples/index.html).

3