ECEn 424 Set #1
ECEn 424 Homework Set #1


Here are four things you should do before submitting this homework assignment.
  1. Carefully read the syllabus on Learning Suite and familiarize yourself with other information that is there.
  2. Obtain a CAEDM computer account that allows you to access department and/or college Linux machines.
  3. Consider this quote from the syllabus regarding formatting expectations as you prepare this and all subsequent homework submissions:
    All submissions should clearly identify your name, the course number, the assignment number, and each problem worked. Since some homework submissions can get a bit lengthy (with your source code and program output included), please make it easy to find your answer. Consider using a highlighter pen, penciled-in brackets, handwritten labels, etc. Without exception, you should use a fixed-width font for all code listings so they can be scanned quickly by the TAs. If the TAs can't decipher your submission, you may not get the credit that your work deserves.
  4. Finally, note that you are expected to produce your own solution for all assigned homework problems. Solutions to this and other assignments may exist out there on the web somewhere, but don't go looking for them -- you're violating BYU's honor code and shortchanging your own education if you do.


Homework assignments for this class are intended to both expose you to issues of interest and give you some C programming experience. Unless the problem explicitly states otherwise, assume that you should verify that your solution is correct by writing and running a C program. For all such problems (including 3 of the 4 problems below), your submission should include

For those of you unfamiliar with C, we've made it much easier to create code to test your answers on many problems by giving you some C code to start with. Often the links to this code will be given in the Clarifications section of each assignment. Always read this section carefully -- the information can save you a great deal of time!


Upload a pdf or text file containing your solutions to the problems below to Learning Suite before 11:00pm on the assigned date.

  1. Problem 2.61 (from the text)
  2. Problem 2.71
  3. Problem 2.72
  4. Problem 2.77
  5. Problem 2.82
  6. Problem 424-1:
    Consider the C code below.
         #include <stdio.h>
    
         main()
         {
    	 float f,g;
    	 f = 0.0;
    	 g = f + 1.0;
    	 while (f != g)
    	 {
    	     f = g;
    	     g = f + 1.0;
    	 }
    	 printf("Does it ever get here?\n");
         }
         

Clarifications

Problem 2.61 is good preparation for the first lab. The whole point of the restricted coding rules is to get you thinking about things from a different perspective. You can find skeletal code to help write and test your solution here. With this problem and other homework problems, when using skeletal code provided, please turn in only that code you wrote with your submission.

For Problem 2.71, you should use this code to test your solution. Make sure you understand why the original code fails, and make sure to test your code on a variety of different values of the word. (Just change the initialization in the C code and recompile.) You should include some results (output) in your submission, but you need only include the C source code for the new version of xbyte() (actually myxbyte()) that you create.

Problem 2.72: You should submit both code to fix the problem and output to show that the original code didn't work and that your new code does work. Here is some C code that should serve as a good starting point for test code that calls the copy_int() function. Make sure you understand what this code does if you use it.

For Problem 2.77, please use this code framework to test your solution. Make sure you try it with different values of x. Your submission should include results (output) from at least one run and the source code to the main.c function after you add the four required C expressions. All parts (A-D) can be done in 3 operations or less.

For Problem 2.82, no source code or results are required in your submission.

The last task

Some of the coursework in 424 must be run on the SPICE machines setup by CAEDM. In past semesters, students were able to use them on campus (and some of them are still available). However, you will likely need to log in remotely from home. SSH makes remote access possible, so you are required to test the SSH connection in this homework. Add a statement that you can access the SPICE machines at home in your homework submission. Come to TA hours if you need any help.

If you have never used SSH service before, there is a webpage SSH introducing it. Also, you can learn about it at the following link: CAEDM SSH.

As the first webpage says, you cannot access the SPICE machine directly when you are off-campus. You can follow its instruction, ssh into "ssh.et.byu.edu", which is accessible off-campus, then ssh into one of the SPICE machines. Alternatively, if you know how to use the CAEDM VPN, see CAEDM VPN, you can connect to VPN in one click, then you can ssh into SPICE machines directly.

Once you have figured out how to use SSH, you can ssh into the spice lab by using a hostname of the form: spice-##.ee.byu.edu where ## is the number of the the spice machine you wish to ssh into (spice machines are numbered from 01 to 48). For example if you wanted to ssh into spice machine 08, spice-08.ee.byu.edu will be the SSH server address. No matter which one you pick, the user account is always your CAEDM account.


Last updated 30 December 2021