aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/synth/sns01/add03.vhdl
blob: 16546bd0d882663fe8255e66e1f40d469aac5a16 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
LIBRARY ieee;
USE ieee.std_logic_1164.all;

entity add03 is
  port (
    a, b : std_logic_vector(8 DOWNTO 0);
    borrow : std_logic;
    res : out std_logic_vector(8 DOWNTO 0));
end add03;

LIBRARY ieee;
USE ieee.std_logic_arith.all;

architecture behav of add03 is
  signal t : signed(8 DOWNTO 0);
begin
  t <= signed(a) - signed(b) - borrow;
  res <= std_logic_vector(t);
end behav;