-----------------------------------------------------------------------------------------------------
--File: int2display
--Author: 	Jarod Crivelli Robert Ross (c) 2004
--Purpose: 	Returns the binary value to output for a particular digit
--Inputs:	int: the integer to convert
--		decimalP: If a decimal point is on or off
--Outputs:	Display: The output to display
-----------------------------------------------------------------------------------------------------

library ieee;
use ieee.std_logic_1164.all;

entity int2display is port(	
	int	:	in integer range 0 to 10;
	decimalP:	in std_logic;	--on if 1
	display	:	buffer std_logic_vector(7 downto 0));
end int2display;

architecture behav of int2display is
begin
process 
begin
	case int is
	 	when 0 => display <= "00000011" and ("1111111" & not decimalP);
		when 1 => display <= "10011111" and ("1111111" & not decimalP);
		when 2 => display <= "00100101" and ("1111111" & not decimalP);
		when 3 => display <= "00001101" and ("1111111" & not decimalP);
		when 4 => display <= "10011001" and ("1111111" & not decimalP);	
		when 5 => display <= "01001001" and ("1111111" & not decimalP);	
		when 6 => display <= "01000001" and ("1111111" & not decimalP);	
		when 7 => display <= "00011111" and ("1111111" & not decimalP);	
		when 8 => display <= "00000001" and ("1111111" & not decimalP);	
		when 9 => display <= "00011001" and ("1111111" & not decimalP);	
		when others => display <= "11111111";
	end case;
end process;
end behav;


