aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/gna/issue1226/adder.vhdl
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-04-15 19:11:40 +0200
committerTristan Gingold <tgingold@free.fr>2020-04-15 22:09:24 +0200
commitaea192b38e1ef5575f7ee8149e5fa4b7e41f34a1 (patch)
tree81ebf69ea3817ecc6439aa82d49d4847aa85079e /testsuite/gna/issue1226/adder.vhdl
parent0c05fa85d3695fc82336e2712ae223170c310cc1 (diff)
downloadghdl-aea192b38e1ef5575f7ee8149e5fa4b7e41f34a1.tar.gz
ghdl-aea192b38e1ef5575f7ee8149e5fa4b7e41f34a1.tar.bz2
ghdl-aea192b38e1ef5575f7ee8149e5fa4b7e41f34a1.zip
testsuite/gna: add case from #1226
Diffstat (limited to 'testsuite/gna/issue1226/adder.vhdl')
-rw-r--r--testsuite/gna/issue1226/adder.vhdl20
1 files changed, 20 insertions, 0 deletions
diff --git a/testsuite/gna/issue1226/adder.vhdl b/testsuite/gna/issue1226/adder.vhdl
new file mode 100644
index 000000000..a3c6acdf6
--- /dev/null
+++ b/testsuite/gna/issue1226/adder.vhdl
@@ -0,0 +1,20 @@
+library ieee;
+use ieee.std_logic_1164.all;
+use ieee.numeric_std.all;
+
+entity adder is
+ port
+ (
+ nibble1, nibble2 : in unsigned(3 downto 0);
+ sum : out unsigned(3 downto 0);
+ carry_out : out std_logic
+ );
+end entity adder;
+
+architecture behavioral of adder is
+ signal temp : unsigned(4 downto 0);
+begin
+ temp <= ("0" & nibble1) + nibble2;
+ sum <= temp(3 downto 0);
+ carry_out <= temp(4);
+end architecture behavioral;