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

Subversion Repositories wdsp

[/] [wdsp/] [trunk/] [rtl/] [vhdl/] [WISHBONE_FFT/] [adder.vhd] - Blame information for rev 5

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 5 parrado
library IEEE;
2
use IEEE.std_logic_1164.all;
3
use ieee.std_logic_arith.all;
4
 
5
entity adder is
6
      generic (
7
        inst_width : INTEGER := 32
8
             );
9
       port (
10
            inst_A : in std_logic_vector(inst_width-1 downto            0);
11
            inst_B : in std_logic_vector(inst_width-1 downto 0          );
12
            SUM : out std_logic_vector(inst_width downto 0)
13
 
14
            );
15
    end adder;
16
 
17
architecture oper of adder is
18
 signal a_signed, b_signed, sum_signed: SIGNED(inst_width downto 0);
19
begin
20
   a_signed <= SIGNED(inst_A(inst_width-1) & inst_A);
21
   b_signed <= SIGNED(inst_B(inst_width-1) & inst_B);
22
        sum_signed <= a_signed + b_signed;
23
  SUM <= std_logic_vector(sum_signed);
24
end oper;

powered by: WebSVN 2.1.0

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