Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Electronic Equipment > VHDL > Re: Round-robin...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 4 Topic 6130 of 6417
Post > Topic >>

Re: Round-robin priority encoder

by Jonathan Bromley <jonathan.bromley@[EMAIL PROTECTED] > Jul 3, 2008 at 11:41 AM

On Thu, 3 Jul 2008 01:56:44 -0700 (PDT), Pasacco wrote:

>Dear
>
>I am having problem to implement "circular round-robin" priority
>encoder.
>
>My goal is to implement using "generic" number of ****ts.
>I tried to use two "for" loops.
>Problem was that the index is not always increasing.

It's probably best to normalise the index range internally
to your design.  This really stupid little example should
show what I mean:

  entity multi_bit_inverter is
    ****t (A: in std_logic_vector;
          Y: out std_logic_vector);
  end;

  architecture RTL of multi_bit_inverter is
  begin

    -- Ex****t the blame if someone connected
    -- inappropriate signals to this entity
    assert A'length = Y'length
      re****t "Instantiated ****t widths do not match"
      severity FAILURE;

    process (A) 
      variable normalised_A: std_logic_vector(A'length-1 downto 0);
      variable normalised_Y: std_logic_vector(A'length-1 downto 0);
    begin
      normalised_A := A;  -- this fixes any index direction problems.
      -- Do the real work on your normalised versions:
      for i in normalised_A'range loop
        -- No problem with subscript directions now.
        normalised_Y(i) := not normalised_A(i);
      end loop;
      -- Patch-up the array direction again to match the o/p ****t:
      Y <= normalised_Y;  -- again, fix-up index direction trouble.
    end process;

  end;

hth
-- 
Jonathan Bromley, Consultant

DOULOS - Developing Design Know-how
VHDL * Verilog * SystemC * e * Perl * Tcl/Tk * Project Services

Doulos Ltd., 22 Market Place, Ringwood, BH24 1AW, UK
jonathan.bromley@[EMAIL PROTECTED]
 contents of this message may contain personal views which 
are not the views of Doulos Ltd., unless specifically stated.
 




 4 Posts in Topic:
Round-robin priority encoder
Pasacco <pasacco@[EMAI  2008-07-03 01:56:44 
Re: Round-robin priority encoder
Jonathan Bromley <jona  2008-07-03 11:41:10 
Re: Round-robin priority encoder
Pasacco <pasacco@[EMAI  2008-07-06 16:35:56 
Re: Round-robin priority encoder
Mike Treseler <mike_tr  2008-07-06 17:58:08 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Dec 1 11:06:28 CST 2008.