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

Subversion Repositories image_component_labeling_and_feature_extraction

[/] [image_component_labeling_and_feature_extraction/] [trunk/] [ram_num.vhd] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 malikpearl
----------------------------------------------------------------------------------
2
-- Company: 
3
-- Engineer: 
4
-- 
5
-- Create Date:    10:00:30 02/25/2009 
6
-- Design Name: 
7
-- Module Name:    ram_num - Behavioral 
8
-- Project Name: 
9
-- Target Devices: 
10
-- Tool versions: 
11
-- Description: 
12
--
13
-- Dependencies: 
14
--
15
-- Revision: 
16
-- Additional Comments: 
17
--
18
----------------------------------------------------------------------------------
19
library IEEE;
20
use IEEE.STD_LOGIC_1164.ALL;
21
use IEEE.STD_LOGIC_ARITH.ALL;
22
use IEEE.STD_LOGIC_UNSIGNED.ALL;
23
 
24
---- Uncomment the following library declaration if instantiating
25
---- any Xilinx primitives in this code.
26
--library UNISIM;
27
--use UNISIM.VComponents.all;
28
 
29
entity ram_num is
30
    Port ( addrW : in  STD_LOGIC_VECTOR (9 downto 0);
31
           din : in  STD_LOGIC_VECTOR (33 downto 0);
32
           we : in  STD_LOGIC;
33
           addrR : in  STD_LOGIC_VECTOR (9 downto 0);
34
--                        ramreset : in std_logic;
35
           dout : out  STD_LOGIC_VECTOR (33 downto 0);
36
--                        test : out std_logic_vector (33 downto 0);
37
           clk : in  STD_LOGIC);
38
end ram_num;
39
 
40
architecture Behavioral of ram_num is
41
 
42
type ram_type is array(1023 downto 0) of std_logic_vector(33 downto 0);
43
signal ram_array : ram_type:=(others=>(others=>'0'));
44
begin
45
        process(clk)
46
        begin
47
 
48
                if clk'event and clk ='1' then
49
                        if we='1' then
50
                                ram_array(conv_integer(addrW)) <= din;
51
                        end if;
52
                        dout <= ram_array(conv_integer(addrR));
53
                end if;
54
 
55
        end process;
56
 
57
 
58
end Behavioral;
59
 
60
 

powered by: WebSVN 2.1.0

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