Question: 5 . ( 2 0 POINTS ) Design a 5 - bit ALU that supports the following modes of operation: - A OR B -

5.(20 POINTS)
Design a 5-bit ALU that supports the following modes of operation:
- A OR B
- A XOR B
-\(\mathrm{A}+\mathrm{B}\)(addition)
For extra credit, implement the following additional modes:
-(3 points)\(|\mathrm{A}-\mathrm{B}|\)(absolute value of the difference of A and B )
-(3 points) A MUL 4(multiply A by four using shift left
Your ALU should have at least the following inputs and outputs:
- Inputs:
Cin (incoming carry bit)
A (five bits, interpreted as a 2's complement signed or unsigned integer)
- B (five bits, interpreted as a 2's complement signed or unsigned integer)
- Outputs:
- Cout (outgoing carry bit)
- R (five bits of the result, interpreted as a 2's complement signed or unsigned integer)
For extra credit, implement the following additional outputs:
-(1 point) Eq a single bit output which is 1 when A is equal to \(\mathrm{B},0\) otherwise
-(1 point) SgnA a single bit output which is 1 when A is negative, 0 otherwise
-(2 points) OnesA a multi-bit output interpreted as an unsigned integer representing the number of 1's in A. You need to determine the number of bits in OnesA yourself. OnesA should have the minimal number of bits necessary.
-(5 points) OVFL a single bit output which is 1 when an arithmetic operation resulted in the overflow, 0 otherwise
You may introduce additional inputs and/or outputs, as necessary.
(a) You are allowed to use any gates and components that we reviewed in class. It is also OK to use any components that appeared in our course textbook/zyBooks.
(b) You may define your own components and then use them.
(c) You must assume signed values for all arithmetic operations and comparison (Eq).
(d) The mode of operation of the ALU should be determined by the Operation control bus (several wires of the form \( O p_{n} O p_{n-1}\ldots O p_{0}\) that together define the mode). You need to use the minimal number of wires in the Operation bus. Also, you are not allowed to have any other separate control signals, like Ainvert, Binvert, etc. If you need any such control signals, they have to be produced inside your ALU from \( O p_{n} O p_{n-1}\ldots O p_{0}\). Make sure you provide a table (legend) that shows how modes correspond to Operation bits.
Draw the circuit diagram of your ALU below. Make sure that you circuit is well organized,
drawn neatly, all connections are straight lines that go either vertically, horizontally, or at a
45deg angle, and that all signals and components are clearly labeled. You will lose points if
your drawing is sloppy or hard to read.
I NEED the extra credit parts! Make sure to go into as much detail as possible and explain every part.
5 . ( 2 0 POINTS ) Design a 5 - bit ALU that

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!