Текст программной части на VHDL, страница 6

if (counter1 < 2560) then                                                                 --не загрузили весь Blue

for i in 0 downto 7 loop

WaterMark(counter1+i) := LOADPIC(i);

end loop;

NEXTCOLOR <= '0';

BRStore(counter1):= LOADPIC;

Counter1 := Counter1 + 1;

else

NEXTCOLOR <= '1';       --можно вызывать функцию  WaveletGS

FlagReg(1)  := '1';

Counter1 := 0;

end if;         

elsif  (CONTROL = 5) then                                     -- вызов функции вейвлет преобразования     

if (FlagReg(4) = '1') and (FlagReg(3) = '1') and (FlagReg(2) = '1') and (FlagReg(1) = '1') then

-- все цвета загружены? (и цвз)

if (FlagReg(5) = '0') then                                                               -- Кодирование Red

WaveletGS ( ("01"),256);

WaveletGS ( ("01"),128);

FlagReg(5) := '0';

elsif       (FlagReg(6) = '0') then                                  -- Кодирование Green

WaveletGS ( ("10"),256);

WaveletGS ( ("10"),128);

FlagReg(6) := '0';

elsif       (FlagReg(7) = '0') then                                   -- Кодирование Blue

WaveletGS ( ("11"),256);

WaveletGS ( ("11"),128);

FlagReg(7) := '0'; 

elsif       (FlagReg(8) = '0') then                                   --Ввод ЦВЗ

PutSign(1);

FlagReg(8) := '0';   

elsif       (FlagReg(9) = '0') then                                  -- Раскодирование Red

WaveletGS ( ("01"),256);

WaveletGS ( ("01"),128);

FlagReg(9) := '0';

elsif       (FlagReg(10) = '0') then                                -- Раскодирование Green

WaveletGS ( ("10"),256);

WaveletGS ( ("10"),128);

FlagReg(10) := '0';

elsif       (FlagReg(11) = '0') then                                 -- Раскодирование Blue

WaveletGS ( ("11"),256);

WaveletGS ( ("11"),128);

FlagReg(11) := '0';

end if;  

else                                                                                                -- не все цвета загружены  ! ошибка!

FlagReg(0)  := '1';                                                                        -- признак ошибки во флаговый регистр

ERROR <= '0';                                                                            -- сигнал об ошибке на выход

end if;

elsif  (CONTROL = 6) and (FlagReg(12)  = '0') and (OUTBUSY = '1') then – Выгрузка Red  

if (counter1 < 65536) then                                                    --не выгрузили весь Red

UNLOAD <= '0';

UNLOADPIC <= RRStore(counter1);

Counter1 := Counter1 + 1;

else

UNLOAD <= '1';                                            -- выгрузили можно выгружать Green

FlagReg(12)  := '1';

Counter1 := 0;

end if;

elsif  (CONTROL = 7) and (FlagReg(13)  = '0') and (OUTBUSY = '1') then – Выгрузка Green

if (counter1 < 65536) then                                                    --не выгрузили весь Green

UNLOAD <= '0';

UNLOADPIC <= GRStore(counter1);

Counter1 := Counter1 + 1;

else

UNLOAD <= '1';                                            -- выгрузили можно выгружать Blue

FlagReg(13)  := '1';

Counter1 := 0;

end if;

elsif  (CONTROL = 8) and (FlagReg(14)  = '0') and (OUTBUSY = '1') then -- Выгрузка Blue 

if (counter1 < 65536) then                                                    --не выгрузили весь Blue

UNLOAD <= '0';

UNLOADPIC <= GRStore(counter1);

Counter1 := Counter1 + 1;

else

UNLOAD <= '1';                                            -- все выгрузили

FlagReg(14)  := '1';

Counter1 := 0;

end if;                                                                          

end if;                                                                                        

end if;                                                                                                           -- конец главного If (RESET, CLK)

INBUSY <= '1';                                                                                           -- Снимаем занятость

end process;

end MAIN;