Question:

Program for 8:3 Encoder using VHDL behavioral modeling.

Posted by Saradwata Bandyopadhyay on 01-03-2025

Tags : Behavioral Modeling 8:3 Encoder 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 behav_encoder_8_3 is
port(
din : in STD_LOGIC_VECTOR(7 downto 0);
dout : out STD_LOGIC_VECTOR(2 downto 0));
end behav_encoder_8_3;
architecture Behavioral of behav_encoder_8_3 is
begin
process(din)
begin
if (din="10000000")then
dout <= "000";
elsif(din="01000000")then
dout <= "001";
elsif(din="00100000")then
dout <= "010";
elsif(din="00010000")then
dout <= "011";
elsif(din="00001000")then
dout <= "100";
elsif(din="00000100")then
dout <= "101";
elsif(din="00000010")then
dout <= "110";
else dout <= "111";
end if;
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.