Advertisement
fellpz

Display 7 segmentos

Mar 17th, 2017
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 1.05 KB | None | 0 0
  1. library IEEE;
  2. use IEEE.std_logic_1164.all; -- biblioteca do IEEE
  3.  
  4.  
  5.     entity ontoin1703 is port
  6.         (
  7.             bar : out std_logic_vector(6 downto 0);
  8.             clk : in std_logic
  9.  
  10.         );
  11.     end ontoin1703;
  12.  
  13.  
  14.         architecture hardware of ontoin1703 is
  15.  
  16.         begin
  17.              
  18.             process(clk)  
  19.        
  20.                 variable counter : integer range 0 to 10;
  21.        
  22.         begin
  23.        
  24.             if(clk = '1') then
  25.  
  26.                 counter := counter + 1;
  27.                
  28.                 if(counter = 10) then
  29.                    
  30.                     counter := 0;
  31.                    
  32.                 end if;
  33.                
  34.             end if;
  35.            
  36.            
  37.             case counter is
  38.                
  39.                 when 0 => bar <= "1111110";
  40.                 when 1 => bar <= "0110000";
  41.                 when 2 => bar <= "1101101";
  42.                 when 3 => bar <= "1111001";
  43.                 when 4 => bar <= "0110011";
  44.                 when 5 => bar <= "1011011";
  45.                 when 6 => bar <= "1011111";
  46.                 when 7 => bar <= "1110000";
  47.                 when 8 => bar <= "1111111";
  48.                 when 9 => bar <= "1111011";
  49.                 when others => bar <= "0000000";
  50.            
  51.             end case;
  52.            
  53.             end process;
  54.                
  55.         end hardware;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement