------------------------------------------------------------------------- -- LOOK UP TABLE -- Author: J Dhatt -- Student ID: -- Date: -- File Name; -- Description: Creates a 15 bit loop up table for numbers 0 to 9 -- and the characters C,F as well as the symbols for degrees -- _,:,.and x ------------------------------------------------------------------------ library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all; --------------------------------------------------------------------- entity LookUpTable is generic(incounterwidth: positive:=4); port( num_from_counter: in std_logic_vector(3 downto 0); clock,reset: in std_logic; disp_value: out std_logic_vector(14 downto 0) ); end LookUpTable; -------------------------------------------------------------------- architecture behavior of LookUpTable is --signal in_number: std_logic_vector(3 downto 0); begin process(clock,reset,num_from_counter) is begin if reset ='1' then disp_value<= "010100010001010"; elsif (clock'event and clock='1') then case num_from_counter is when "0000" => disp_value <="111111000111111"; when "0001" => disp_value<= "000001111100000"; when "0010"=> disp_value<= "101111010111100";--2 when "0011" => disp_value<= "111111010110101";--3 when "0100"=> disp_value<= "111110010000111";--4 when"0101"=> disp_value<= "111011010110111";--5 when "0110"=> disp_value<= "111001010011111";--6 when"0111"=> disp_value<= "111110000100001"; --7 when"1000"=> disp_value<= "111111010111111"; when"1001"=> disp_value<= "111110010100111"; when"1010"=> disp_value<= "000000101000000"; when"1011" => disp_value<= "000110001100000"; when "1100"=> disp_value<= "100011000111111"; when"1101"=> disp_value<= "001010000111111"; when"1110"=> disp_value<= "100001000010000"; when"1111"=> disp_value<= "010100010001010"; when others=> disp_value<="010100010001010"; end case; end if; end process ; end architecture behavior;