3-bit Adder with BCD/Seven Segment Display Decoder Pre-Lab Pact A BCD-to-seven-s
ID: 2313202 • Letter: 3
Question
3-bit Adder with BCD/Seven Segment Display Decoder
Explanation / Answer
ANSWER:
Part - 1:
Let the 4-bit input be denoted as A3A2A1A0. Following will be the truth table.
VERILOG CODE:
`define Z 1'b0
`define O 1'b1
case ({A3,A2,A1,A0}) :
4'h0 : assign {a,b,c,d,e,f,g} = {O,O,O,O,O,O,Z};
4'h1 : assign {a,b,c,d,e,f,g} = {Z,O,O,Z,Z,Z,Z};
4'h2 : assign {a,b,c,d,e,f,g} = {O,O,Z,O,O,Z,O};
...........
4'hf : assign {a,b,c,d,e,f,g} = {Z,Z,Z,Z,Z,Z,Z};
endcase
PART 2:
module 3b_adder (input bit [2:0] A, input bit [2:0] B, output bit [2:0] sum, output bit carry);
assign {carry, sum} = A + B;
endmodule
A3 A2 A1 A0 a b c d e f g 0 0 0 0 1 1 1 1 1 1 0 0 0 0 1 0 1 1 0 0 0 0 0 0 1 0 1 1 0 1 1 0 1 0 0 1 1 1 1 1 1 0 0 1 0 1 0 0 0 1 1 0 0 1 1 0 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 0 1 1 1 1 1 0 1 1 1 1 1 1 0 0 0 0 1 0 0 0 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 0 1 1 1 0 1 0 0 0 0 0 0 0 0 1 0 1 1 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 1 1 0 1 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.