these are the 2 files opened
The class should be named ALU. It should have a public static method called "doOperation" with signature: public static int doOperation(int op, int r2, int r3) In our instruction set (OurSA.txt), we have a list of operations which should be supported by our ALU. These are coded from 0000 through 1101, which correspond to integers 0 through 13. do Operation should do the appropriate operation from the list based on which value is passed as op and return the result of that operation on the input values. That is, if op is 0, then it should do operation 0000 which is subtraction and thus it should return r2-r3. If it is passed an invalid operatior the method is allowed to return anything it wants. There are tests on codepost.io for class and method name and then one test for each of the different operations. Shift and rotate operations will always have an r3 value between 0 and 31 inclusive. Any other operations can be passed any value for r2 and r3. Assignment Details Spring 2021 Computer Architecture (CIT-3322-02, CS... operations can be passed any value for r2 and r3. Notes: 1) This should probably be implemented via a large if/elseif/elseif statement or a switch statement 2) Some operations only work on a single value. These operations should operate on r2, not r3. 3) The right shift is an unsigned right shift which is the same as the >>> operator rather than >> 4) Please note that there are Java operators for most of the required operators. Check the bitwise operators slides ( 01 bits.pdf ) if you need a reminder of operators for shifting, bitwise and, or, not, and xor. 5) There is no built-in rotate operator in Java, but it can be implemented as follows: Left rotate: (rotate number v by b bits to the left) (v b) I (v >>> (32 - b)) operations can be passed any value for r2 and r3. Notes: 1) This should probably be implemented via a large if/elseif/elseif statement or a switch statement. 2) Some operations only work on a single value. These operations should operate on r2, not r3. 3) The right shift is an unsigned right shift which is the same as the >>> operator rather than >> 4) Please note that there are Java operators for most of the required operators. Check the bitwise operators slides ( 01_bits.pdf) if you need a reminder of operators for shifting, bitwise and, or, not, and xor. 5) There is no built-in rotate operator in Java, but it can be implemented as follows: Left rotate: (rotate number v by b bits to the left) 1) This should probably be implemented via a large if/elseifelseif statement or a switch statement 2) Some operations only work on a single value. These operations should operate on r2, not r3. 3) The right shift is an unsigned right shift which is the same as the >>> operator rather than >> 4) Please note that there are Java operators for most of the required operators. Check the bitwise operators slides (01 bits.pdf ) if you need a reminder of operators for shifting, bitwise and, or, not, and xor. 5) There is no built-in rotate operator in Java, but it can be implemented as follows: Left rotate: (rotate number v by b bits to the left) (v b) | (v >>> (32 - b)) Right rotate: (rotate number v by b bits to the right) (v >>> b) | (v