summaryrefslogtreecommitdiff
path: root/Example/demux/demux.vhdl
diff options
context:
space:
mode:
authorRahul Paknikar2019-06-25 09:53:28 +0530
committerGitHub2019-06-25 09:53:28 +0530
commit42d57e78441f4b38ada6ff230cf6789a80faa4c0 (patch)
treef6c6d3e46631339f869e31c56cb55ab981934021 /Example/demux/demux.vhdl
parent9e80e87f39b65b91824e46c131fa98987a7e25f0 (diff)
downloadnghdl-42d57e78441f4b38ada6ff230cf6789a80faa4c0.tar.gz
nghdl-42d57e78441f4b38ada6ff230cf6789a80faa4c0.tar.bz2
nghdl-42d57e78441f4b38ada6ff230cf6789a80faa4c0.zip
Update and rename t_demux.vhdl to demux.vhdl
Diffstat (limited to 'Example/demux/demux.vhdl')
-rw-r--r--Example/demux/demux.vhdl32
1 files changed, 32 insertions, 0 deletions
diff --git a/Example/demux/demux.vhdl b/Example/demux/demux.vhdl
new file mode 100644
index 0000000..e73c196
--- /dev/null
+++ b/Example/demux/demux.vhdl
@@ -0,0 +1,32 @@
+library IEEE;
+use IEEE.STD_LOGIC_1164.all;
+
+entity demux is
+ port(
+
+ F : in STD_LOGIC_vector(0 downto 0);
+ S0: in STD_LOGIC_vector(0 downto 0);
+ S1: in STD_LOGIC_vector(0 downto 0);
+ A: out STD_LOGIC_vector(0 downto 0);
+ B: out STD_LOGIC_vector(0 downto 0);
+ C: out STD_LOGIC_vector(0 downto 0);
+ D: out STD_LOGIC_vector(0 downto 0)
+ );
+end demux;
+
+architecture bhv of demux is
+begin
+process (F,S0,S1) is
+begin
+ if (S0 ="0" and S1 = "0") then
+ A <= F;
+ elsif (S0 ="1" and S1 = "0") then
+ B <= F;
+ elsif (S0 ="0" and S1 = "1") then
+ C <= F;
+ else
+ D <= F;
+ end if;
+
+end process;
+end bhv;