diff options
author | Rahul Paknikar | 2019-06-25 09:52:35 +0530 |
---|---|---|
committer | GitHub | 2019-06-25 09:52:35 +0530 |
commit | 8a4061e6b4aae0664e69cc09b28697742936149a (patch) | |
tree | 0865749e274f9c393d0b125a36f3aca2b051c6ed /Example/demux/t_demux.vhdl | |
parent | a81c4ecb38dc18f36688113c6fa1b28a84802183 (diff) | |
download | nghdl-8a4061e6b4aae0664e69cc09b28697742936149a.tar.gz nghdl-8a4061e6b4aae0664e69cc09b28697742936149a.tar.bz2 nghdl-8a4061e6b4aae0664e69cc09b28697742936149a.zip |
Add files via upload
Diffstat (limited to 'Example/demux/t_demux.vhdl')
-rw-r--r-- | Example/demux/t_demux.vhdl | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/Example/demux/t_demux.vhdl b/Example/demux/t_demux.vhdl new file mode 100644 index 0000000..1e1f0bd --- /dev/null +++ b/Example/demux/t_demux.vhdl @@ -0,0 +1,32 @@ +library IEEE; +use IEEE.STD_LOGIC_1164.all; + +entity t_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 t_demux; + +architecture bhv of t_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;
\ No newline at end of file |