Wed, 5 Oct 2011, 13:43
A student writes: > Hi Dr. Patt, > Maybe what I am asking is to obvious but I am not sure if my assumption > is correct. Do we have to pick any 16-bits number to reverse it? I don't > see any giving number at the handout. > Thank you for taking the time to answer my question. > Have a nice day. > <<name withheld to protect the student who wants to know which number>> Most questions are obvious after you see the answer, and not so obvious when you are encountering a situation for the first time. For those of you who have no previous experience with programming (and many of you are in this category), it is not surprising that you have this question. Answer: Your job is to write a program that will reverse the bits of the word stored in x3100, regardless what that word is. Like most programs, it must work on all input data, not just on some values that have been selected by you. The assignment states: "Your program should assume that the word to be reversed is stored in memory location x3100." What that means is we will put some random bit string in location x3100, and then execute the program you submit. After the program finishes, we will look in location x3101, where we will expect to find the bit string of location x3100, but with all bits reversed. For example, if we happen to put 1100011110000010 (we have 2^16 choices of what we put in x3100), we will expect to see 0100000111100011 in x3101 after your program executes. OK? Good luck with this, your first program. Yale Patt