##// END OF EJS Templates
add comments for clk_50 frequency in the code (ALTRAN request)
add comments for clk_50 frequency in the code (ALTRAN request)

File last commit:

r163:74b59a804717 martin
r610:f9824a3b6ae2 simu_with_Leon3
Show More
Adder.vhd
71 lines | 2.2 KiB | text/x-vhdl | VhdlLexer
Alexis
aded GRLIB Automated patcher
r1 ------------------------------------------------------------------------------
-- This file is a part of the LPP VHDL IP LIBRARY
-- Copyright (C) 2009 - 2010, Laboratory of Plasmas Physic - CNRS
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
Alexis
Migrating from GPLV2 to V3, and cleand some files. /!\ Unstable /!\
r19 -- the Free Software Foundation; either version 3 of the License, or
Alexis
aded GRLIB Automated patcher
r1 -- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program; if not, write to the Free Software
-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-------------------------------------------------------------------------------
Alexis
Minor changes
r38 -- Author : Alexis Jeandet
-- Mail : alexis.jeandet@lpp.polytechnique.fr
----------------------------------------------------------------------------
pellion
LPP IIR FILTER v2.0.0...
r111 LIBRARY IEEE;
USE IEEE.numeric_std.ALL;
USE IEEE.std_logic_1164.ALL;
Alexis
aded GRLIB Automated patcher
r1
pellion
LPP IIR FILTER v2.0.0...
r111 ENTITY Adder IS
GENERIC(
Input_SZ_A : INTEGER := 16;
Input_SZ_B : INTEGER := 16
Alexis
aded GRLIB Automated patcher
r1
pellion
LPP IIR FILTER v2.0.0...
r111 );
PORT(
clk : IN STD_LOGIC;
reset : IN STD_LOGIC;
clr : IN STD_LOGIC;
load : IN STD_LOGIC;
add : IN STD_LOGIC;
OP1 : IN STD_LOGIC_VECTOR(Input_SZ_A-1 DOWNTO 0);
OP2 : IN STD_LOGIC_VECTOR(Input_SZ_B-1 DOWNTO 0);
RES : OUT STD_LOGIC_VECTOR(Input_SZ_A-1 DOWNTO 0)
);
END ENTITY;
Alexis
aded GRLIB Automated patcher
r1
pellion
LPP IIR FILTER v2.0.0...
r111 ARCHITECTURE ar_Adder OF Adder IS
Alexis
aded GRLIB Automated patcher
r1
pellion
LPP IIR FILTER v2.0.0...
r111 SIGNAL REG : STD_LOGIC_VECTOR(Input_SZ_A-1 DOWNTO 0);
SIGNAL RESADD : STD_LOGIC_VECTOR(Input_SZ_A-1 DOWNTO 0);
Alexis
aded GRLIB Automated patcher
r1
pellion
LPP IIR FILTER v2.0.0...
r111 BEGIN
Alexis
aded GRLIB Automated patcher
r1
pellion
LPP IIR FILTER v2.0.0...
r111 RES <= REG;
RESADD <= STD_LOGIC_VECTOR(resize(SIGNED(OP1)+SIGNED(OP2), Input_SZ_A));
Alexis
aded GRLIB Automated patcher
r1
pellion
LPP IIR FILTER v2.0.0...
r111 PROCESS(clk, reset)
BEGIN
IF reset = '0' THEN
REG <= (OTHERS => '0');
ELSIF clk'EVENT AND clk = '1' then
IF clr = '1' THEN
REG <= (OTHERS => '0');
ELSIF add = '1' THEN
REG <= RESADD;
ELSIF load = '1' THEN
REG <= OP2;
END IF;
END IF;
END PROCESS;
END ar_Adder;