Flo89
Newbie level 4
- Joined
- Feb 16, 2014
- Messages
- 5
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 44
Dear expers,
I'm new to VHDL and would need advice for a loop. Would it be possible to use a signal instead of the variable z in the following code?
Will it be a problem to use z in a way like in the code because of the read and then write access. I've heard about possible oscillation or things like that.
Here's the code (Of course not functional and only a cutout)
Thanks a lot!!
Best regards,
Florian
I'm new to VHDL and would need advice for a loop. Would it be possible to use a signal instead of the variable z in the following code?
Will it be a problem to use z in a way like in the code because of the read and then write access. I've heard about possible oscillation or things like that.
Here's the code (Of course not functional and only a cutout)
Code VHDL - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 cordic: process(clk) variable di: std_logic; variable z : std_logic_vector (PA_RES DOWNTO 0) := (others => '0'); variable sin_temp, cos_temp : sfixed (1 downto -14); begin if(rising_edge(clk) and (enable_cordic='1')) then z := phase; sin_temp := sin_init; cos_temp := cos_init; FOR i in 0 to 12 LOOP if (z(PA_RES)='1') then z := std_logic_vector(signed(z) + signed(my_Rom(i))); else z := std_logic_vector(signed(z) - signed(my_Rom(i))); end if; END LOOP; end if; end process cordic;
Thanks a lot!!
Best regards,
Florian