Advertisement
Guest User

Untitled

a guest
Jun 28th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 0.99 KB | None | 0 0
  1.  
  2. library IEEE;
  3. use IEEE.STD_LOGIC_1164.all;
  4. use IEEE.STD_LOGIC_UNSIGNED.all; -- dodatkowa biblioteka
  5.  
  6. ------------------------------------------------------------
  7. entity cw09z1_df3 is
  8.     port (x : in  std_logic_vector (1 to 5);
  9.             y : out  std_logic);
  10. end cw09z1_df3;
  11.  
  12. ------------------------------------------------------------
  13. -- architektura df3 - styl przepływowy (DataFlow)
  14. -- opis za pomocą tablicy (tabela prawdy funkcji f5)
  15. -- z wykorzystaniem stałej typu STD_LOGIC_VECTOR
  16.  
  17. architecture df3 of cw09z1_df3 is
  18.  
  19.     constant f : std_logic_vector (0 to 31)
  20.             := "10000100001000110010000001101100";
  21. --              AĄCBĘEĆDFGIHŁLJKŚTWUŻŹYZMNOŃSRÓP
  22.  
  23. begin
  24.  
  25.    y <= f(CONV_INTEGER(x));
  26.  
  27. --        CONV_INTEGER     jest funkcją służącą do konwersji
  28. -- wektora na liczbę całkowitą (STD_LOGIC_VECTOR to INTEGER)
  29. -- wymagana jest deklaracja biblioteki IEEE.STD_LOGIC_UNSIGNED
  30.  
  31. end df3;
  32.  
  33. ----------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement