hitx
Member level 2
- Joined
- Mar 16, 2007
- Messages
- 49
- Helped
- 1
- Reputation
- 2
- Reaction score
- 1
- Trophy points
- 1,288
- Activity points
- 1,723
Hi dear friends,
I have a code in VHDL. Please take a look this code below.
process (clk,i)
variable xn,y : real;
begin
xn := 0.2;
if rising_edge (clk) then
i <= i + 1;
if i < 8 then
xn := 4.0 * xn * (1.0 - xn);
y := floor (100.0 * xn);
m <= (integer ) mod 256;
mem(i) <= std_logic_vector(to_unsigned(m,8));
end if;
end if;
end process;
Now, in every clk, the initial value always xn = 0.2 Is not it? But I just want it in first clk only. And I need to use variable. How can I pass that situation?
Please help..
Thanks.
I have a code in VHDL. Please take a look this code below.
process (clk,i)
variable xn,y : real;
begin
xn := 0.2;
if rising_edge (clk) then
i <= i + 1;
if i < 8 then
xn := 4.0 * xn * (1.0 - xn);
y := floor (100.0 * xn);
m <= (integer ) mod 256;
mem(i) <= std_logic_vector(to_unsigned(m,8));
end if;
end if;
end process;
Now, in every clk, the initial value always xn = 0.2 Is not it? But I just want it in first clk only. And I need to use variable. How can I pass that situation?
Please help..
Thanks.