Академический Документы
Профессиональный Документы
Культура Документы
use IEEE.STD_LOGIC_UNSIGNED.ALL; entity ram0 is Port ( clk : in STD_LOGIC; rst : in STD_LOGIC; rw : in STD_LOGIC; add : in integer range 0 to 31 ; din : in STD_LOGIC_vector(7 downto 0); dout : out STD_LOGIC_vector(7 downto 0)); end ram0; architecture Behavioral of ram0 is type mem is array (0 to 31) of std_logic_vector (7 downto 0); signal ram:mem; begin process(clk,rst,rw) begin if(rst='1')then for i in 0 to 31 loop ram(i)<="00000000"; end loop; dout<="00000000"; elsif(clk'event and clk='1')then if(rw='0')then ram(add)<=din; else dout<=ram(add);
PROCEDURE: 1. Open a new project from Xilinx ISE6,a project navigation software tool. 2.Select a source file name as VHDL module and define the VHDL sources respectively the input and output ports. 3.Enter the program and save the file. 4.Check the syntax option from synthesis to know the error. 5.Go for the synthesize XST to view TTL schematic report(new list). 6. Launch Modelsim simulator from design entry utilites and enter the values of input ports. 7.Run the program to view the waveform representation of the output. 8.For implementation of the design,we should configure the design by connecting the fabrication kit to the computer. RESULT: Designed and simulated a 32*8 RAM