[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [f-cpu] What's wrong here?
On Tue, Jul 30, 2002 at 07:01:10PM +0200, Just an Illusion wrote:
> Hello,
>
> The variable H and L can't be used to calculate the size of B, more they
> are unnecessary.
>
> When you call the function inv_word with a vector, the A'HIGH and the
> A'LOW aren't referred to the real size of the vecteur, but the part
> connected.
>
> The good version is more like :
>
> function inv_word (A : in std_ulogic_vector) return std_ulogic_vector is
> variable B : std_ulogic_vector ( A'HIGH downto 0);
> begin
> for i in 0 to B'HIGH loop
> B(i)=A(A'HIGH-i);
> end loop;
> end inv_word;
>
> or
>
> function inv_word (A : in std_ulogic_vector) return std_ulogic_vector is
> variable B : std_ulogic_vector ( A'LENGHT-1 downto 0);
> begin
> for i in 0 to B'LENGHT-1 loop
> B(i)=A(A'LENGHT-1-i);
> end loop;
> end inv_word;
>
> Or any combinaison of both.
>
My problem is :
Input vector maybe 0 to length-1, but low index can be not null. And i
want a output vector with same range as input.
And i don't see what's wrong, it's works fine with simili. Is it luke ?
Etienne.
*************************************************************
To unsubscribe, send an e-mail to majordomo@seul.org with
unsubscribe f-cpu in the body. http://f-cpu.seul.org/