+ Post New Thread
Results 1 to 10 of 10
  1. #1
    Full Member level 4
    Points: 3,014, Level: 12

    Join Date
    Apr 2002
    Posts
    236
    Helped
    1 / 1
    Points
    3,014
    Level
    12

    verilog one shot

    Hi,

    I don't know how to write verilog code to generate a single pulse?

    Anyone can help?

    •   Alt26th January 2004, 04:44

      advertising

        
       

  2. #2
    Full Member level 4
    Points: 3,315, Level: 13
    Al Farouk's Avatar
    Join Date
    Jan 2003
    Location
    Egypt
    Posts
    190
    Helped
    16 / 16
    Points
    3,315
    Level
    13

    verilog pulse

    this code i had writen to act as a digital mono stable but it it VHDL coding, I hope it may help



  3. #3
    Full Member level 4
    Points: 3,433, Level: 13

    Join Date
    Dec 2002
    Location
    Inside your MOM!
    Posts
    234
    Helped
    3 / 3
    Points
    3,433
    Level
    13

    one shot verilog

    I'm not sure what your asking.. but theres this..

    thing is a high going transition which creates a oneshot pulsy at the same time..


    reg thing_dly;

    wire pulsy;
    assign pulsy = thing & ~thing_dly;

    always @(posedge clk or posedge rst)
    if(rst)
    thing_dly <= 1'b0;
    else
    thing_dly <= thing;


    If your looking for a quick pulse (say to clear a reg/combinatorial) then your coding the problem incorrectly.. never use gate delays.. there is always ways around it.. just hard to figure out..

    jelydonut



  4. #4
    Junior Member level 1
    Points: 1,976, Level: 10

    Join Date
    Jul 2002
    Location
    China
    Posts
    18
    Helped
    1 / 1
    Points
    1,976
    Level
    10

    verilog create pulse

    I think this is what you want....
    // Verilog code
    module test001(clk, pulse, clkout);

    input clk;
    input pulse;
    output clkout;

    reg cnt, temp;
    initial begin cnt = 0;
    temp = 0;
    end

    always @(posedge clk)
    if(pulse && !cnt) begin
    cnt <= ~cnt;
    temp <= 1;
    end
    else if(!pulse) begin
    cnt <= 0;
    end
    else
    temp <= 0;


    assign clkout = temp|clk;

    endmodule
    WooOOOOOOOood


    1 members found this post helpful.

    •   Alt1st February 2004, 06:36

      advertising

        
       

  5. #5
    Full Member level 1
    Points: 1,906, Level: 10

    Join Date
    Apr 2005
    Posts
    116
    Helped
    5 / 5
    Points
    1,906
    Level
    10

    verilog pulse

    I think that generating a signal pulse must require a trigger signal.

    best reagrds




    Quote Originally Posted by dd2001
    Hi,

    I don't know how to write verilog code to generate a single pulse?

    Anyone can help?



  6. #6
    Newbie level 5
    Points: 1,417, Level: 8

    Join Date
    Jun 2005
    Posts
    9
    Helped
    2 / 2
    Points
    1,417
    Level
    8

    verilog generate pulse

    I think it's no way to create a pulse in degital ckt,
    (use a faster clock is not a pulse)
    I think you need a hard-macro
    (Delay cell, use spice to calculate the delay to meet your pulse width)
    then in verilog:
    wire pulse,pulsed,pulse_want;
    dly(.out(pulsed), .in(pulse));
    assign pulse_want = pulse& ~pulsed;


    1 members found this post helpful.

  7. #7
    Full Member level 1
    Points: 1,835, Level: 9

    Join Date
    Jul 2004
    Posts
    104
    Helped
    2 / 2
    Points
    1,835
    Level
    9

    create a pulse in verilog

    Ust two filp-flop to implement it.


    1 members found this post helpful.

  8. #8
    Full Member level 1
    Points: 2,220, Level: 10

    Join Date
    Apr 2005
    Location
    Milky Way
    Posts
    108
    Helped
    13 / 13
    Points
    2,220
    Level
    10

    one pulse code in verilog

    Your problem is not very clear. If you are having a clock signal and an enable signal which when arrives you must give out exactly one pulse, then, you can use two flips flops clocked by the same clock.
    O/p of the first flip flop goes as input to the second and the output of the second goes as I/p clear to the first, take o/p from the o/p of the first flip flop, this will be a single cycle pulse.
    Your enable can be any cycle width. Nest pulse will be generated only when enable comes for the second time. Tell me if it is clear ???



  9. #9
    Full Member level 6
    Points: 2,793, Level: 12

    Join Date
    Jun 2005
    Posts
    373
    Helped
    6 / 6
    Points
    2,793
    Level
    12

    verilog one-shot

    from following attached file, you can find many design practice include

    signle pulse generate.



    best regards




    Quote Originally Posted by dd2001
    Hi,

    I don't know how to write verilog code to generate a single pulse?

    Anyone can help?



  10. #10
    Newbie level 1
    Points: 714, Level: 5

    Join Date
    Dec 2008
    Posts
    1
    Helped
    0 / 0
    Points
    714
    Level
    5

    pulse in verilog

    Thanks!!!! It works fine.


    Quote Originally Posted by jelydonut
    I'm not sure what your asking.. but theres this..

    thing is a high going transition which creates a oneshot pulsy at the same time..


    reg thing_dly;

    wire pulsy;
    assign pulsy = thing & ~thing_dly;

    always @(posedge clk or posedge rst)
    if(rst)
    thing_dly <= 1'b0;
    else
    thing_dly <= thing;


    If your looking for a quick pulse (say to clear a reg/combinatorial) then your coding the problem incorrectly.. never use gate delays.. there is always ways around it.. just hard to figure out..

    jelydonut
    :D:D



+ Post New Thread
Please login