ryoban
Newbie level 4
![Newbie level 4](/styles/images/ranks/blevel1.gif)
HI, I use the FPGA SPARTAN 3
i just want think you for advise. You asked me to give you the vhdl source code that i want to use.here it is:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity leccd1 is
Port ( d : in std_logic_vector(3 downto 0);
s : out std_logic_vector(6 downto 0);
i : in std_logic;
o : out std_logic
);
end leccd1;
architecture Behavioral of leccd1 is
begin
o<='0' when i='1' else '1';
s <="1110111" when d="0000" else
"0010010" when d="0001" else
"1011101" when d="0010" else
"1011011" when d="0011" else
"0111010" when d="0100" else
"1101011" when d="0101" else
"1101111" when d="0110" else
"1010010" when d="0111" else
"1111111" when d="1000" else
"1111011" when d="1001" else
"1111110" when d="1010" else
"0101111" when d="1011" else
"0001101" when d="1100" else
"0011111" when d="1101" else
"1101101" when d="1110" else
"1101100";
end Behavioral;
entity displaycountf is
Port ( clk : in std_logic;
count : out std_logic_vector(3 downto 0));
end displaycountf;
architecture Behavioral of displaycountf is
signal cnt: std_logic_vector(27 downto 0);
begin
process(clk)
begin
if clk'event and clk='0' then
cnt<= cnt + 1 ;
end if;
end process ;
count(3 downto 0)<= cnt(27 downto 24);
end Behavioral;
in fact i want to use four of this counter to count from 0000 to 9999 and these nombers will be displayed the lcd of the spartan 3 starter board. and when there is no light i want the value to be keep in the memory and it will be pisplayed when the light come back and the counteur will cotinue to count from this value.
so please help me to do this, and to know how i can write a vhdl source code to use the SPARTAN 3 memory ,where i want to write when there is no light,and when the light come back i whant to read the previous memorised data and display it. :
i just want think you for advise. You asked me to give you the vhdl source code that i want to use.here it is:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity leccd1 is
Port ( d : in std_logic_vector(3 downto 0);
s : out std_logic_vector(6 downto 0);
i : in std_logic;
o : out std_logic
);
end leccd1;
architecture Behavioral of leccd1 is
begin
o<='0' when i='1' else '1';
s <="1110111" when d="0000" else
"0010010" when d="0001" else
"1011101" when d="0010" else
"1011011" when d="0011" else
"0111010" when d="0100" else
"1101011" when d="0101" else
"1101111" when d="0110" else
"1010010" when d="0111" else
"1111111" when d="1000" else
"1111011" when d="1001" else
"1111110" when d="1010" else
"0101111" when d="1011" else
"0001101" when d="1100" else
"0011111" when d="1101" else
"1101101" when d="1110" else
"1101100";
end Behavioral;
entity displaycountf is
Port ( clk : in std_logic;
count : out std_logic_vector(3 downto 0));
end displaycountf;
architecture Behavioral of displaycountf is
signal cnt: std_logic_vector(27 downto 0);
begin
process(clk)
begin
if clk'event and clk='0' then
cnt<= cnt + 1 ;
end if;
end process ;
count(3 downto 0)<= cnt(27 downto 24);
end Behavioral;
in fact i want to use four of this counter to count from 0000 to 9999 and these nombers will be displayed the lcd of the spartan 3 starter board. and when there is no light i want the value to be keep in the memory and it will be pisplayed when the light come back and the counteur will cotinue to count from this value.
so please help me to do this, and to know how i can write a vhdl source code to use the SPARTAN 3 memory ,where i want to write when there is no light,and when the light come back i whant to read the previous memorised data and display it. :