Guest User

Untitled

a guest
Sep 16th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 0.81 KB | None | 0 0
  1. architecture SYNTHESIS of DESIGN is
  2.     type STATE_TYPE is (..);
  3.     signal STATE: STATE_TYPE;
  4.  
  5.     signal COUNTER: UNSIGNED(..);
  6.     signal ROW, COLUMN: UNSIGNED(..);
  7. begin
  8.  
  9.     process (CLOCK) is
  10.     begin
  11.         if rising_edge(CLOCK) then
  12.             case STATE is
  13.                 when Z1 =>
  14.                     STATE <= Z2;
  15.                     COUNTER <= 100;
  16.  
  17.  
  18.                 when Z2 =>
  19.                     if to_integer(COUNTER) = 0 then
  20.                         ROW <= to..(0);
  21.                         COLUMN <= to..(0);
  22.                         STATE <= Z3;
  23.                     else
  24.                         COUNTER <= COUNTER -1;
  25.                     end if;
  26.  
  27.  
  28.                 when Z3 =>
  29.                     if to_integer(COLUMN) = ..max.. then
  30.                         if to_integer(ROW) = ..max.. then
  31.                             STATE <= Z1;
  32.                         else
  33.                             -- Next row
  34.                             ROW <= ROW + 1;
  35.                         end if;
  36.                     else
  37.                         -- Scan pixel
  38.                         COLUMN <= COLUMN + 1;
  39.                     end if;
  40.             end case;
  41.         end if;
  42.     end process;
  43.  
  44. end architecture SYNTHESIS;
Add Comment
Please, Sign In to add comment