Question: SHOW ALL 3 STEPS! Write a 4 bit ripple adder that uses instances of this fulladder FA shown below, A and B are inputs, Cin

SHOW ALL 3 STEPS!
Write a 4 bit ripple adder that uses instances of this fulladder FA shown below, A and B are inputs, Cin is thecarry in, Sum is the output sum, Cout is the carry out, and OF indicates overflow which is determined by the(carryin to the last bit) xor (the carry out)
module FA( input A, B, Cin, output C, Cout );
assign C =(A^B)^Cin;
assign Cout = A&B | A&Cin | B&Cin;
endmodule
// this is you 4 bit ripple adder, fill in your code using instances of FA
module FA4(input [3:0] A, B, input Cin, output [3:0] Sum, output Cout, OF );
Then, Write a 4:1 multiplexer module with 4 bit inputs A, B, C, D, a select S, and 4 bit output F.
And finally, Use an instance of this multiplexer and the ripple adder to make a 4 bit ALU module. The ALU should do additionusing the ripple adder you wrote, subtraction using a 2s compliment and the ripple adder you wrote, multiplyusing *, and divide using /. This will require multiple instances of the ripple adder you wote.
ALU inputs should be 4-bit A, B,2-bit opcode, and output should be 4-bit result. Cout and OF will be local andnot outputs of the ALU. The select bits of the multiplexer should be opcodes for each, so 2b00 should be add,2b01 should be subtract, 2b10 should be multiply, and 2b11 should be divide.

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 Databases Questions!