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

Subversion Repositories v65c816

[/] [v65c816/] [trunk/] [kr.vhd] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 Valerio63
library IEEE;
2
use IEEE.std_logic_1164.all;  -- defines std_logic types
3
use IEEE.STD_LOGIC_unsigned.all;
4
use IEEE.STD_LOGIC_arith.all;
5
 
6
-- 8 bit register "K" (PBR)
7
entity kr is
8
  port(    clk:  in STD_LOGIC;
9
           clr:  in STD_LOGIC;
10
         fwait:  in STD_LOGIC;
11
            ld:  in STD_LOGIC;
12
           din:  in STD_LOGIC_VECTOR(7 downto 0);
13
          dout: out STD_LOGIC_VECTOR(7 downto 0)
14
      );
15
end kr;
16
 
17
architecture rtl of kr is
18
signal reg: STD_LOGIC_VECTOR(7 downto 0);
19
begin
20
  process(clk)
21
    begin
22
      if (clk'event and clk = '1') then
23
        if fwait = '1' then
24
          reg <= reg;
25
        else
26
                    if clr = '1' then
27
                           reg <= "00000000";
28
                         else
29
            if ld = '1' then
30
              reg <= din;
31
            else
32
              reg <= reg;
33
            end if;
34
                    end if;
35
        end if;
36
      end if;
37
  end process;
38
  dout <= reg;
39
end rtl;
40
 
41
 

powered by: WebSVN 2.1.0

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