sreevenkjan
Full Member level 5
- Joined
- Nov 4, 2013
- Messages
- 268
- Helped
- 27
- Reputation
- 54
- Reaction score
- 26
- Trophy points
- 1,308
- Location
- Germany
- Activity points
- 3,115
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_unsigned.all;
use IEEE.STD_LOGIC_arith.all;
-- Entity Declaration
ENTITY MC1362LUT IS
GENERIC
(
n : INTEGER := 1
);
PORT
(
data_in : IN STD_LOGIC_VECTOR(n*(10-1) downto 0);
clk : IN STD_LOGIC;
rst : IN STD_LOGIC;
f_val_in : IN STD_LOGIC;
l_val_in : IN STD_LOGIC;
d_val_in : IN STD_LOGIC;
f_val_out: OUT STD_LOGIC;
l_val_out: OUT STD_LOGIC;
d_val_out: OUT STD_LOGIC;
data_out : OUT STD_LOGIC_VECTOR(n*(10-1) downto 0)
);
END MC1362LUT;
-- Architecture of LUT
ARCHITECTURE behav of MC1362LUT IS
COMPONENT rom
PORT (
address : IN STD_LOGIC_VECTOR (9 DOWNTO 0);
clock : IN STD_LOGIC ;
q : OUT STD_LOGIC_VECTOR (9 DOWNTO 0)
);
END COMPONENT;
signal address : STD_LOGIC_VECTOR(9 downto 0); -- address depth = 1024
BEGIN
-- instantiating rom
rom_lut : rom
port map(
address => address,
clock => clk,
q => data_out
);
lut : process(clk,rst)
BEGIN
if rst = '1' then
address <= "0000000000";
elsif rising_edge(clk) then
--address <= address + "1";
address <= data_in;
end if;
end process;
f_val_out <= f_val_in;
l_val_out <= l_val_in;
d_val_out <= d_val_in;
END behav;
lut : process(clk,rst)
BEGIN
if rst = '1' then
address <= "0000000000";
elsif rising_edge(clk) then
address <= data_in;
end if;
end process;
rom_lut : rom
port map (
address => address,
clock => clk,
q => data_out
);
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?