Forum Discussion
Altera_Forum
Honored Contributor
8 years ago --- Quote Start --- Initially, you may do better using the mega wizard to generate the ram, then you know for sure that a ram will be used. Infered ram has to match the correct behavioural template to be correctly inferred, otherwise logic will be inferred. Review this document for coding styles: https://people.ece.cornell.edu/land/courses/ece5760/de1_soc/hdl_style_qts_qii51007.pdf --- Quote End --- Dear Admin, I have created a memory ( but without wizard) and read it as follows PROCESS (clock) variable i:integer range -1 to 31:=-1; BEGIN IF rising_edge(clock) THEN i:=i+1; q1 <= ram1(i); -- output ( ram is mif file of 32 element, each of 3 bits) END IF; END PROCESS; ram1 is external file that I successfully read its data , each element read in one clock cycle. However , I am trying to get the first three elements after they read to apply a mathematical equation to them in next clock cycle. when I tried to create registers to carry the values , I unintentionally read three element at the same time so the memory transferred to logic elements. My question is , How can I store only three elements and add them and then I get another three to add while keep reading? I tried to postponed in this way but am not sure if its true BEGIN IF rising_edge(clock) THEN i:=i+1; reg1 <= ram1(i); reg2<=reg1; reg3<=reg2; q1<=reg3;