OpenCores
URL https://opencores.org/ocsvn/ourisc/ourisc/trunk

Subversion Repositories ourisc

[/] [ourisc/] [trunk/] [rtl/] [common/] [adder.vhd] - Blame information for rev 5

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 joaocarlos
----------------------------------------------------------------------------------
2
-- Company: 
3
-- Engineer: 
4
-- 
5
-- Create Date:    21:48:33 04/18/2012 
6
-- Design Name: 
7
-- Module Name:    adder - Behavioral 
8
-- Project Name: 
9
-- Target Devices: 
10
-- Tool versions: 
11
-- Description: 
12
--
13
-- Dependencies: 
14
--
15
-- Revision: 
16
-- Revision 0.01 - File Created
17
-- Additional Comments: 
18
--
19
----------------------------------------------------------------------------------
20
library ieee;
21
use ieee.std_logic_1164.all;
22
use ieee.std_logic_arith.all;
23
use ieee.std_logic_unsigned.all;
24
 
25
entity adder is
26
        Generic (
27
                WIDTH : integer := 16 );
28
    Port (
29
        data_a : in std_logic_vector (WIDTH-1 downto 0);
30
        data_b : in std_logic_vector (WIDTH-1 downto 0);
31
        result : out std_logic_vector (WIDTH-1 downto 0) );
32
end adder;
33
 
34
architecture Macrofunction of adder is
35
begin
36
        process(data_a, data_b)
37
                variable mAux : std_logic_vector(WIDTH-1 downto 0) := conv_std_logic_vector(0,WIDTH);
38
        begin
39
                mAux := data_a + data_b;
40
                result <= mAux;
41
        end process;
42
 
43
end Macrofunction;
44
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.