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
p_label : process is
begin
while i <= 3 loop
Xn := 4.0 * Xn * (1.0 - Xn) ;
y := floor (100.0 * Xn);
m <= integer (y);
n := m mod 256;
result <= std_logic_vector (to_unsigned(n,8));
i := i + 1;
wait for rising_edge(clk);
end loop;
wait;
end process;
In here, "q" is a clock signal having 0.75 Hz frequency. And I want to display "result" in 8 bits through leds (0-7) in FPGA board. So loop will iterate 3 times, each iteration I should observe 64,92 and 29 respectively. Now, the clock frequency is 0.75 Hz, I need to observe the numbers. However, I observed only the final value as 29 without observing 64 and 92. So in which part of the codes I missed?
Please help. Thanks.
variable a : integer := 0;
signal b : integer := 0;
process(clk)
begin
if rising_edge(clk) then
for i in 1 to 10 loop
a := a + 1;
b <= b + 1;
end loop;
output1 <= a;
output2 <= b;
end if;
end process;
Hi dear friends,
I have a problem about my codes, but I am not sure whether the problem is about while loop or not. Therefore I need someone help. My code in VHDL is as below :
if rising_edge(q) then
while i <= 3 loop
Xn := 4.0 * Xn * (1.0 - Xn) ;
y := floor (100.0 * Xn);
m <= integer;
n := m mod 256;
result <= std_logic_vector (to_unsigned(n,8));
i := i + 1;
end loop;
end if;
In here, "q" is a clock signal having 0.75 Hz frequency. And I want to display "result" in 8 bits through leds (0-7) in FPGA board. So loop will iterate 3 times, each iteration I should observe 64,92 and 29 respectively. Now, the clock frequency is 0.75 Hz, I need to observe the numbers. However, I observed only the final value as 29 without observing 64 and 92. So in which part of the codes I missed?
Please help. Thanks.
process
begin
wait until rising_edge(q);
for i in 1 to 3 loop
a <= i;
wait for 0 ns;
end loop;
wait; -- Wait forever...this is an example after all
end process;
process
begin
wait until rising_edge(q);
...The rest of your code
end process;
-- assume y =0 at the start of the process
x:= 0;
y <= 100;
while x < 4 loop
y <= y + 1;
x := x + 1;
end loop;
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?