Kosyas41
Member level 3
Hello,
Im faced with problem how to write mapper.The main purpose of this mapper is produce packages which looks like [000001data1data1data1data1 ....00000].Data I can get from PRBS with the next code
the total length of one package from mapper is 512.Could you pls give me some help with this task
Im faced with problem how to write mapper.The main purpose of this mapper is produce packages which looks like [000001data1data1data1data1 ....00000].Data I can get from PRBS with the next code
Code:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity random is
generic ( width : integer := 32 );
port (
clk : in std_logic;
random_num : out std_logic_vector (width-1 downto 0) --output vector
);
end random;
architecture Behavioral of random is
begin
process(clk)
variable rand_temp : std_logic_vector(width-1 downto 0):=(width-1 => '1',others => '0');
variable temp : std_logic := '0';
begin
if(rising_edge(clk)) then
temp := rand_temp(width-1) xor rand_temp(width-2);
rand_temp(width-1 downto 1) := rand_temp(width-2 downto 0);
rand_temp(0) := temp;
end if;
random_num <= rand_temp;
end process;
end;