diff options
author | Rahul P | 2019-11-19 12:32:39 +0530 |
---|---|---|
committer | GitHub | 2019-11-19 12:32:39 +0530 |
commit | a6c0b36fcaba6c1f2d366432b2386122674b4782 (patch) | |
tree | 18a02155e45110fd6419139e48f6d9b277ab9870 /Example/mux-demux/demux.vhdl | |
parent | 2fe70dd26008b0f4920928d592290614bf47ce5d (diff) | |
parent | 6e12269c0681dcfb0d1ec927670fb9d69464af9c (diff) | |
download | nghdl-a6c0b36fcaba6c1f2d366432b2386122674b4782.tar.gz nghdl-a6c0b36fcaba6c1f2d366432b2386122674b4782.tar.bz2 nghdl-a6c0b36fcaba6c1f2d366432b2386122674b4782.zip |
Merge pull request #29 from rahulp13/master
Updated nghdl
Diffstat (limited to 'Example/mux-demux/demux.vhdl')
-rw-r--r-- | Example/mux-demux/demux.vhdl | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/Example/mux-demux/demux.vhdl b/Example/mux-demux/demux.vhdl new file mode 100644 index 0000000..e73c196 --- /dev/null +++ b/Example/mux-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; |