[an error occurred while processing this directive] [an error occurred while processing this directive]
Ответ:
(«Телесистемы»: Конференция «Языки описания аппаратуры (VHDL и др.))
[an error occurred while processing this directive] [an error occurred while processing this directive]

Отправлено -=Sergei=- 17 мая 2002 г. 13:25
В ответ на: Подскажите Христа ради... отправлено Виктор 17 мая 2002 г. 12:07

-- 4-bit synchronous counter with count enable, asynchronous reset and synchronous load
-- The STD_LOGIC_UNSIGNED package alow to do arithmetical opertions on INTEGER and STD_LOGIC_VECTOR's

library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.STD_LOGIC_UNSIGNED.all;

-- CLK: in STD_LOGIC;
-- RESET: in STD_LOGIC;
-- CE: in STD_LOGIC;
-- LOAD: in STD_LOGIC;
-- DIR: in STD_LOGIC;
-- DIN: in STD_LOGIC_VECTOR (3 downto 0);
-- COUNT: out STD_LOGIC_VECTOR (3 downto 0)


signal COUNT_INT: STD_LOGIC_VECTOR(3 downto 0);
begin
process (CLK, RESET)
begin
if RESET = '1' then
COUNT_INT <= (others => '0');
elsif CLK'event and CLK='1' then
if LOAD = '1' then
COUNT_INT <= DIN;
else
if CE = '1' then
if DIR = '1' then --count up
COUNT_INT <= COUNT_INT + 1;
else --count down
COUNT_INT <= COUNT_INT - 1;
end if;
end if;
end if;
end if;
COUNT <= COUNT_INT;
end process;

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

Ответы


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

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

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

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

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


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

E-mail: info@telesys.ru