langs a-z
This commit is contained in:
parent
db842d013d
commit
d066446780
11389 changed files with 98361 additions and 1020 deletions
14
Task/Gray-code/VHDL/gray-code-1.vhdl
Normal file
14
Task/Gray-code/VHDL/gray-code-1.vhdl
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
LIBRARY ieee;
|
||||
USE ieee.std_logic_1164.all;
|
||||
|
||||
entity b2g is
|
||||
port( bin : in std_logic_vector (4 downto 0);
|
||||
gray : out std_logic_vector (4 downto 0)
|
||||
);
|
||||
end b2g ;
|
||||
|
||||
architecture rtl of b2g is
|
||||
constant N : integer := bin'high;
|
||||
begin
|
||||
gray <= bin(n) & ( bin(N-1 downto 0) xor bin(N downto 1));
|
||||
end architecture rtl;
|
||||
Loading…
Add table
Add a link
Reference in a new issue