Line 5... |
Line 5... |
---- Modular Simultaneous Exponentiation Core project ----
|
---- Modular Simultaneous Exponentiation Core project ----
|
---- http://www.opencores.org/cores/mod_sim_exp/ ----
|
---- http://www.opencores.org/cores/mod_sim_exp/ ----
|
---- ----
|
---- ----
|
---- Description ----
|
---- Description ----
|
---- This file contains the implementation of a 1-bit full ----
|
---- This file contains the implementation of a 1-bit full ----
|
---- adder cell using logic gates ----
|
---- adder cell using combinatorial logic ----
|
---- used in adder_block ----
|
---- used in adder_block ----
|
---- ----
|
---- ----
|
---- Dependencies: none ----
|
---- Dependencies: none ----
|
---- ----
|
---- ----
|
---- Authors: ----
|
---- Authors: ----
|
Line 46... |
Line 46... |
library ieee;
|
library ieee;
|
use ieee.std_logic_1164.all;
|
use ieee.std_logic_1164.all;
|
use ieee.std_logic_arith.all;
|
use ieee.std_logic_arith.all;
|
use ieee.std_logic_unsigned.all;
|
use ieee.std_logic_unsigned.all;
|
|
|
|
-- 1-bit full adder cell
|
|
-- for use in the montgommery multiplier systolic array cells
|
entity cell_1b_adder is
|
entity cell_1b_adder is
|
port (
|
port (
|
a : in std_logic;
|
a : in std_logic; -- adder input operand a
|
mux_result : in std_logic;
|
mux_result : in std_logic; -- adder input muxed result
|
cin : in std_logic;
|
cin : in std_logic; -- carry in
|
cout : out std_logic;
|
cout : out std_logic; -- carry out
|
r : out std_logic
|
r : out std_logic -- result out
|
);
|
);
|
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
|
|
-- 1-bit full adder with combinatorial logic
|
|
-- uses 2 XOR's, 2 AND's and 1 OR port
|
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
|