Advertisement
Guest User

Untitled

a guest
Nov 28th, 2014
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 1.34 KB | None | 0 0
  1.  
  2. library IEEE;
  3. use IEEE.STD_LOGIC_1164.ALL;
  4.  
  5. -- Uncomment the following library declaration if using
  6. -- arithmetic functions with Signed or Unsigned values
  7. --use IEEE.NUMERIC_STD.ALL;
  8.  
  9. -- Uncomment the following library declaration if instantiating
  10. -- any Xilinx primitives in this code.
  11. --library UNISIM;
  12. --use UNISIM.VComponents.all;
  13.  
  14. entity liczbaWith is
  15.     port(
  16.        X : in STD_LOGIC_VECTOR( 3 downto 0 );
  17.         Y : out  STD_LOGIC_VECTOR  ( 9 downto 0 ));
  18.  
  19. end liczbaWith;
  20.  
  21.  
  22. architecture Behavioral of liczbaWith is
  23. begin
  24.  
  25.    
  26. with X Select
  27.                Y(0) <= '1' when "0001",
  28.                     '0' when others;
  29.  
  30.  
  31. with X Select
  32.                Y(1) <= '1' when "0010",
  33.                     '0' when others;
  34. with X Select
  35.                Y(2) <= '1' when "0011",
  36.                     '0' when others;
  37. with X Select
  38.                Y(3) <= '1' when "0100",
  39.                     '0' when others;
  40. with X Select
  41.                Y(4) <= '1' when "0101",
  42.                     '0' when others;
  43. with X Select
  44.                Y(5) <= '1' when "0110",
  45.                     '0' when others;
  46. with X Select
  47.                Y(6) <= '1' when "0111",
  48.                     '0' when others;
  49. with X Select
  50.                Y(7) <= '1' when "1000",
  51.                     '0' when others;
  52. with X Select
  53.                Y(8) <= '1' when "1001",
  54.                     '0' when others;
  55. with X Select
  56.                Y(9) <= '1' when "1010",
  57.                     '0' when others;
  58.    
  59.    
  60.      
  61.      
  62. end Behavioral;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement