Question: Modify the decoder in task 1 to show the sum of two 4 - bit binary inputs on one of the 7 - segment displays.

Modify the decoder in task 1 to show the sum of two 4-bit binary inputs on one of the 7-segment displays. As only one 7-segment display is used, the circuit will only work correctly for sums that are less than ten.
Write the source code, and also provide a simulation result screenshot that shows the addition of the last two digits of your ID number, or the addition of the last digit of your ID number and the last digit of your partner ID number. The sum should be less than ten.
module labfive(
input [3:0] bin,
output [7:0] an,
output reg [6:0] c
);
assign an=8'b11111110;
always @*
case(bin)
4'b0000:
c =7'b0000001 ;
4'b0001:
c =7'b1001111 ;
4'b0010:
c =7'b0010010 ;
4'b0011:
c =7'b0000110 ;
4'b0100:
c =7'b1001100 ;
4'b0101:
c =7'b0100100 ;
4'b0110:
c =7'b0100000 ;
4'b0111:
c =7'b0001101 ;
4'b1000:
c =7'b0000000 ;
4'b1001:
c =7'b0000100 ;
endcase
endmodule

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!