Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Курсовая работа.doc
Скачиваний:
57
Добавлен:
01.05.2014
Размер:
469.5 Кб
Скачать

Текст устройства spad (Part4).

Entity spad is

port

(col_1, col_2 : in integer range 0 to 255;

col : out bit);

end spad;

architecture arch of spad is

begin

process (col_1, col_2)

begin

if col_1 = 1 and col_2 = 0 then

col <= '1';

else

col <= '0';

end if;

end process;

end arch;

Текст устройства Sig_Sender (Part4).

Entity Sig_Sender is

Port

(External_clk, dir, ena : in bit;

delta : in integer range 0 to 1000000;

k_vo : in integer range 0 to 255;

pausa : in integer range 0 to 10000000;

p : in integer range 0 to 200000;

dq, sig: out bit);

end Sig_Sender;

architecture arch of Sig_Sender is

begin

process (External_clk, ena, delta, k_vo, p, pausa)

variable cnt: integer :=0;

variable cnt1: integer :=0;

variable cnt2: integer :=0;

variable p1: integer := 0;

begin

p1 := 10*p;

if ena = '1' then

if External_clk'event and External_clk='1' then

cnt := cnt + 1;

dq <= '0';

if dir = '0' then

p1 := p1 + delta*cnt1;

else

p1 := p1 - delta*cnt1;

end if;

if cnt = p1 then

p1 := p1 + delta;

sig <= '1';

elsif cnt = 2*p1 then

p1 := p1 + delta;

sig <= '0';

cnt := 0;

cnt1 := cnt1 + 1;

end if;

if cnt1 >= k_vo then

sig <= '0';

cnt := 0;

cnt2 := cnt2 + 1;

if cnt2 = 5*pausa then

cnt1 := 0;

cnt2 := 0;

dq <= '1';

end if;

end if;

end if;

end if;

END PROCESS;

end arch;

Приложение 3.

Рис. пр_3.1. Временная диаграмма работы блока RS_232_Analyzer_Incoming.

Рис. пр_3.2. Временная диаграмма работы блока Part4.

Рис. пр_3.3. Временная диаграмма работы блока Part4.

Рис. пр_3.4.а Увеличенный фрагмент временной диаграммы работы блока Part4.

Рис. пр_3.4.б Увеличенный фрагмент временной диаграммы работы блока Part4.

Рис. пр_3.5. Временная диаграмма работы устройства в целом.

40