summaryrefslogtreecommitdiff
path: root/Example/combinational_logic/decoder/decoder.vhdl
diff options
context:
space:
mode:
authorsaurabhb172019-12-30 12:37:57 +0530
committerGitHub2019-12-30 12:37:57 +0530
commit9faa3ee18b0fe7ec50399b06280a5247658c3e9c (patch)
tree0ff4c4791a65364e3b93c91f56342569c7f7a7c9 /Example/combinational_logic/decoder/decoder.vhdl
parent04d9c666b4bb19936dfa469f536fb38107e631eb (diff)
parentfc1fb5abffa152808c621be38c8fbbe8de769b19 (diff)
downloadnghdl-9faa3ee18b0fe7ec50399b06280a5247658c3e9c.tar.gz
nghdl-9faa3ee18b0fe7ec50399b06280a5247658c3e9c.tar.bz2
nghdl-9faa3ee18b0fe7ec50399b06280a5247658c3e9c.zip
Merge pull request #35 from saurabhb17/master
Changes for 1.1.3 version release
Diffstat (limited to 'Example/combinational_logic/decoder/decoder.vhdl')
-rw-r--r--Example/combinational_logic/decoder/decoder.vhdl50
1 files changed, 50 insertions, 0 deletions
diff --git a/Example/combinational_logic/decoder/decoder.vhdl b/Example/combinational_logic/decoder/decoder.vhdl
new file mode 100644
index 0000000..e429ec9
--- /dev/null
+++ b/Example/combinational_logic/decoder/decoder.vhdl
@@ -0,0 +1,50 @@
+library ieee;
+use ieee.std_logic_1164.all;
+
+entity decoder is
+port (
+ p : in std_logic_vector(4 downto 0);
+ d : out std_logic_vector(31 downto 0)
+ );
+end decoder;
+
+architecture behav of decoder is
+
+begin
+
+with p select
+d<="00000000000000000000000000000001" when "00000",
+"00000000000000000000000000000010" when "00001",
+"00000000000000000000000000000100" when "00010",
+"00000000000000000000000000001000" when "00011",
+"00000000000000000000000000010000" when "00100",
+"00000000000000000000000000100000" when "00101",
+"00000000000000000000000001000000" when "00110",
+"00000000000000000000000010000000" when "00111",
+"00000000000000000000000100000000" when "01000",
+"00000000000000000000001000000000" when "01001",
+"00000000000000000000010000000000" when "01010",
+"00000000000000000000100000000000" when "01011",
+"00000000000000000001000000000000" when "01100",
+"00000000000000000010000000000000" when "01101",
+"00000000000000000100000000000000" when "01110",
+"00000000000000001000000000000000" when "01111",
+"00000000000000010000000000000000" when "10000",
+"00000000000000100000000000000000" when "10001",
+"00000000000001000000000000000000" when "10010",
+"00000000000010000000000000000000" when "10011",
+"00000000000100000000000000000000" when "10100",
+"00000000001000000000000000000000" when "10101",
+"00000000010000000000000000000000" when "10110",
+"00000000100000000000000000000000" when "10111",
+"00000001000000000000000000000000" when "11000",
+"00000010000000000000000000000000" when "11001",
+"00000100000000000000000000000000" when "11010",
+"00001000000000000000000000000000" when "11011",
+"00010000000000000000000000000000" when "11100",
+"00100000000000000000000000000000" when "11101",
+"01000000000000000000000000000000" when "11110",
+"10000000000000000000000000000000" when "11111",
+"00000000000000000000000000000000" when others;
+
+end behav;