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

Subversion Repositories wdsp

[/] [wdsp/] [trunk/] [rtl/] [vhdl/] [WISHBONE_FFT/] [subtract.vhd] - Blame information for rev 6

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

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

powered by: WebSVN 2.1.0

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