Guest User

Untitled

a guest
Sep 10th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 1.38 KB | None | 0 0
  1. ----------------------------------------------------------------------------------
  2. -- Company:
  3. -- Engineer:
  4. --
  5. -- Create Date:    13:32:57 07/14/2012
  6. -- Design Name:
  7. -- Module Name:    ConvBCD - 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.  
  23. -- Uncomment the following library declaration if using
  24. -- arithmetic functions with Signed or Unsigned values
  25. --use IEEE.NUMERIC_STD.ALL;
  26.  
  27. -- Uncomment the following library declaration if instantiating
  28. -- any Xilinx primitives in this code.
  29. --library UNISIM;
  30. --use UNISIM.VComponents.all;
  31.  
  32. entity ConvBCD is
  33.     Port ( InputBin : in  STD_LOGIC_VECTOR (3 downto 0);
  34.            OutputBCD : out  STD_LOGIC_VECTOR (6 downto 0));
  35. end ConvBCD;
  36.  
  37. architecture Behavioral of ConvBCD is
  38.  
  39. begin
  40.  
  41. with InputBin select
  42.     OutputBCD<= "0000001" when "0000",
  43.                     "1001111" when "0001",
  44.                     "0010010" when "0010",
  45.                     "0000110" when "0011",
  46.                     "1001100" when "0100",
  47.                     "0100100" when "0101",
  48.                     "0100000" when "0110",
  49.                     "0001111" when "0111",
  50.                     "0000000" when "1000",
  51.                     "0000100" when "1001",
  52.                     "1111111" when others;
  53.                    
  54. end Behavioral;
Add Comment
Please, Sign In to add comment