Docsity

VHDL Decoder 3x8 Design, Exams of Digital Electronics

Toggle sidebar
bg1
library ieee;
use ieee.std_logic_1164.all;
entity decoder3x8 is port(
x,y,z: in std_logic;
d: out std_logic_vector(7 downto 0));
end decoder3x8;
architecture behavior of decoder3x8 is
begin
process (x,y,z)
begin
if (x='0'and y='0' and z='0') then
d <= "00000001";
elsif (x='0'and y='0' and z='1') then
d <= "00000010";
elsif (x='0'and y='1' and z='0') then
d <= "00000100";
elsif (x='0'and y='1' and z='1') then
d <= "00001000";
elsif (x='1'and y='0' and z='0') then
d <= "00010000";
elsif (x='1'and y='0' and z='1') then
d <= "00100000";
elsif (x='1'and y='1' and z='0') then
d <= "01000000";
elsif (x='1'and y='1' and z='1') then
d <= "10000000";
end if;
end process;
pf2

Partial preview of the text

Download VHDL Decoder 3x8 Design and more Exams Digital Electronics in PDF only on Docsity!

library ieee; use ieee.std_logic_1164.all;

entity decoder3x8 is port( x,y,z: in std_logic; d: out std_logic_vector(7 downto 0)); end decoder3x8;

architecture behavior of decoder3x8 is begin process (x,y,z) begin if (x='0'and y='0' and z='0') then d <= "00000001"; elsif (x='0'and y='0' and z='1') then d <= "00000010"; elsif (x='0'and y='1' and z='0') then d <= "00000100"; elsif (x='0'and y='1' and z='1') then d <= "00001000"; elsif (x='1'and y='0' and z='0') then d <= "00010000"; elsif (x='1'and y='0' and z='1') then d <= "00100000"; elsif (x='1'and y='1' and z='0') then d <= "01000000"; elsif (x='1'and y='1' and z='1') then d <= "10000000"; end if; end process;

end behavior;