HP_Card_Disp.vhd

----------------------------------------------
--					HP_Card_Disp			--
--Function: This program displays only the  --
--first card of the House Player.			--
----------------------------------------------

--IEEE Library Functions
LIBRARY ieee;
USE ieee.std_logic_1164.all;

ENTITY HP_Card_Disp IS
PORT
	(
		Clk 		: IN STD_LOGIC;		--Gobal Clock		
		Reset		: IN STD_LOGIC;		--Global Reset
		HP_Accept	: IN STD_LOGIC;		--Accept signal for HP
		Card		: IN STD_LOGIC_VECTOR (3 downto 0);	--Card from Card Generator
		HP_Open_Card: OUT STD_LOGIC_VECTOR (3 downto 0) --House Player Card
	);
	
END HP_Card_Disp;

ARCHITECTURE HP_Card_Disp_arch OF HP_Card_Disp IS
SIGNAL	Temp : STD_LOGIC;
BEGIN
	--Used to display the house card
	HP_Card_Display: PROCESS (Clk, Reset, HP_Accept, Temp)
	BEGIN
		if (Reset='1') then
			HP_Open_Card <= (others => '0');
		elsif (CLK'event and CLK='1') then
			--If there is an accept for house player
			--and it is the first time then display the card
			if ((HP_Accept = '1') AND (Temp = '0')) then
				HP_Open_Card <= Card;
				Temp <= '1';
			else
				NULL;
			end if;
		end if;
	END PROCESS;
END HP_Card_Disp_arch;