Tuesday, December 15, 2020

Program for 8:3 Encoder using VHDL behavioral modeling.

--Program for 8 to 3 Encoder using VHDL behavioral modeling.

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;


For Safe Downloading of ModelSim (32/64 bit) please visit :-

For Safe Downloading of this program file please visit :-

Labels: , , , ,

0 Comments:

Post a Comment

Please feel free to ask your questions

Subscribe to Post Comments [Atom]

<< Home