K
Kot
Guest
-- incr8.vhd
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity incr8 is
port (
a : in std_logic_vector(7 downto 0);
cin : in std_logic;
dout : out std_logic_vector(7 downto 0);
cout : out std_logic
);
end entity incr8;
architecture a1 of incr8 is
signal sum : std_logic_vector(8 downto 0);
begin
-- sum <= ('0' & a) + ( 8 downto 1 => '0', 0 => cin ) ;
-- above line does not work. why?
sum <= ( '0' & a ) + ( "00000000" & cin ) ;
cout <= sum(8);
dout <= sum(7 downto 0);
end architecture a1;
-- tool used is Synplicity's Synplify
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity incr8 is
port (
a : in std_logic_vector(7 downto 0);
cin : in std_logic;
dout : out std_logic_vector(7 downto 0);
cout : out std_logic
);
end entity incr8;
architecture a1 of incr8 is
signal sum : std_logic_vector(8 downto 0);
begin
-- sum <= ('0' & a) + ( 8 downto 1 => '0', 0 => cin ) ;
-- above line does not work. why?
sum <= ( '0' & a ) + ( "00000000" & cin ) ;
cout <= sum(8);
dout <= sum(7 downto 0);
end architecture a1;
-- tool used is Synplicity's Synplify