Question
Verilog! NOT VHDL Please
(4 pts) Write a behavioral Verilog module to implement a counter that counts in the following sequence: 000, 010, 100, 110, 0
0 0
Add a comment Improve this question Transcribed image text
Answer #1


module counter (clock, reset, Q);

input clock, reset;

output [2:0] Q;

reg [2:0] ROM [7:0];

reg [2:0] address;

initial begin

ROM[3'b000] = 000;
ROM[3'b001] = 010;
ROM[3'b010] = 100;
ROM[3'b011] = 110;
ROM[3'b100] = 001;
ROM[3'b101] = 011;
ROM[3'b110] = 101;
ROM[3'b111] = 111;

end

always @ (posedge clock or reset)

begin

   if (reset)

       address <= 3'b000;
   else

       address <= address + 1'b1;
  
end

assign Q = ROM[address];

endmodule

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

E Wave File Edit View Add Format Tools Bookmarks Window Help Wave -Default 。.he tat t ,票44. 43-4 t e x 9 t←짜 R7 00 p.劃ELE Sk

Add a comment
Know the answer?
Add Answer to:
(4 pts) Write a behavioral Verilog module to implement a counter that counts in the following seq...
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