AMC13
Firmwares for the different applications of the AMC13 uTCA board made at Boston University
 All Classes Variables
Gray5.vhd
1 ----------------------------------------------------------------------------------
2 -- Company:
3 -- Engineer:
4 --
5 -- Create Date: 10:55:12 07/27/2014
6 -- Design Name:
7 -- Module Name: Gray5 - Behavioral
8 -- Project Name:
9 -- Target Devices:
10 -- Tool versions:
11 -- Description:
12 --
13 -- Dependencies:
14 --
15 -- Revision:
16 -- Revision 0.01 - File Created
17 -- Additional Comments:
18 --
19 ----------------------------------------------------------------------------------
20 library IEEE;
21 use IEEE.STD_LOGIC_1164.ALL;
22 
23 -- Uncomment the following library declaration if using
24 -- arithmetic functions with Signed or Unsigned values
25 --use IEEE.NUMERIC_STD.ALL;
26 
27 -- Uncomment the following library declaration if instantiating
28 -- any Xilinx primitives in this code.
29 library UNISIM;
30 use UNISIM.VComponents.all;
31 
32 entity Gray5 is
33  Port ( d_current : in STD_LOGIC_VECTOR (4 downto 0);
34  d_next : out STD_LOGIC_VECTOR (4 downto 0));
35 end Gray5;
36 
37 architecture Behavioral of Gray5 is
38 type array5x32 is array(0 to 4) of bit_vector(31 downto 0);
39 constant rom_init : array5x32 := (x"33333333",x"3c3c3c3c",x"0ff00ff0",x"00ffff00",x"ffff0000");
40 begin
41 g_d_next : for i in 0 to 4 generate
42  i_d_next : ROM32X1 generic map (INIT => rom_init(i))
43  port map (
44  O => d_next(i), -- ROM output
45  A0 => d_current(0), -- ROM address[0]
46  A1 => d_current(1), -- ROM address[1]
47  A2 => d_current(2), -- ROM address[2]
48  A3 => d_current(3), -- ROM address[3]
49  A4 => d_current(4) -- ROM address[4]
50  );
51 end generate;
52 end Behavioral;
53