From 332194039338f53d7b9feb2c34ecd70e3a569bf3 Mon Sep 17 00:00:00 2001 From: Leo Lemaire Date: Wed, 15 Dec 2021 18:36:09 +0000 Subject: [PATCH] Upload New File --- sources_snake/GeneRGB_V1.vhd | 66 ++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 sources_snake/GeneRGB_V1.vhd diff --git a/sources_snake/GeneRGB_V1.vhd b/sources_snake/GeneRGB_V1.vhd new file mode 100644 index 0000000..653b7d1 --- /dev/null +++ b/sources_snake/GeneRGB_V1.vhd @@ -0,0 +1,66 @@ +---------------------------------------------------------------------------------- +-- Company: +-- Engineer: +-- +-- Create Date: 19.10.2017 08:16:09 +-- Design Name: +-- Module Name: GeneRGB_V1 - Behavioral +-- Project Name: +-- Target Devices: +-- Tool Versions: +-- Description: +-- +-- Dependencies: +-- +-- Revision: +-- Revision 0.01 - File Created +-- Additional Comments: +-- +---------------------------------------------------------------------------------- + + +library IEEE; +use IEEE.STD_LOGIC_1164.ALL; + +-- Uncomment the following library declaration if using +-- arithmetic functions with Signed or Unsigned values +use IEEE.NUMERIC_STD.ALL; + +-- Uncomment the following library declaration if instantiating +-- any Xilinx leaf cells in this code. +--library UNISIM; +--use UNISIM.VComponents.all; + +entity GeneRGB_V1 is + Port ( X : in unsigned (9 downto 0); + Y : in unsigned (8 downto 0); + IMG : in STD_LOGIC; + R : out STD_LOGIC_VECTOR (4 downto 0); + G : out STD_LOGIC_VECTOR (5 downto 0); + B : out STD_LOGIC_VECTOR (4 downto 0); + snakePresent : in std_logic); +end GeneRGB_V1; + +architecture Behavioral of GeneRGB_V1 is + +begin + +process(X,Y,IMG,snakePresent) + begin + if (IMG='0') then + R<=(others=>'0'); + B<=(others=>'0'); + G<=(others=>'0'); + elsif ( snakePresent = '1' ) then + R<=(others=>'1'); + B<=(others=>'1'); + G<=(others=>'1'); + else + R<=(others=>'0'); + B<=(others=>'0'); + G<=(others=>'0'); + end if; + + end process; + +end Behavioral;