sunli567
Junior Member level 1
Hi friends,
I write the below codes to execute Z= X1*Y1+X2*Y2+...+X5*Y5
X and Y are both assigned as the array type and I set their each element.
But it always give the error that inputs X1 to X4 and Y1 to Y4 are not used.
process (X, Y)
begin
for i in 0 to 5 loop
r <= r + X(i)*Y(i);
end loop;
Z <= r;
end process;
I think there are some problems with i, but i do not know how to solve it.
And the other problem: I write below kind of code in the testbrench.
X0 <= 3, 7 after 10ns, 1 after 12ns;
but it give the following warning:
(vcom-1207) An abstract literal and an identifier must have a separator between them.
Please help me to solve these problems.
Thanks!
Sunny
I write the below codes to execute Z= X1*Y1+X2*Y2+...+X5*Y5
X and Y are both assigned as the array type and I set their each element.
But it always give the error that inputs X1 to X4 and Y1 to Y4 are not used.
process (X, Y)
begin
for i in 0 to 5 loop
r <= r + X(i)*Y(i);
end loop;
Z <= r;
end process;
I think there are some problems with i, but i do not know how to solve it.
And the other problem: I write below kind of code in the testbrench.
X0 <= 3, 7 after 10ns, 1 after 12ns;
but it give the following warning:
(vcom-1207) An abstract literal and an identifier must have a separator between them.
Please help me to solve these problems.
Thanks!
Sunny