Professional Documents
Culture Documents
use IEEE.STD_LOGIC_1164.ALL;
entity decoder2_4 is
end decoder2_4;
begin
process(I)
begin
case I is
when "00"=>D<="0001";
when "01"=>D<="0010";
when "10"=>D<="0100";
when "11"=>D<="1000";
when others=>NULL;
end case;
end process;
end Behavioral;
output
When Input is 00
When Input is 01
When Input is 10
When Input is 11
Experiment 4
To design and simulate a binary to gray
code converter?
Source Code
entity B2G is
end B2G;
begin
dout(3)<=din(3);
end Behavioral;
Output
Gray code of binary 0000 is
Gray code of binary 0010 is