aboutsummaryrefslogtreecommitdiff
path: root/src/half_add.vhd
diff options
context:
space:
mode:
Diffstat (limited to 'src/half_add.vhd')
-rw-r--r--src/half_add.vhd18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/half_add.vhd b/src/half_add.vhd
new file mode 100644
index 0000000..d2d340a
--- /dev/null
+++ b/src/half_add.vhd
@@ -0,0 +1,18 @@
+LIBRARY ieee;
+USE ieee.std_logic_1164.ALL;
+USE ieee.numeric_std.ALL;
+
+-- half adder entity
+entity half_add is
+ port (
+ A: in std_logic;
+ B: in std_logic;
+ X: out std_logic;
+ Cout: out std_logic);
+end half_add;
+
+architecture Behavioral of half_add is
+begin
+ Cout <= (A AND B);
+ X <= (A XOR B);
+end Behavioral;