-
Notifications
You must be signed in to change notification settings - Fork 1
/
S_seg.vhd
30 lines (28 loc) · 863 Bytes
/
S_seg.vhd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
library IEEE;
use IEEE.std_logic_1164.all;
--Codigo de siete segmentos
entity S_seg is
port(
b : in std_logic_vector (3 downto 0); --Numero de 0 a 9 que se introduce
s : out std_logic_vector(6 downto 0) --Codigo siete segmentos de output
);
end S_seg;
architecture behavior of S_seg is
begin
process(b)
begin
case (b) is
when "0000" => s<="1000000";
when "0001" => s<="1111001";
when "0010" => s<="0100100";
when "0011" => s<="0110000";
when "0100" => s<="0011001";
when "0101" => s<="0010010";
when "0110" => s<="0000010";
when "0111" => s<="1111000";
when "1000" => s<="0000000";
when "1001" => s<="0011000";
when others => s<="1111111";
end case;
end process;
end behavior;