[vhdl] RAM설계, testbench
- 최초 등록일
- 2008.06.14
- 최종 저작일
- 2008.05
- 6페이지/ 한컴오피스
- 가격 1,500원
소개글
[vhdl] RAM설계, testbench
목차
[RAM (Random Access Memory)설계]
1. 임의입력
VHDL 파일
TB파일
그래프파형
2.입력값 적용
VHDL파일
TB파일
그래프파형
본문내용
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity ram is
port( CE,RD,WR : in std_logic;
Address,In_data: in std_logic_vector(3 downto 0);
Out_data: out std_logic_vector(3 downto 0)
);
end ram;
architecture behave of ram is
subtype ram_word is std_logic_vector(3 downto 0);
type ram_table is array(0 to 15) of std_logic_vector(3 downto 0);
signal ram_data:ram_table;
begin
process(CE, RD, WR, Address, In_data)
begin
if CE=`0` then
if (RD=`0` and WR=`1`) then
Out_data <=ram_data(conv_integer(Address));
elsif (RD=`1` and WR=`0`) then
ram_data(conv_integer(Address))<=In_data;
Out_data<=(others=>`Z`);
else
Out_data<=(others=>`Z`);
end if;
else Out_data<=(others=>`Z`);
end if;
end process;
end behave;
참고 자료
없음