سلام خسته نباشید.
یه برنامه نوشتم که قرار 64 بایت دیتارو یکی درمیون تو دوتا ارایه 32 بایتی ذخیره کنه ولی هر کاری می کنم دیتا مرتب ذخیره نمیشه.
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.std_logic_arith.all;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity lop is
Port (
o : out std_logic:='0';
o1 : out std_logic:='0';
int1 : in std_logic:='0';---int save data
a: in std_logic_vector(7 downto 0));
end lop;
architecture Behavioral of lop is
signal lo:integer range 0 to 31:=0;
;
signal cnt:integer range 0 to 1:=0;
-----------------------------------------
signal r0:integer range 0 to 255:=0;
-----------------------------------------
type m_arr0 is array(0 to 31)of integer range 0 to 255;
signal arr0:m_arr0;
type m_arr1 is array(0 to 31)of integer range 0 to 255;
signal arr1:m_arr1;
begin
------------------------------------------------------------
process(int1)
begin
if(rising_edge(int1))then
r0<=conv_integer(a);
--arr0(cnt)<=r0;
if cnt=0 then
arr0(lo)<=r0;
end if;
if cnt=1 then
arr1(lo)<=r0;
lo<=lo+1;
end if;
cnt<=cnt+1;
end if;
end process;
end Behavioral;
لظفا راهنماییم کنید
یه برنامه نوشتم که قرار 64 بایت دیتارو یکی درمیون تو دوتا ارایه 32 بایتی ذخیره کنه ولی هر کاری می کنم دیتا مرتب ذخیره نمیشه.
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.std_logic_arith.all;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity lop is
Port (
o : out std_logic:='0';
o1 : out std_logic:='0';
int1 : in std_logic:='0';---int save data
a: in std_logic_vector(7 downto 0));
end lop;
architecture Behavioral of lop is
signal lo:integer range 0 to 31:=0;
;
signal cnt:integer range 0 to 1:=0;
-----------------------------------------
signal r0:integer range 0 to 255:=0;
-----------------------------------------
type m_arr0 is array(0 to 31)of integer range 0 to 255;
signal arr0:m_arr0;
type m_arr1 is array(0 to 31)of integer range 0 to 255;
signal arr1:m_arr1;
begin
------------------------------------------------------------
process(int1)
begin
if(rising_edge(int1))then
r0<=conv_integer(a);
--arr0(cnt)<=r0;
if cnt=0 then
arr0(lo)<=r0;
end if;
if cnt=1 then
arr1(lo)<=r0;
lo<=lo+1;
end if;
cnt<=cnt+1;
end if;
end process;
end Behavioral;