سلام
خسته نباشید.
می خوام 4064 بایت از وروی بصورت 8 بیتی بگیرم و در ارایه ذخیره کنم.تا اینجا مشکلی نداره.ولی زمانی که پایه های دیگه 0 یا 1 میشن دیگه دیتا رو درست دریافت نمیکنه.
اینم برنامه:
خسته نباشید.
می خوام 4064 بایت از وروی بصورت 8 بیتی بگیرم و در ارایه ذخیره کنم.تا اینجا مشکلی نداره.ولی زمانی که پایه های دیگه 0 یا 1 میشن دیگه دیتا رو درست دریافت نمیکنه.
اینم برنامه:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity lop is
Port ( clk : in STD_LOGIC;
o : out std_logic_vector(0 to 125);--10us cycle
t : out std_logic;--check for corect save data
int2 : in std_logic;--save data
a: in std_logic_vector(7 downto 0));--8 bit data in
end lop;
architecture Behavioral of lop is
--------------------signal--------------------------------------
signal qq:std_logic_vector(0 to 125);
signal tim:integer range 0 to 10:=0;
-----------------array--------------------------------
type ramm is array(0 to 4063)of std_logic_vector(7 downto 0);
shared variable ram:ramm;
--------------------save data------------------------------
begin
process(int2)
variable cnt:integer range 0 to 4063:=0;
begin
if(rising_edge(int2))then
ram(cnt):=a;
cnt:=cnt+1;
end if;
end process;
-------------output 10us----------------------------
process(clk)
begin
if(clk' event and clk='1'
then
tim<=tim+1;
if tim=10 then
qq<=not qq;
end if;
end if;
end process;
o<=qq;
-----------------------check data------------------------------------
t<='1' when "11111111"=ram(4063) else'0';--check for corect data
end Behavioral;
ممنون میشم کمک کنید.
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity lop is
Port ( clk : in STD_LOGIC;
o : out std_logic_vector(0 to 125);--10us cycle
t : out std_logic;--check for corect save data
int2 : in std_logic;--save data
a: in std_logic_vector(7 downto 0));--8 bit data in
end lop;
architecture Behavioral of lop is
--------------------signal--------------------------------------
signal qq:std_logic_vector(0 to 125);
signal tim:integer range 0 to 10:=0;
-----------------array--------------------------------
type ramm is array(0 to 4063)of std_logic_vector(7 downto 0);
shared variable ram:ramm;
--------------------save data------------------------------
begin
process(int2)
variable cnt:integer range 0 to 4063:=0;
begin
if(rising_edge(int2))then
ram(cnt):=a;
cnt:=cnt+1;
end if;
end process;
-------------output 10us----------------------------
process(clk)
begin
if(clk' event and clk='1'

tim<=tim+1;
if tim=10 then
qq<=not qq;
end if;
end if;
end process;
o<=qq;
-----------------------check data------------------------------------
t<='1' when "11111111"=ram(4063) else'0';--check for corect data
end Behavioral;
دیدگاه