HW7 Notes - cs61c-rc
Common mistakes, point deductions, and error codes follow. If you got some sort of letter-number combination in your comments, and you're wondering what it means, you're in the right place. If unspecified, an error is probably worth half a point, although half point errors may be nullified through good programming practices or if more major errors existed which caused your score to drop substantially.
General
- Signed overflow: A good way to remember signed overflow is that a signed overflow occurs when you add two numbers with the same sign and you get a result with the opposite sign. For subtraction, a signed overflow can only occur when you subtract two numbers with opposite sign, and the sign of the result does not match the sign of the first number. Eg. if you take 0x8000 - 0x0001, you'll get 0x7FFF, which is a signed overflow because 0x8000 is the most negative 16 bit integer, and by subtracting 1 from it you overflow to a positive integer.
- Unsigned overflow should be pretty straightforward for addition, you simply add two numbers that are two big to fit in the data size that you are using to represent integers. In the 16 bit example, adding 0xFFFF and 0x0001 would cause unsigned overflow, although this is not a signed overflow because in signed arithmetic, it's just -1 + 1 = 0.
- In terms of logic, the formulations for signed overflow that I gave above are fairly easy to translate into digital logic. For unsigned overflow for addition, it should be sufficient to check the carry out of the last bit adder.
- It was fairly common for people to not use two's complement in CMP. This was really just a case of following instructions. Always be 100% sure of what the question is asking before you answer.
- Some people didn't understand what the restrictions were on the assignment.
You may only use tools from the "Base" and "Gates" libraries in Logisim. Do not use any items from the Memory, Plexers, Arithmetic, or Legacy libraries.
Note that it includes Gates, so you could have used for example the 16 bit AND gates from the Gates library rather than build your own 16 bit gates out of 2 bit gates. I only mention this because some people had errors due to this. This goes along with reading and understanding the question properly.
- With regard to a testing mechanism, Long decided in the end that as long as you made some sort of effort towards a testing mechanism, it would be OK, otherwise you would lose 1 point. I did not count hooking up the ALU to some inputs and outputs as a testing mechanism, because the ALU already has inputs and outputs, and hooking up inputs and outputs to the ALU results in an equivalent combinational logic circuit and adds nothing in the way of testing.