Question:

VHDL program for implementing a 3:8 decoder using behavioural modelling.

Posted by Saradwata Bandyopadhyay on 16-02-2025

Tags : Behavioral Modeling 3:8 decoder Model Sim program VHDL

Answer:

Here is the solution for the above question =>

                                      LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
USE IEEE.STD_LOGIC_ARITH.ALL;
USE IEEE.STD_LOGIC_UNSIGNED.ALL;
ENTITY decoder_3_8_behav IS
PORT(DIN:IN STD_LOGIC_VECTOR(7 DOWNTO 0);
SEL:IN STD_LOGIC_VECTOR(2 DOWNTO 0);
DOUT:OUT STD_LOGIC_VECTOR(7 DOWNTO 0)
);
END decoder_3_8_behav;
ARCHITECTURE BEHAVIORAL OF decoder_3_8_behav IS
BEGIN
PROCESS(SEL,DIN)
BEGIN
CASE SEL IS
WHEN "000"=>DOUT<="00000001";
WHEN "001"=>DOUT<="00000010";
WHEN "010"=>DOUT<="00000100";
WHEN "011"=>DOUT<="00001000";
WHEN "100"=>DOUT<="00010000";
WHEN "101"=>DOUT<="00100000";
WHEN "110"=>DOUT<="01000000";
WHEN "111"=>DOUT<="10000000";
WHEN OTHERS=>DOUT<="ZZZZZZZZ";
END CASE;
END PROCESS;
END BEHAVIORAL;

You can directly download the Source Code and the Model Sim application from the links below =>

Add a Comment

Please Login to Comment.