⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dpram.vhd

📁 异步串口通信VHDL源代码
💻 VHD
字号:
------------------------------------------------------------------------------------ Company: -- Engineer: -- -- Create Date:    16:09:14 01/04/2008 -- Design Name: -- Module Name:    dpRam - Behavioral -- Project Name: -- Target Devices: -- Tool versions: -- Description: ---- Dependencies: ---- Revision: -- Revision 0.01 - File Created-- Additional Comments: ------------------------------------------------------------------------------------library IEEE;use IEEE.STD_LOGIC_1164.ALL;use IEEE.STD_LOGIC_ARITH.ALL;use IEEE.STD_LOGIC_UNSIGNED.ALL;---- Uncomment the following library declaration if instantiating---- any Xilinx primitives in this code.--library UNISIM;--use UNISIM.VComponents.all;entity DRam_256_8 is    Port ( clk : in  STD_LOGIC;           wr_en : in  STD_LOGIC;           rd_en : in  STD_LOGIC;           din : in  STD_LOGIC_VECTOR (7 downto 0);           dout : out  STD_LOGIC_VECTOR (7 downto 0);           addr : in  STD_LOGIC_VECTOR (7 downto 0) := (others => '0')
			);end DRam_256_8;architecture Behavioral of DRam_256_8 is	subtype ram_word is std_logic_vector(7 downto 0);
	type ram_table is array (0 to 255) of ram_word;
	signal ram: ram_table; 
	
	signal addr_buf: integer range 0 to 255 ;begin

	addr_buf <= CONV_INTEGER(addr);
		pread: process(clk)
	begin
		if rising_edge(clk) then
			if rd_en = '1' then
				dout <= ram(addr_buf);
			else
				dout <= (others => 'X');
			end if;
		end if;
	end process;
	
	pwrite: process(clk)
	begin
		if rising_edge(clk) then
			if wr_en = '1' then
				ram(addr_buf) <= din;
			end if;
		end if;
	end process;end Behavioral;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -