summaryrefslogtreecommitdiff
path: root/Example/half_adder/half_adder.vhdl
diff options
context:
space:
mode:
authorRahul Paknikar2019-06-25 09:50:26 +0530
committerGitHub2019-06-25 09:50:26 +0530
commite3076fbf6c6eb5f1aab8eef8ceaa3870ec1ea6a9 (patch)
tree2041e1d9eb333a46a282e5b7db0e42e9bd273be9 /Example/half_adder/half_adder.vhdl
parentb4168eaf495fdfb1d36df115f5f2d0ae74b7fbaa (diff)
downloadnghdl-e3076fbf6c6eb5f1aab8eef8ceaa3870ec1ea6a9.tar.gz
nghdl-e3076fbf6c6eb5f1aab8eef8ceaa3870ec1ea6a9.tar.bz2
nghdl-e3076fbf6c6eb5f1aab8eef8ceaa3870ec1ea6a9.zip
Update and rename trial_ha.vhdl to half_adder.vhdl
Diffstat (limited to 'Example/half_adder/half_adder.vhdl')
-rw-r--r--Example/half_adder/half_adder.vhdl18
1 files changed, 18 insertions, 0 deletions
diff --git a/Example/half_adder/half_adder.vhdl b/Example/half_adder/half_adder.vhdl
new file mode 100644
index 0000000..71ef1cc
--- /dev/null
+++ b/Example/half_adder/half_adder.vhdl
@@ -0,0 +1,18 @@
+library ieee;
+use ieee.std_logic_1164.all;
+use ieee.numeric_std.all;
+
+entity half_adder is
+ port (
+ i_bit0 : in std_logic_vector(0 downto 0);
+ i_bit1 : in std_logic_vector(0 downto 0);
+ o_sum : out std_logic_vector(0 downto 0);
+ o_carry : out std_logic_vector(0 downto 0)
+ );
+end half_adder;
+
+architecture rtl of half_adder is
+begin
+ o_sum <= i_bit0 xor i_bit1;
+ o_carry <= i_bit0 and i_bit1;
+end rtl;