You need to design, simulate, and implement a simple arithmetic logic unit (ALU) that will compute the addition, subtraction, or multiplication of two input signals. If you are not doing the extra credit, the inputs will be assumed to be signed numbers. The system has four control signals: • add (switch 15, i.e., the leftmost switch) • subtract (switch 14) • multiply (switch 13) [Yes, I know it is wasteful, i.e., we could get away with only two input signals, but I wanted to make it easier to use, not necessarily to implement.] The two 3-bit inputs, num1 and num2, are as follows: • num1 (switches 5-3), • num2 (switches 2-0) The output should be 6-bits wide and shown in LEDs 5-0. The output will correspond to the following: • num1 + num2, if add input is 1. If add input is 0, then… • num1 – num2, if subtract input is 1. If subtract input is 0, then… • num1 × num2, if multiply input is 1. If multiply input is 0, then… • the output should be blank, i.e., “000000”. I do expect the arithmetic operations to be performed by using the addition, subtraction, and multiplication operators defined in the numeric_std package discussed in class.
All inputs and outputs are assumed to be signed numbers. Of course, this assumes we are using two’s complement notation. [Remember that in two’s complement notation, the MSB tells us whether the number is positive (MSB=0) or negative (MSB=1).