OpenCores
URL https://opencores.org/ocsvn/mcip_open/mcip_open/trunk

Subversion Repositories mcip_open

[/] [mcip_open/] [trunk/] [MCIPopen_XilinxISEproject/] [Memory_bank.vhd] - Blame information for rev 4

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 4 mezzah
----------------------------------------------------------------------------------
2
-- Company:        Ferhat Abbas University - Algeria
3
-- Engineer:       Ibrahim MEZZAH
4
-- 
5
-- Create Date:    15:58:29 06/17/2013 
6
-- Design Name: 
7
-- Module Name:    Memory_bank - Behavioral 
8
-- Project Name: 
9
-- Target Devices: 
10
-- Tool versions: 
11
-- Description: 
12
--
13
-- Dependencies: 
14
--
15
-- Revision: 
16
-- Revision 0.01 - File Created
17
-- Additional Comments: 
18
--
19
----------------------------------------------------------------------------------
20
library IEEE;
21
use IEEE.STD_LOGIC_1164.ALL;
22
use IEEE.STD_LOGIC_UNSIGNED.ALL;
23
 
24
entity Memory_bank is
25
    Port ( Address : in std_logic_vector(7 downto 0);
26
           enable  : in std_logic;
27
           RE      : in std_logic;
28
                          WE      : in std_logic;
29
           Q1      : in std_logic;
30
           Q4      : in std_logic;
31
           DATA    : inout std_logic_vector(7 downto 0));
32
end Memory_bank;
33
 
34
architecture Behavioral of Memory_bank is
35
 
36
        type Ram_Table is array(0 to 255) of std_logic_vector(7 downto 0);
37
 
38
        signal Bank : Ram_Table := (others => X"00");
39
 
40
        signal data_read : std_logic_vector(7 downto 0);
41
        signal data_write : std_logic_vector(7 downto 0);
42
 
43
begin
44
 
45
        data_read <= Bank(CONV_INTEGER(Address));
46
        data_write <= DATA;
47
 
48
        DATA <= data_read         when enable = '1' and RE = '1' and Q1 = '1' else (others => 'Z');
49
 
50
        process
51
        begin
52
          wait until rising_edge(Q4);
53
                 if enable = '1' and WE = '1' then
54
                         Bank(CONV_INTEGER(Address)) <= data_write;
55
                 end if;
56
        end process;
57
 
58
 
59
end Behavioral;
60
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.