9/12/04
I got two email messages regarding the first problem
set. Both come from study groups, so I guess some hints are in order.
Actually, it is better to see one of the ten TA's who can take you through
it step by step and allow you the maximum joy of discovery for yourself.
(Yeah, I know. Naive college professor, thinking you are interested in
joy of discovery at 9pm on Sunday night!)
Anyway, moving on:
Dr. Patt, At the moment, my study group and I are sitting here attempting to finish up problem set 1B, with the exception of the first problem, we aren't having a problem. We do have the solution for the problem, however we fail to see how one would arrive at such a complex solution. Any help would be greatly appreciated! << name withheld to protect the study group spokesman >>
OK, then, what does the problem ask for? Answer: A
procedure using the logical operators to figure out when an overflow has
occurred in the addition of two 4 bit signed (2's complement)
integers.
So, then: 4 bits. Step 1. Which positive and negative numbers can
you represent with 4 bits?
Step 2. What is an overflow? Answer: when you perform a binary add
of two integers and get a sum that is outside the range of numbers you
can represent with the number of bits you have available (in this case
4).
Step 3. Generate a couple of examples. We did a few in class,
recall.
Step 4. Can you look at the two numbers (m and n) you are adding,
AND look at the four-bit result (s) and tell if you have a problem on
your hands. HINT: there are two cases. What are the two cases?
Step 5. Look at each case individually. For each case, how do you
detect that case. ...using the logical operators.
Step 6. What logical operator allows you to represent the fact that
one of those cases has occurred.
The above is not trivial. But it should get you thinking. And, if
you were not able to generate it by yourself without going through all
these steps, don't give up. ...PLEASE! We are just getting
started. Better to struggle with the thinking on problem sets where
you can work together in your group or get the help from the TAs or
me, than be asked to think for the first time on the exam.
The question now is: Do you understand how to do this, following
these steps? If yes, great. If not, see a TA, or if that still does
not work, see me.
Finally, please do not memorize this problem and its solution. You
will NOT see it on any exam. What you will see is a problem that
requires similar methodology. But the exam question will be
sufficiently different that if I do a good job coming up with an exam
question, memorizing the steps above will have done you no
good. UNDERSTANDING the process we went through above on the other
hand will help you.
Good luck.
Yale Patt