Question

Write a behavioral Verilog module for a 4-bit Johnson counter that has 8 states. The counter loads the 0000 state if reset

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

Reha Viduyal Cade out , out i (neset) of d;

snd snd modzls test bench - 4b reg clik begin au4bo000 fork s C end

module mealy_verilog_code(out, in, rst, clk);
output out;
input in;
input clk, rst;
reg out;
reg[1:0] state;
parameters0=2'd0, s1=2'd1, s2=2'd2, s3=2'd3;
always @(posedge clk or negedge rst)
if(rst==0) begin state=s0; out=0; end
else begin
case (state)
s0: if(in==0) begin out=0; state=s1; end
else begin out=0; state=s0; end
s1: if(in==0) beginout=0; state=s1; end
else begin out=0; state=s2; end
s2: if(in==0) begin out=0; state=s3; end
else begin out=0; state=s0; end
s3: if(in==0) begin out=0; state=s1; end
else begin out=1; state=s2; end
default: state=s0;
endcase
end
endmodule

3-bit melay Ce».in. reid,nu ) moduし begin 孔Int End snd modulo

Add a comment
Know the answer?
Add Answer to:
Write a behavioral Verilog module for a 4-bit Johnson counter that has 8 states. The counter load...
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
  • (4 pts) Write a behavioral Verilog module to implement a counter that counts in the following seq...

    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, 001, 011, 101, 111, (repeat) 000, etc. Use a ROM and D flip-flops. Create a test bench for your counter design and run functional simulation in ModelSim. (4 pts) Write a behavioral Verilog module to implement a counter that counts in the following sequence: 000, 010, 100, 110, 001, 011, 101, 111, (repeat) 000, etc....

  • write a module in verilog that takes in a 1 hz clock and outputs a counter...

    write a module in verilog that takes in a 1 hz clock and outputs a counter for hours seconds and minutes on a digital clock. I was thinking of making two bits for hours minutes and seconds. when the first bit gets to 9, then it resets to 0 and the second bit, or most significant bit becomes 1. please do not paste the code online.....put it in a file I can simply test. privacy is important here

  • please give the verilog code and explain in the form of comments. Part I Consider the...

    please give the verilog code and explain in the form of comments. Part I Consider the circuit in Figure 1. It is a 4-bit synchronous counter (text Section 5.9.2) that uses four T-type flip- flops (text Section 5.5). The counter increments its value on each positive edge of the clock if the Enable signal is asserted. The counter is reset to 0 by setting the Clear b signal low - it is an active-low asynchronous clear. You are to implement...

  • Use a behavioral Verilog model to design a 3-bit fault tolerant up-down counter. For each flip-fl...

    Use a behavioral Verilog model to design a 3-bit fault tolerant up-down counter. For each flip-flop (FF) include asynchronous reset and preset signals. Refer to Example 4.3 on page 160 for an example of a single FF with both reset and preset signals as well as with an enable signal. For this project, you don't need to use FFs with enables. You don't also need not-q (nq) in this assignment. Use active-high signals for reset and present signals. The example...

  • Only need the verilog module and tb please 4. (20 points) Design a binary sequence detector that detects the sequence 0...

    Only need the verilog module and tb please 4. (20 points) Design a binary sequence detector that detects the sequence 000. Overlap is allowed. You may use either D flip- flops or JK flip-flops. Write a Verilog program to verify your design. 4. (20 points) Design a binary sequence detector that detects the sequence 000. Overlap is allowed. You may use either D flip- flops or JK flip-flops. Write a Verilog program to verify your design.

  • Consider the circuit in Figure 1. It is a 4-bit (QQ2Q3) synchronous counter which uses four T-typ...

    Consider the circuit in Figure 1. It is a 4-bit (QQ2Q3) synchronous counter which uses four T-type flip-flops. The counter increases its value on each positive edge of the clock if the Enable signal is asserted. The counter is reset to 0 by setting the Clear signal low. You are to implement an 8-bit counter of this type Enable T Q Clock Clear Figure 1. 4-bit synchronous counter (but you need to implement 8-bit counter in this lab) Specific notes:...

  • I need the verilog module and testbench for this Thanks Design a binary sequence detector that detects 4 consecutive 1&#...

    I need the verilog module and testbench for this Thanks Design a binary sequence detector that detects 4 consecutive 1's; overlap is allowed. You should have 5 states and thus you need 3 flip-flops. For simplicity, you can assign the states to be 000, 001, 010, 011, 100.

  • Problem 1. a) Write a behavioral model of J-K flip-flop with active-low asynchronous reset. b) Write...

    Problem 1. a) Write a behavioral model of J-K flip-flop with active-low asynchronous reset. b) Write a proper test-bench and stimulus, thoroughly test your J-K-FlipFlop. Also, show your waveform and describe why your JK-FF does what is is designed to do. Problem 2. a) Write a Verilog module that will assert its output if a 4-bit input binary word is even. b) Show the waveform for two input patterns “1100” and “0101”

  • Problem 1. a) Write a behavioral model of J-K flip-flop with active-low asynchronous reset. b) Write...

    Problem 1. a) Write a behavioral model of J-K flip-flop with active-low asynchronous reset. b) Write a proper test-bench and stimulus, thoroughly test your J-K-FlipFlop. Also, show your waveform and describe why your JK-FF does what is is designed to do. Problem 2. a) Write a Verilog module that will assert its output if a 4-bit input binary word is even. b) Show the waveform for two input patterns “1100” and “0101”

  • Objective: In this lab, we will learn how we can design sequential circuits using behavioral mode...

    Just need the code for the random counter,Thanks Objective: In this lab, we will learn how we can design sequential circuits using behavioral modelling, and implementing the design in FPGA. Problem: Design a random counter with the following counting sequence: Counting Sequence: 04 2 9 168573 Design Description: The counter has one clock (Clock), one reset (Reset), and one move left or right control signal (L/R) as input. The counter also has one 4bit output O and one 2bit output...

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