B-Matt

VHDL - 7 Segment Display

Mar 26th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 0.62 KB | None | 0 0
  1. --- Author: Matej Arlović, 2018.
  2. library IEEE;
  3. use IEEE.STD_LOGIC_1164.ALL;
  4.  
  5. entity bcd_segment is
  6.     port(
  7.         code: in std_logic_vector(3 downto 0);
  8.         led: out std_logic_vector(6 downto 0)
  9.     );
  10. end bcd_segment;
  11.  
  12. architecture Behavioral of bcd_segment is
  13. begin
  14.     with code select
  15.         led <=
  16.             "0000001" when "0000",
  17.             "1111001" when "0001",
  18.             "0010010" when "0010",
  19.             "0000110" when "0011",
  20.             "1001100" when "0100",
  21.             "0100100" when "0101",
  22.             "0100000" when "0110",
  23.             "0001111" when "0111",
  24.             "0000000" when "1000",
  25.             "0000100" when "1001",
  26.             "0001000" when "1010",
  27.             "1111110" when others;
  28. end Behavioral;
Advertisement
Add Comment
Please, Sign In to add comment