-- Decoder for a segment
-- The decoder has a four-bit
-- input that encodes a numberic digit between 0 and 9.
-- There are seven outputs indexed from 'a' through 'g', corresponding
-- to the seven segments of the LED display.  An output bit
-- being '1' causes the segment to light.
--     
--     ___a
--    |   |
--   f|___|b
--    | g |
--   e|___|c
--      d
--


LIBRARY ieee;  USE ieee.std_logic_1164.all;

ARCHITECTURE spec OF segdecode IS
BEGIN
   p1 : process (bcd) is
      variable out_digit : std_logic_vector (6 downto 0);
   begin
        case bcd is
           when "0000" => out_digit := "1111110";
           when "0001" => out_digit := "0110000";
           when "0010" => out_digit := "1101101";
           when "0011" => out_digit := "1111001";
           when "0100" => out_digit := "0110011";
           when "0101" => out_digit := "1011011";
           when "0110" => out_digit := "1011111";
           when "0111" => out_digit := "1110000";
           when "1000" => out_digit := "1111111";
           when "1001" => out_digit := "1110011";
           when others => out_digit := "0000000";
         end case;
         seven_seg <= out_digit;
   end process p1;
END spec ;
<div align="center"><br /><script type="text/javascript"><!--
google_ad_client = "pub-7293844627074885";
//468x60, Created at 07. 11. 25
google_ad_slot = "8619794253";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script><br />&nbsp;</div>