Question

Using Verilog, display two words on the Seven Segment Display. For example, if a switch is...

Using Verilog, display two words on the Seven Segment Display. For example, if a switch is in the 0 position, it might display the word "happy." If the switch is 1, it should display a different word, like hats.

This is the expected output

Switch OFF: happy

Switch ON: hats

0 0
Add a comment Improve this question Transcribed image text
Answer #1

module display (switch , sseg5, sseg4, sseg3, sseg2, sseg1);

input switch;

output reg [6:0] sseg5, sseg4, sseg3, sseg2, sseg1;

parameter h = 7'b1110100;
parameter A = 7'b1110111;
parameter P = 7'b1110011;
parameter Y = 7'b1100110;
parameter t = 7'b1111000;
parameter S = 7'b1101101;
parameter blank = 7'b0000000;

always @(switch)

begin

   if (~switch) begin
       sseg5 = h;
       sseg4 = A;
       sseg3 = P;
       sseg2 = P;
       sseg1 = Y; end
   else begin
       sseg5 = h;
       sseg4 = A;
       sseg3 = t;
       sseg2 = S;
       sseg1 = blank; end
end

endmodule

/////////////////////////////////////////////////////////////////////

Wave File Edit View Add Format Tools Bookmarks Window Help Wave -Default 3-4- -4 Search: Meor displayiswitch Sto 1110100 1110

Add a comment
Know the answer?
Add Answer to:
Using Verilog, display two words on the Seven Segment Display. For example, if a switch is...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT