pn sequence

Discussion in 'VHDL' started by J.Ram, Sep 12, 2006.

  1. J.Ram

    J.Ram Guest

    Hi all,
    my objective is to get outpn value when rising_edge of clk and low
    reset.
    when i written code , and in simulation result outpn value is comes
    after one clk
    cycle after reset goes to low, but my need is to get outpn at the
    moment reset goes low.
    here is my code.
    entity pn is
    port(
    clk,reset : in std_logic;
    outpn : std_logic);
    end pn;
    architecture test of pn is
    type data is array(1 to 6) of std_logic;
    signal buff : data;
    begin
    process(clk,reset)
    variable input : std_logic;
    begin
    if reset = '1' then
    outpn <= 'X';
    elsif clk'event and clk ='1' then
    input := buff(1) xor buff(6);
    buff(1) <= input;
    buff(2) <= buff(1);
    buff(3) <= buff(2);
    buff(4) <= buff(3);
    buff(5) <= buff(4);
    buff(6) <= buff(5);
    end if;
    outpn <= buff(6);]
    end process;
    end test;
     
    J.Ram, Sep 12, 2006
    #1
    1. Advertisements

  2. J.Ram

    uvbaz Guest

    J.Ram schrieb:

    > Hi all,
    > my objective is to get outpn value when rising_edge of clk and low
    > reset.
    > when i written code , and in simulation result outpn value is comes
    > after one clk
    > cycle after reset goes to low, but my need is to get outpn at the
    > moment reset goes low.
    > here is my code.
    > entity pn is
    > port(
    > clk,reset : in std_logic;
    > outpn : std_logic);
    > end pn;
    > architecture test of pn is
    > type data is array(1 to 6) of std_logic;
    > signal buff : data;
    > begin
    > process(clk,reset)
    > variable input : std_logic;
    > begin
    > if reset = '1' then
    > outpn <= 'X';
    > elsif clk'event and clk ='1' then
    > input := buff(1) xor buff(6);
    > buff(1) <= input;
    > buff(2) <= buff(1);
    > buff(3) <= buff(2);
    > buff(4) <= buff(3);
    > buff(5) <= buff(4);
    > buff(6) <= buff(5);
    > end if;
    > outpn <= buff(6);]
    > end process;
    > end test;


    is this what do you want:

    library ieee;
    use ieee.std_logic_1164.all;

    entity pn is
    port
    (
    clk: in std_logic;
    reset: in std_logic;
    outpn: out std_logic
    );
    end pn;

    architecture test of pn is
    type data is array(1 to 6) of std_logic;
    signal buff : data;
    begin
    process(clk, reset)
    variable input : std_logic;
    begin
    if reset = '1' then
    outpn <= '0';
    elsif( (clk'event and clk ='1') or (reset'event and reset = '0') )
    then
    input := buff(1) xor buff(6);
    buff(1) <= input;
    buff(2) <= buff(1);
    buff(3) <= buff(2);
    buff(4) <= buff(3);
    buff(5) <= buff(4);
    buff(6) <= buff(5);
    outpn <= buff(6);
    end if;
    end process;
    end test;
     
    uvbaz, Sep 12, 2006
    #2
    1. Advertisements

  3. uvbaz schrieb:
    > elsif( (clk'event and clk ='1') or (reset'event and reset = '0') )


    You need a very good synthesis tool to synthesis the code in the
    desired way. (and a technology allowing logic in the clock path). You
    will further have big trouble with timig analysis of this construct.

    I guess[1] the real code should be

    signal PNcount : std_ulogic_vector(5 downto 0);
    process (clk, Rst)
    if reset_active then
    PNcount<= Seed;
    elsif rising_edge(Clk) then
    PNcount <= PNcount(4 downto 0) & (PNcount(5) XOR PNCount(0);
    end if;
    end process
    Outpn<=PNcount(5);

    bye Thomas

    [1] The OP was a bit confuse for me about what he really wanted
     
    Thomas Stanka, Sep 12, 2006
    #3
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. lezah
    Replies:
    0
    Views:
    661
    lezah
    Feb 4, 2004
  2. Paul Porcelli
    Replies:
    1
    Views:
    567
    Chris Charley
    Jul 14, 2004
  3. Paul Porcelli
    Replies:
    3
    Views:
    660
    Eric Amick
    Jul 16, 2004
  4. h babu
    Replies:
    1
    Views:
    540
    Vidar Petursson
    Jul 16, 2003
  5. Steven David

    Return sequence number from Oracle

    Steven David, Aug 18, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    14,537
    David Browne
    Aug 19, 2003
  6. marcia

    escape sequence \n

    marcia, Aug 28, 2003, in forum: ASP .Net
    Replies:
    4
    Views:
    663
    marcia
    Aug 28, 2003
  7. Steven Cheng[MSFT]

    RE: Tab Sequence in Web Forms

    Steven Cheng[MSFT], Jan 21, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    774
    =?Utf-8?B?Q2FybG8gTWFyY2hlc29uaQ==?=
    Jan 23, 2004
  8. stef mientki
    Replies:
    13
    Views:
    973
    stef mientki
    Oct 20, 2007
Loading...