[an error occurred while processing this directive]
Привет Владимир ! У меня синтезабельный модуль для этого есть. Работает замечательно.
(«Телесистемы»: Конференция «Языки описания аппаратуры (VHDL и др.))

миниатюрный аудио-видеорекордер mAVR

Отправлено Мартовский Котяра 01 августа 2004 г. 08:48
В ответ на: Генерация случайных чисел на VHDL (поведенчески) отправлено Volodymyr 30 июля 2004 г. 11:56


library IEEE;
use IEEE.STD_LOGIC_1164.all;
use IEEE.STD_LOGIC_UNSIGNED.all;

entity rand is
port(
rst : in STD_LOGIC;
msck : in std_logic;
ack : in std_logic;
do : out STD_LOGIC_VECTOR(47 downto 0);
mrq : out std_logic
);

attribute incremental_synthesis : string;
attribute resynthesize : string;
attribute incremental_synthesis of rand : entity is "yes";
attribute resynthesize of rand : entity is "no";
end rand;


architecture rand of rand is
constant mask : std_logic_vector(31 downto 0):=X"82608edb";
signal reg : std_logic_vector(31 downto 0);
signal p : std_logic;
signal shft, smsk, back : std_logic_vector(31 downto 0);
signal nxt : std_logic;


begin
--crc register
smsk<=mask when p='1' else (others=>'0');
shft(31 downto 1)<=reg(30 downto 0); shft(0)<='0';
back<=smsk xor shft;

process(rst, nxt, reg(31))
begin
if rst='1' then p<='1';
else
if nxt='0' then p<=reg(31);
end if;
end if;
end process;

process(rst, nxt)
begin
if rst='1' then reg<=X"ffffffff";
else
if nxt'event and nxt='1' then reg<=back;
end if;
end if;
end process;


process(rst, ack, msck)
begin
if (rst or ack)='1' then mrq<='0';
else
if msck'event and msck='1' then mrq<='1';
end if;
end if;
end process;

nxt<=not ack;

do(31 downto 0)<=reg;
do(47 downto 32)<=X"cafe";


end rand;

Составить ответ  |||  Конференция  |||  Архив

Ответы


Отправка ответа

Имя (обязательно): 
Пароль: 
E-mail: 

Тема (обязательно):
Сообщение:

Ссылка на URL: 
Название ссылки: 

URL изображения: 


Перейти к списку ответов  |||  Конференция  |||  Архив  |||  Главная страница  |||  Содержание  |||  Без кадра

E-mail: info@telesys.ru