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

Subversion Repositories v65c816

[/] [v65c816/] [trunk/] [oper.vhd] - Blame information for rev 3

Go to most recent revision | 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
-- 16 bit operand hold operand register
7
entity oper is
8
  port(    clk:  in STD_LOGIC;
9
           clr:  in STD_LOGIC;
10
         fwait:  in STD_LOGIC;
11
            ld:  in STD_LOGIC;
12
        ld_lsb:  in STD_LOGIC;
13
        ld_msb:  in STD_LOGIC;
14
           din:  in STD_LOGIC_VECTOR(15 downto 0);
15
          dout: out STD_LOGIC_VECTOR(15 downto 0)
16
      );
17
end oper;
18
 
19
architecture rtl of oper is
20
signal reg: STD_LOGIC_VECTOR(15 downto 0);
21
begin
22
  process(clk)
23
    begin
24
      if (clk'event and clk = '1') then
25
        if fwait = '1' then
26
          reg <= reg;
27
        else
28
                    if clr = '1' then
29
             reg <= "0000000000000000";
30
                         else
31
                                 if ld = '1' then
32
                                        reg <= din;
33
                                 end if;
34
                                 if ld_lsb = '1' then
35
                                        reg(7 downto 0) <= din(7 downto 0);
36
                                        reg(15 downto 8) <= reg(15 downto 8);
37
                                 end if;
38
                                 if ld_msb = '1' then
39
                                        reg(15 downto 8) <= din(7 downto 0);
40
                                        reg(7 downto 0) <= reg(7 downto 0);
41
                                 end if;
42
                         end if;
43
        end if;
44
      end if;
45
  end process;
46
  dout <= reg;
47
end rtl;
48
 
49
 

powered by: WebSVN 2.1.0

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