aboutsummaryrefslogtreecommitdiff
path: root/works/life/computer-organization-experiment/adder_1.vhdl
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-11-23 09:51:36 +0800
committercrupest <crupest@outlook.com>2021-11-23 09:51:36 +0800
commit224d5fec9b9377faa4bf8d3da0e37f675ef5ea03 (patch)
tree3b06ea5155efa5c1313e3af1c67b16e57adaf1d8 /works/life/computer-organization-experiment/adder_1.vhdl
parent226bfe84c5f690462adbf386dc66316cc21fdb28 (diff)
downloadcrupest-224d5fec9b9377faa4bf8d3da0e37f675ef5ea03.tar.gz
crupest-224d5fec9b9377faa4bf8d3da0e37f675ef5ea03.tar.bz2
crupest-224d5fec9b9377faa4bf8d3da0e37f675ef5ea03.zip
import(life): Add computer organization experiment 4.
Diffstat (limited to 'works/life/computer-organization-experiment/adder_1.vhdl')
-rw-r--r--works/life/computer-organization-experiment/adder_1.vhdl13
1 files changed, 13 insertions, 0 deletions
diff --git a/works/life/computer-organization-experiment/adder_1.vhdl b/works/life/computer-organization-experiment/adder_1.vhdl
new file mode 100644
index 0000000..625aae4
--- /dev/null
+++ b/works/life/computer-organization-experiment/adder_1.vhdl
@@ -0,0 +1,13 @@
+LIBRARY IEEE;
+USE IEEE.STD_LOGIC_1164.ALL;
+USE IEEE.STD_LOGIC_UNSIGNED.ALL;
+
+entity adder_1 is
+ port (A, B, CIN:in std_logic; S, COUT: out std_logic);
+end adder_1;
+
+architecture behavior of adder_1 is
+begin
+ S <= (A XOR B) XOR CIN;
+ COUT <= (A AND B) OR (B AND CIN) OR (CIN AND A);
+end behavior;