Question

write verilog code to generate a clock signal clk with 10 ns period

write verilog code to generate a clock signal clk with 10 ns period

Homework Answers

Answer #1

Time period of clock is 10ns. Half period of clock is 10ns/2=5ns,

we know that generally clk signal has two states, High and low, So provide 5ns delay to each state.

The verilog code is given below

module clk_10ns(clk);
output clk;
reg clk;
initial
    begin
      clk=0;//initialize the clk signal
      while(1)///infinite loop
        begin
          clk=(~clk);//toggle the previous state(i.e 0 to 1 or 1 to 0)
          #5; //5ns delay
        end
    end
endmodule

(If you have any query leave a comment, Thank you)

Know the answer?
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
Similar Questions
write an always block that takes the clk_i (100MHz) and generate a clock clk_50k signal that...
write an always block that takes the clk_i (100MHz) and generate a clock clk_50k signal that has a frequency of 50 kHz. (note: 50kHz signal switches 100,000 times a second.) in verilog.
Verilog code for Alarm clock. Develop a block diagram, Verilog codes with testbench, and the waveforms...
Verilog code for Alarm clock. Develop a block diagram, Verilog codes with testbench, and the waveforms screen-prints.
Write down the VERILOG code for an AND gate and the testbench code to test it
Write down the VERILOG code for an AND gate and the testbench code to test it
Write verilog code for Huffman Decoder with testbench.
Write verilog code for Huffman Decoder with testbench.
How do I design a divide by 4 clock in verilog using 2 D Flip Flop...
How do I design a divide by 4 clock in verilog using 2 D Flip Flop blocks? I have created this divide by 2 clock D Flip Flop block so far: module divide_by_2(D, Clk,reset, Q, Qnext); //Divide by 2 clock with reset using D flip flop    input Clk, D, reset;    output Q,Qnext;    reg Q;       assign Qnext = ~Q;       always @(posedge Clk or posedge reset) //always at the positive edge of the clock or...
Write down the VERILOG code for a tri-state buffer and the testbench code to test it
Write down the VERILOG code for a tri-state buffer and the testbench code to test it
Write down the VERILOG code for a 2-to-4 decoder and the testbench code to test it
Write down the VERILOG code for a 2-to-4 decoder and the testbench code to test it
Write the code for a static Huffman decoder in verilog with testbench.
Write the code for a static Huffman decoder in verilog with testbench.
Plz use Verilog for below question. I will rate. Write a Verilog code for the following...
Plz use Verilog for below question. I will rate. Write a Verilog code for the following expressions: M = X’Y’ + XY + Z’ N = (A ⊕ B) + C (A + D)
Design a verilog code for four-bit subtractor. write the simulation code and constraints file for nexys...
Design a verilog code for four-bit subtractor. write the simulation code and constraints file for nexys 4.
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT