Question

Can anyone solve this? i dont understand? verilog

1. (30 pts) Design a mod-6 counter. A mod-6 counter updates its output per clock rising edge according to the following seque

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

//design

module mod6 (clock, resetn, en, z);

input clock, resetn, en;

output [2:0] z;

reg [2:0] count;

always @ (posedge clock, resetn)

begin

   if (~resetn)

       count <= 3'b000;

   else

        if (en)

           count <= count + 1;

end

assign z = count;

endmodule

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

//Testbench

module tb_mod6 ();

reg clock, resetn, en;

wire [2:0] z;

mod6 uut (clock, resetn, en, z);

always #10 clock = ~clock;

initial

begin

   clock = 0;

   resetn = 0;

   en = 1;

   #20;

   resetn = 1;

   en = 0;

   #40;

   en = 1;

end

endmodule

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

//Simulation

E Wave File Edit View Add Format Tools Bookmarks Window Help Wave -Default Msgs /tb_mod6jdock /tb modé/en 400 450 Oursor 1 45

Add a comment
Know the answer?
Add Answer to:
Can anyone solve this? i dont understand? verilog 1. (30 pts) Design a mod-6 counter. A...
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