Line 1... |
Line 1... |
----------------------------------------------------------------------------------
|
----------------------------------------------------------------------------------
|
-- Company:
|
-- Engineer: Joao Carlos Nunes Bittencourt
|
-- Engineer:
|
----------------------------------------------------------------------------------
|
--
|
-- Create Date: 13:18:18 03/06/2012
|
-- Create Date: 21:48:33 04/18/2012
|
----------------------------------------------------------------------------------
|
-- Design Name:
|
-- Design Name: Adder Macrofunction
|
-- Module Name: adder - Behavioral
|
-- Module Name: adder - behavioral
|
-- Project Name:
|
----------------------------------------------------------------------------------
|
-- Target Devices:
|
-- Project Name: 16-bit uRISC Processor
|
-- Tool versions:
|
----------------------------------------------------------------------------------
|
-- Description:
|
|
--
|
|
-- Dependencies:
|
|
--
|
|
-- Revision:
|
-- Revision:
|
-- Revision 0.01 - File Created
|
-- 1.0 - File Created
|
-- Additional Comments:
|
-- 2.0 - Project refactoring
|
--
|
--
|
----------------------------------------------------------------------------------
|
----------------------------------------------------------------------------------
|
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;
|
Line 24... |
Line 20... |
|
|
entity adder is
|
entity adder is
|
Generic (
|
Generic (
|
WIDTH : integer := 16 );
|
WIDTH : integer := 16 );
|
Port (
|
Port (
|
data_a : in std_logic_vector (WIDTH-1 downto 0);
|
sink_a : in std_logic_vector (WIDTH-1 downto 0);
|
data_b : in std_logic_vector (WIDTH-1 downto 0);
|
sink_b : in std_logic_vector (WIDTH-1 downto 0);
|
result : out std_logic_vector (WIDTH-1 downto 0) );
|
src_data : out std_logic_vector (WIDTH-1 downto 0) );
|
end adder;
|
end adder;
|
|
|
architecture Macrofunction of adder is
|
architecture behavioral of adder is
|
begin
|
begin
|
process(data_a, data_b)
|
process(sink_a, sink_b)
|
variable mAux : std_logic_vector(WIDTH-1 downto 0) := conv_std_logic_vector(0,WIDTH);
|
variable aux : std_logic_vector(WIDTH-1 downto 0) := conv_std_logic_vector(0,WIDTH);
|
begin
|
begin
|
mAux := data_a + data_b;
|
aux := sink_a + sink_b;
|
result <= mAux;
|
src_data <= aux;
|
end process;
|
end process;
|
|
|
end Macrofunction;
|
end behavioral;
|
|
|
|
|
No newline at end of file
|
No newline at end of file
|