Line 1... |
Line 1... |
------------------------------------------------------------------------------------
|
----------------------------------------------------------------------
|
--
|
---- cell_1b_adder ----
|
-- Geoffrey Ottoy - DraMCo research group
|
---- ----
|
--
|
---- This file is part of the ----
|
-- Module Name: cell_1b_adder.vhd / entity cell_1b_adder
|
---- Modular Simultaneous Exponentiation Core project ----
|
--
|
---- http://www.opencores.org/cores/mod_sim_exp/ ----
|
-- Last Modified: 18/11/2011
|
---- ----
|
--
|
---- Description ----
|
-- Description: full adder for use in the montgommery multiplier systolic array
|
---- This file contains the implementation of a 1-bit full ----
|
-- currently a behavioral description
|
---- adder cell using logic gates ----
|
--
|
---- used in adder_block ----
|
--
|
---- ----
|
-- Dependencies: none
|
---- Dependencies: none ----
|
--
|
---- ----
|
-- Revision:
|
---- Authors: ----
|
-- Revision 2.00 - Major error resolved (carry & sum output were switched)
|
---- - Geoffrey Ottoy, DraMCo research group ----
|
-- Revision 1.00 - Architecture
|
---- - Jonas De Craene, JonasDC@opencores.org ----
|
-- Revision 0.01 - File Created
|
---- ----
|
--
|
----------------------------------------------------------------------
|
--
|
---- ----
|
------------------------------------------------------------------------------------
|
---- Copyright (C) 2011 DraMCo research group and OPENCORES.ORG ----
|
--
|
---- ----
|
-- NOTICE:
|
---- This source file may be used and distributed without ----
|
--
|
---- restriction provided that this copyright statement is not ----
|
-- Copyright DraMCo research group. 2011. This code may be contain portions patented
|
---- removed from the file and that any derivative work contains ----
|
-- by other third parties!
|
---- the original copyright notice and the associated disclaimer. ----
|
--
|
---- ----
|
------------------------------------------------------------------------------------
|
---- This source file is free software; you can redistribute it ----
|
library IEEE;
|
---- and/or modify it under the terms of the GNU Lesser General ----
|
use IEEE.STD_LOGIC_1164.ALL;
|
---- Public License as published by the Free Software Foundation; ----
|
use IEEE.STD_LOGIC_ARITH.ALL;
|
---- either version 2.1 of the License, or (at your option) any ----
|
use IEEE.STD_LOGIC_UNSIGNED.ALL;
|
---- later version. ----
|
|
---- ----
|
---- Uncomment the following library declaration if instantiating
|
---- This source is distributed in the hope that it will be ----
|
---- any Xilinx primitives in this code.
|
---- useful, but WITHOUT ANY WARRANTY; without even the implied ----
|
--library UNISIM;
|
---- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ----
|
--use UNISIM.VComponents.all;
|
---- PURPOSE. See the GNU Lesser General Public License for more ----
|
|
---- details. ----
|
|
---- ----
|
|
---- You should have received a copy of the GNU Lesser General ----
|
|
---- Public License along with this source; if not, download it ----
|
|
---- from http://www.opencores.org/lgpl.shtml ----
|
|
---- ----
|
|
----------------------------------------------------------------------
|
|
|
|
library ieee;
|
|
use ieee.std_logic_1164.all;
|
|
use ieee.std_logic_arith.all;
|
|
use ieee.std_logic_unsigned.all;
|
|
|
|
|
entity cell_1b_adder is
|
entity cell_1b_adder is
|
Port ( a : in STD_LOGIC;
|
port (
|
mux_result : in STD_LOGIC;
|
a : in std_logic;
|
cin : in STD_LOGIC;
|
mux_result : in std_logic;
|
cout : out STD_LOGIC;
|
cin : in std_logic;
|
r : out STD_LOGIC);
|
cout : out std_logic;
|
|
r : out std_logic
|
|
);
|
end cell_1b_adder;
|
end cell_1b_adder;
|
|
|
|
|
architecture Behavioral of cell_1b_adder is
|
architecture Behavioral of cell_1b_adder is
|
signal a_xor_mux_result: std_logic;
|
signal a_xor_mux_result: std_logic;
|
begin
|
begin
|
a_xor_mux_result <= a xor mux_result;
|
a_xor_mux_result <= a xor mux_result;
|
r <= a_xor_mux_result xor cin;
|
r <= a_xor_mux_result xor cin;
|
cout <= (a and mux_result) or (cin and a_xor_mux_result);
|
cout <= (a and mux_result) or (cin and a_xor_mux_result);
|
end Behavioral;
|
end Behavioral;
|
|
|
|
|
No newline at end of file
|
No newline at end of file
|