elektrom
Full Member level 2
gray2bin
I'm designing async fifo 512x32 on virtex II and found that the criticial path is in gray2bin converter. Below is gray2bin function that i used, Do you know any faster logic?
function GRAY2BIN( GRAYSLV : std_logic_vector ) return std_logic_vector is
variable BINSLV : std_logic_vector(GRAYSLV'range);
begin
for I in GRAYSLV'range loop
if I = GRAYSLV'left then
BINSLV(I) := GRAYSLV(I);
else BINSLV(I) := GRAYSLV(I) xor BINSLV(I+1);
end if;
end loop;
return BINSLV;
end function GRAY2BIN;
I'm designing async fifo 512x32 on virtex II and found that the criticial path is in gray2bin converter. Below is gray2bin function that i used, Do you know any faster logic?
function GRAY2BIN( GRAYSLV : std_logic_vector ) return std_logic_vector is
variable BINSLV : std_logic_vector(GRAYSLV'range);
begin
for I in GRAYSLV'range loop
if I = GRAYSLV'left then
BINSLV(I) := GRAYSLV(I);
else BINSLV(I) := GRAYSLV(I) xor BINSLV(I+1);
end if;
end loop;
return BINSLV;
end function GRAY2BIN;