Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
21615 Discussions

one-port Ram om altera

Altera_Forum
Honored Contributor II
1,843 Views

Hey i´m using the "1- port ram" from the megaWizard plugin manager.  

when i change the adress, the output is always the value of the first adress.  

Do i have to do some settings or how can i change this?#  

LIBRARY ieee; USE ieee.std_logic_1164.all; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; -- Entity Declaration ENTITY block_name IS -- {{ALTERA_IO_BEGIN}} DO NOT REMOVE THIS LINE! PORT ( clock : IN STD_LOGIC; // clock resultim : IN STD_LOGIC_VECTOR(23 downto 0); // newinputdata speicher : IN STD_LOGIC_VECTOR(31 downto 0); // data from the actual adress of the ram adresse : buffer STD_LOGIC_VECTOR(11 downto 0); // adress writeenable : OUT STD_LOGIC; // ausgang2 : OUT STD_LOGIC_VECTOR(31 downto 0) // output and input from the ram ); -- {{ALTERA_IO_END}} DO NOT REMOVE THIS LINE! END block_name; -- Architecture Body ARCHITECTURE aufsummiererimaginaerteil_architecture OF block_name IS signal zaehler : natural range 0 to 12; BEGIN writeenable <= '1'; process (clock ) begin If clock = '1' and clock'event then if zaehler = 12 then zaehler <= 0; else zaehler <= zaehler + 1; end if; ausgang2 <= resultim + speicher; If zaehler = 0 then adresse <= "000000000000";end if; If zaehler = 1 then adresse <= adresse + "1000";end if; If zaehler = 2 then adresse <= adresse + "1000";end if; If zaehler = 3 then adresse <= adresse + "1000";end if; If zaehler = 4 then adresse <= adresse + "1000";end if; If zaehler = 5 then adresse <= adresse + "1000";end if; If zaehler = 6 then adresse <= adresse + "1000";end if; If zaehler = 7 then adresse <= adresse + "1000";end if; If zaehler = 8 then adresse <= adresse + "1000";end if; If zaehler = 9 then adresse <= adresse + "1000";end if; If zaehler = 10 then adresse <= adresse + "1000";end if;  

 

If zaehler = 11 then adresse <= adresse + "1000";end if; 

If zaehler = 12 then adresse <= adresse + "1000";end if; 

 

end if; 

end process; 

END aufsummiererimaginaerteil_architecture;
0 Kudos
4 Replies
Altera_Forum
Honored Contributor II
773 Views

There's no RAM instance in your code.

0 Kudos
Altera_Forum
Honored Contributor II
773 Views

ok and how i do a ram instance? ( that was not my ram code only a code to initialize the adresses and the input and so on) kind regards

0 Kudos
Altera_Forum
Honored Contributor II
773 Views

You should show the code that your question is related to.

0 Kudos
Altera_Forum
Honored Contributor II
773 Views

i don´t know the code from the ramblock i´m using the megafunction and it doesn´t work

0 Kudos
Reply