Advertisement
Guest User

Untitled

a guest
Jan 15th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 1.31 KB | None | 0 0
  1. ----------------------------------------------------------------------------------
  2. -- Company:
  3. -- Engineer:
  4. --
  5. -- Create Date:    11:39:15 01/15/2019
  6. -- Design Name:
  7. -- Module Name:    picture1 - Behavioral
  8. -- Project Name:
  9. -- Target Devices:
  10. -- Tool versions:
  11. -- Description:
  12. --
  13. -- Dependencies:
  14. --
  15. -- Revision:
  16. -- Revision 0.01 - File Created
  17. -- Additional Comments:
  18. --
  19. ----------------------------------------------------------------------------------
  20. library IEEE;
  21. use IEEE.STD_LOGIC_1164.ALL;
  22.  
  23. -- Uncomment the following library declaration if using
  24. -- arithmetic functions with Signed or Unsigned values
  25. use IEEE.NUMERIC_STD.ALL;
  26.  
  27. -- Uncomment the following library declaration if instantiating
  28. -- any Xilinx primitives in this code.
  29. --library UNISIM;
  30. --use UNISIM.VComponents.all;
  31.  
  32. entity picture1 is
  33.     Port ( PIX_X : in  STD_LOGIC_VECTOR (9 downto 0);
  34.            PIX_Y : in  STD_LOGIC_VECTOR (8 downto 0);
  35.            RGB : out  STD_LOGIC_VECTOR (2 downto 0));
  36. end picture1;
  37.  
  38. architecture Behavioral of picture1 is
  39. begin
  40.    
  41.     -- Static picture:
  42.     -- left side is RED ("100")
  43.     -- right side is BLUE ("001")
  44.     get_color : process(PIX_X, PIX_Y)
  45.     begin
  46.         if (PIX_X < 320) then
  47.             RGB <= "100";
  48.         else
  49.             RGB <= "001";
  50.         end if;
  51.     end process get_color;
  52.    
  53. end Behavioral;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement