ECEn 324 Set #1
ECEn 324 Homework Set #1


Here are four things you should do before submitting this homework assignment.
  1. Look through the class web pages carefully and familiarize yourself with all information found 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 be 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, they can't give you the credit you deserve.
  4. Finally, make a note of this statement of policy from the course syllabus, applicable to all homework assignments.
    You may collaborate with other students as you do your homework, but if you do, you must report who you collaborated with on your homework assignment. Downloading homework solutions from the internet or submitting the work of anyone else and representing it as your own will be treated as a violation of BYU's honor code.
    In short, solutions may exist to this and other assignments out there in netland, but don't go looking for them -- you're shortchanging your own education if you do, and it is easier to detect cheating than you might think.


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 the problems where you do this (including all 3 problems for this assignment), 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!


Submit your (hardcopy) solutions to the problems below in the homework box before 5:00 PM on the assigned date.

  1. Problem 2.59 (from the text)
  2. Problem 2.61
  3. Problem 2.71

Clarifications

As noted above, your submission should include -- for each assigned problem -- C source code and actual output for representative input values. You should test your code thoroughly, but your submission need not include all test results.

For problem 2.59, you should write, compile, and run a C program that performs the requested operation on several different values of x and y. (It is always a good idea to test your code thoroughly.) You can find skeletal code to help 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.

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.

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.


Last updated 2 May 2013