File: addaccu.vhdl

package info (click to toggle)
alliance 5.0-20120515-6
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 70,324 kB
  • ctags: 39,977
  • sloc: ansic: 350,299; vhdl: 34,227; yacc: 27,122; sh: 12,416; cpp: 9,478; makefile: 7,057; lex: 3,684
file content (34 lines) | stat: -rw-r--r-- 820 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_arith.ALL;
use IEEE.STD_LOGIC_unsigned.ALL;


entity AddAccu is

    port ( CLR : in Std_Logic;
           LD : in Std_Logic;
           OUTS : in Std_Logic_Vector(15 downto 0) ;
           CLK : in Std_Logic;

           RESULT : out Std_Logic_Vector(15 downto 0) );

end AddAccu;


----------------------------------------------------------------------

architecture DataFlow OF AddAccu is
signal resultint : Std_Logic_Vector(15 downto 0) ;
begin
process (CLK)
begin
   if CLK'event and CLK='1' then
      if CLR = '1' then resultint  <= ( others => '0' );
      elsif LD = '1' then resultint <= resultint + OUTS;
      end if;
 end if;
end process;
RESULT <= resultint;
end DataFlow;
----------------------------------------------------------------------