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

Subversion Repositories cowgirl

[/] [cowgirl/] [trunk/] [register.vhdl] - Blame information for rev 4

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 thebeekeep
-- 10/24/2005
2
-- 16 bit register
3
 
4
library ieee;
5
use ieee.std_logic_1164.all;
6
 
7
entity reg is port(
8
  d    : in std_logic_vector(15 downto 0);
9
  clk  : in std_logic;
10
  wr_en: in std_logic;
11
  q    : out std_logic_vector(15 downto 0)
12
  );
13
end reg;
14
 
15
architecture reg_arch of reg is
16
 
17
  signal temp_q : std_logic_vector(15 downto 0) := x"0000";
18
 
19
begin
20
  process(clk, wr_en, d)
21
  begin
22
    if (clk'event and clk='1') then
23
      if wr_en = '1' then
24
        temp_q <= d;
25
      end if;
26
    end if;
27
  end process;
28
 
29
  -- concurrent assignment
30
  q <= temp_q;
31
 
32
end reg_arch;

powered by: WebSVN 2.1.0

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