Re: Handling Asynchronous signals

From: Roderick Bloem (rbloem@yahoo.com)
Date: Mon Oct 08 2001 - 09:29:09 MDT

  • Next message: business1@tangfeng.org: "Beijing Tangfeng Culture Exchange Centre"

    Vanessa,

    Asynchronous signals are a problem. You'll have to
    make the circuit synchronous and take into account
    some imprecision.

    Below is a suggestion, in which reset is only
    accounted for at the next clock tick. Notice that
    this is OK for vis; vis cannot look `between' clock
    ticks.

    module main(clk,in,load,rs,out);
      input in,rs,load,clk;
      output out;

      wire[2:0] in;
      reg[2:0] out;
      reg oldrs;

      always @(posedge clk) begin
        if(rs & ~oldrs) //posedge rs
          out=0;
        else if(load)
          out=in;
        else
          out = out + 1;

        oldrs = rs;
      end
    endmodul

    --- vanessa goyal <vanessa_goyal@rediffmail.com>
    wrote:
    >
    > Sir,
    >
    > For the code below,Vl2mv is showing
    > translation may be imprecise.
    >
    > How should I modify it,so that Vl2mv can accept it?
    >
    > Thanking You
    > Vanessa
    > *************************************
    > module main(clk,in,load,rs,out);
    > input in,rs,load,clk;
    > output out;
    > wire[2:0] in;
    > reg[2:0] out;
    >
    > always @(posedge clk or posedge r )
    > begin
    > if(rs) out=0; else if(load) out=in; else out = out +
    > 1;
    > end
    > endmodule
    >
    >

    __________________________________________________
    Do You Yahoo!?
    NEW from Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
    http://geocities.yahoo.com/ps/info1



    This archive was generated by hypermail 2b30 : Mon Oct 08 2001 - 10:54:59 MDT