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
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.
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)
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...
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.
Please show complete Verilog code. Write a Verilog description for 3-to-8 decoder generating low outputs when...
Please show complete Verilog code. Write a Verilog description for 3-to-8 decoder generating low outputs when enabled with a low enable.