diff options
author | Rahul Paknikar | 2019-06-25 09:51:11 +0530 |
---|---|---|
committer | GitHub | 2019-06-25 09:51:11 +0530 |
commit | aa538a95b5ff747ad9fa3455ac2a6c88dcb0becb (patch) | |
tree | 8aa26a1267390059a09af0eec675a885b8ec5421 /Example/full_adder | |
parent | 9300750cc60402eb73595173af696cea6345b9ca (diff) | |
download | nghdl-aa538a95b5ff747ad9fa3455ac2a6c88dcb0becb.tar.gz nghdl-aa538a95b5ff747ad9fa3455ac2a6c88dcb0becb.tar.bz2 nghdl-aa538a95b5ff747ad9fa3455ac2a6c88dcb0becb.zip |
Add files via upload
Diffstat (limited to 'Example/full_adder')
-rw-r--r-- | Example/full_adder/trial_fa.vhdl | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Example/full_adder/trial_fa.vhdl b/Example/full_adder/trial_fa.vhdl new file mode 100644 index 0000000..6357aa2 --- /dev/null +++ b/Example/full_adder/trial_fa.vhdl @@ -0,0 +1,19 @@ +library ieee; +use ieee.std_logic_1164.all; +use ieee.numeric_std.all; + +entity trial_fa is + port ( + i_bit1 : in std_logic_vector(0 downto 0); + i_bit2 : in std_logic_vector(0 downto 0); + i_bit3 : 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 trial_fa; + +architecture rtl of trial_fa is +begin + o_sum <= i_bit1 xor i_bit2 xor i_bit3; + o_carry <= (i_bit1 and i_bit2) or (i_bit2 and i_bit3) or (i_bit3 and i_bit1); +end rtl;
\ No newline at end of file |