Advertisement
Guest User

Fixed

a guest
Nov 21st, 2014
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 2.06 KB | None | 0 0
  1. ----------------------------------------------------------------------------------
  2. -- Company:
  3. -- Engineer:
  4. --
  5. -- Create Date:    17:59:53 11/20/2014
  6. -- Design Name:
  7. -- Module Name:    Modul - Behavioral
  8. -- Project Name:
  9. -- Target Devices:
  10. -- Tool versions:
  11. -- Description:
  12. --
  13. -- Dependencies:
  14. --
  15. -- Revision:
  16. -- Revision 0.01 - File Created
  17. -- Additional Comments:
  18. --
  19. ----------------------------------------------------------------------------------
  20. library IEEE;
  21. use IEEE.STD_LOGIC_1164.ALL;
  22. use IEEE.STD_LOGIC_UNSIGNED.ALL;
  23.  
  24. -- Uncomment the following library declaration if using
  25. -- arithmetic functions with Signed or Unsigned values
  26. --use IEEE.NUMERIC_STD.ALL;
  27.  
  28. -- Uncomment the following library declaration if instantiating
  29. -- any Xilinx primitives in this code.
  30. --library UNISIM;
  31. --use UNISIM.VComponents.all;
  32.  
  33. entity Modul is
  34.     Port ( iSEL : in  STD_LOGIC_VECTOR (1 downto 0);
  35.            iA : in  STD_LOGIC_VECTOR (7 downto 0);
  36.               oY : out  STD_LOGIC_VECTOR (1 downto 0)
  37.             );
  38. end Modul;
  39.  
  40. architecture Behavioral of Modul is
  41.  
  42. -- Izlazi iz DEMUXa
  43. signal sDLL, sDLD, sDAL, sDAD: STD_LOGIC_VECTOR(7 downto 0) := (others => '0');
  44.  
  45. -- Izlazi iz pomjeraca
  46. signal sDLL1, sDLD1, sDAL1, sDAD1: STD_LOGIC_VECTOR(7 downto 0);
  47.  
  48. begin
  49.  
  50.    
  51.     --process(iSEL, iA) begin
  52.         sDLL <= iA when (iSEL = "00") else (others => '0');
  53.         sDLD <= iA when (iSEL = "01") else (others => '0');
  54.         sDAL <= iA when (iSEL = "10") else (others => '0');
  55.         sDAD <= iA when (iSEL = "11") else (others => '0');    
  56.     --end process;
  57.  
  58.     -- Ovo mozda ne bi bilo lose razdvojiti po procesima
  59.     process (sDLL, sDLD, sDAL, sDAD) begin
  60.         sDLL1 <= sDLL(6 downto 0) & '0';
  61.         sDLD1 <= '0' & sDLD(7 downto 1);
  62.         sDAL1 <= sDAL(7) & sDAL(5 downto 0) & '0';
  63.         sDAD1 <= sDAD(7) & '0' & sDAD(7 downto 2);
  64.     end process;
  65.    
  66.     -- Koder
  67.     process (sDLL1, sDLD1, sDAL1, sDAD1) begin
  68.         if (not (sDLL1 = 0)) then
  69.             oY <= "00";
  70.         elsif (not (sDLD1 = 0)) then
  71.             oY <= "01";
  72.         elsif (not (sDAL1 = 0)) then
  73.             oY <= "10";
  74.         else
  75.             oY <= "11";
  76.         end if;
  77.     end process;
  78. end Behavioral;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement