CIS 351 |
Project 3: Build an ALU |
Fall 2018 |
Combine your adder, adder/subtracter, and comparator from previous projects into a single ALU. Notice that you will not be implementing the ALU described in the textbook. Your ALU will have different operations and op codes.
Your ALU must perform the following 16-bit operations:
Unsigned addition | 0 |
Unsigned subtraction | 1 |
And | 2 |
Or | 3 |
Not | 4 |
Xor | 5 |
lui | 6 |
sltu | 7 |
Signed addition | 8 |
Signed subtraction | 9 |
slt | 15 |
InputA
, InputB
, and Op
.Output
and Overflow
.
Overflow
output to 0 if overflow doesn't apply to the given operation. Specifically, Overflow
should be 0 for all operations except signed addition and signed subtraction. (Interestingly enough, by
definition, unsigned addition and unsigned subtraction do not overflow.)
not
operator returns the negation of InputA
. Ignore InputB
.lui
stands for load upper immediate. Take the lower 8 bits of InputA
and place
them in the upper 8 bits of the output. Ignore InputB
.
slt
stands for set if less than. The output should be 1 if InputA
is less than InputB
and 0 otherwise. slt
treats the inputs as signed integers,
sltu
treats the numbers as unsigned.
Sample16BitALUTest.java
JLS
and DLUnit
. It is in your best interest to start
early in case problems arise. Also, please e-mail me with any bugs you
find or feature requests you have. If JLS crashes, please e-mail me the
JLSerror
file.
This assignment will be scored out of 30 points.
Category | Rubric | Maximum Score |
---|---|---|
Correctness | ||
Not attempted | 0 | |
Passes some tests | 1 point per op | |
Passes all tests | 17 | |
Date 100% correct | ||
Two days early | 12 | |
One day early | 11 | |
On time | 10 | |
One day late | 8 | |
(-2 per day) | ... | |
Five or more days late | 0 | |
Presentation | ||
Documentation and Neatness | 3 |
Penalties
To submit your project:
jls
files that includes
.jls
files, bug reports, and test
scripts using Assignment Manager. (Attaching your test scripts allows
me to determine how well you tested your code, and assess partial
credit if necessary.)
kurmasz
) as a collaborator to your private GitHub or BitBucket project and
send me a
pull
request.
Updated Wednesday, 17 October 2018, 3:14 PM