Advertisement
Guest User

Untitled

a guest
Dec 10th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 2.37 KB | None | 0 0
  1. -------------------------------------------------------------------------------
  2. --
  3. -- Title       : Fub3
  4. -- Design      : szymik_krawczyk
  5. -- Author      :
  6. -- Company     :
  7. --
  8. -------------------------------------------------------------------------------
  9. --
  10. -- File        : C:\My_Designs\szymik_krawczyk\szymik_krawczyk\src\Fub3.vhd
  11. -- Generated   : Mon Nov 26 10:33:03 2018
  12. -- From        : interface description file
  13. -- By          : Itf2Vhdl ver. 1.22
  14. --
  15. -------------------------------------------------------------------------------
  16. --
  17. -- Description :
  18. --
  19. -------------------------------------------------------------------------------
  20.  
  21. --{{ Section below this comment is automatically maintained
  22. --   and may be overwritten
  23. --{entity {Fub3} architecture {Fub3}}
  24.  
  25. library IEEE;
  26. use IEEE.STD_LOGIC_1164.all;
  27. use IEEE.numeric_std.all;
  28.  
  29. entity Fub3 is
  30. port(
  31.     n : in STD_LOGIC_VECTOR(3 downto 0);
  32.     cyfra : out STD_LOGIC_VECTOR(6 downto 0)
  33.     );
  34.          
  35. attribute LOC :string;
  36. attribute LOC of cyfra : signal is "P35 P36 P37 P38 P31 P30 P29";
  37.      
  38. end Fub3;
  39.  
  40. --}} End of automatically maintained section
  41.  
  42. architecture Fub3 of Fub3 is
  43. begin
  44.     process (n) is                                                      --początek procesu z listą czułości
  45.     variable    dana    : std_logic_vector (3 downto 0) := "0000";      --deklaracja zmiennych
  46.     variable    cyfra1  : std_logic_vector (6 downto 0) := "0000000";
  47.     begin                                                               --początek procesu z listą czułości
  48.         dana (0) := n(3);                                               --założenie czterech neiezależnych linii
  49.         dana (1) := n(2);                                               --w jeden czterobitowy wektor "dana"
  50.         dana (2) := n(1);
  51.         dana (3) := n(0);
  52.        
  53.         if      dana = "0000" then cyfra1 := "0000001";                 --uruchomienie dekodera
  54.         elsif   dana = "0001" then cyfra1 := "1001111";                 --kodu BCD / 7seg.
  55.         elsif   dana = "0010" then cyfra1 := "0010010";
  56.         elsif   dana = "0011" then cyfra1 := "0000110";
  57.         elsif   dana = "0100" then cyfra1 := "1001100";
  58.         elsif   dana = "0101" then cyfra1 := "0100100";
  59.         elsif   dana = "0110" then cyfra1 := "0100000";
  60.         elsif   dana = "0111" then cyfra1 := "0001111";
  61.         elsif   dana = "1000" then cyfra1 := "0000000";
  62.         elsif   dana = "1001" then cyfra1 := "0000100";      
  63.         else    cyfra1 := "0000000";
  64.         end if;  
  65.        
  66.     cyfra <= std_logic_vector (cyfra1);                                 --wyprowadzenie danych z dekodera
  67.                                                                         --kodu BCD / 7seg. na port wyjściowy
  68.     end process;
  69.  
  70. end Fub3;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement