summaryrefslogtreecommitdiff
path: root/Example/bin_to_gray/bin_to_gray.vhdl
blob: d6045e883ea46de27164f088ee1622a961882fee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;

entity bin_to_gray is
port(   
		bin : in std_logic_vector(3 downto 0); 
        G   : out std_logic_vector(3 downto 0)
    );
end bin_to_gray;


architecture gate_level of bin_to_gray is 

begin

G(3) <= bin(3);
G(2) <= bin(3) xor bin(2);
G(1) <= bin(2) xor bin(1);
G(0) <= bin(1) xor bin(0);

end gate_level;