forked from pablo96ms/TRABAJO-SED
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRefresh_displays.vhd
67 lines (43 loc) · 1.57 KB
/
Refresh_displays.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
use library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use std.textio.all;
use ieee.std_logic_textio.all;
Entity display_refresh is
Port (
clk: IN std_logic; -- clk de más o menos 60 Hz o más
pta_display_1, pta_display_2, pta_display_3, pta_display_4: IN std_logic_vector(6 downto 0);
destino_display: IN std_logic_vector(6 downto 0);
Piso_actual_display: IN std_logic_vector(6 downto 0);
display_selector: OUT std_logic_vector(5 downto 0);
display_number: OUT std_logic_vector(6 downto 0)
);
End entity;
Architecture Behavioral of display_refresh is
Begin
selec_show_displays: process (clk, pta_display_1, pta_display_2, pta_display_3, pta_display_4, destino_display,Piso_actual_display) --Todas las entradas, aunque no se si bastaría con clk
variable count: integer range 0 to 5;
Begin
if (rising_edge(clk)) then
if (count = 5) then
count := 0;
else
count := count +1;
end if;
end if;
Case count is
when 0 => display_selector <= "000001";
display_number <= pta_display_4;
when 1 => display_selector <= "000010";
display_number <= pta_display_2;
when 2 => display_selector <= "000100";
display_number <= pta_display_1;
when 3 => display_selector <= "001000";
display_number <= pta_display_3;
when 4 => display_selector <= "010000";
display_number <= destino_display;
when 5 => display_selector <= "100000";
display_number <= Piso_actual_display;
end case;
end process;
End architecture;