Re: async fifo design



Hi,

1) A gray-to-binary code that I picked up on the web years ago is

------------------------------------------------------------
function f_gray_to_bin(vval : std_logic_vector) return std_logic_vector is
variable i : integer;
variable v_accumulate : std_logic_vector(vval'left downto vval'right);
variable v_par1 : std_logic_vector(vval'length - 1 downto 0);


begin
v_par1 := vval;
v_accumulate(v_par1'left) := v_par1(v_par1'left);
for i in v_par1'left -1 downto 0 loop
v_accumulate(i) := v_par1(i) xor v_accumulate(i + 1);
end loop;
return v_accumulate;
end f_gray_to_bin;
------------------------------------------------------------
I can't find the document I derived it from on my laptop, I still should have it on a CD somewhere. If I get a chance to look I'll send it to you.



2) Seems a difficult one at first glance.
Would it be feasable
a) just to store the base addresses on the FIFO (since the packet or whatever always seems to be 18 bytes)


b) use semaphores to indicate whether memory blocks are empty/valid/read
.



Relevant Pages

  • Re: Possible to generate individual cases within a case statement?
    ... variable width - it gets set by two generic parameters. ... -- Function to calculate highest-1s bit position ... for i in b'reverse_range loop ... return B(1 downto 1); ...
    (comp.lang.vhdl)
  • Re: Dividing by 48
    ... dividend: in unsigned(bits-1 downto 0); ... remainder: out unsigned; ... for i in 1 to bits-1 loop ...
    (comp.lang.vhdl)
  • Re: Current coding standard documentation
    ... elimination of 'DOWNTO' ... So, if iStart is> iEnd, does i implicitly decrement from iStart to ... or is the loop a null-op since i already exceeds iEnd? ... by the need for the additional mandatory clause. ...
    (borland.public.delphi.non-technical)
  • Re: Complex Multiply
    ... variable complex_16: complex(15 downto 0); ... it's easy enough to write a package that does the job. ... for i in c'range loop ... DOULOS - Developing Design Know-how ...
    (comp.lang.vhdl)
  • Re: loop with an optional limit?
    ... You can let loop do the increment for you. ... I was not aware that to or downto was optional. ... eof could be present in the file. ...
    (comp.lang.lisp)