blob: 22bf36659cf654550a7b77f6e3393e0c0fda41ff (
plain) (
blame)
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
65
66
67
68
69
70
71
72
|
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.all;
entity lab is
Port ( clk,rst, rx : in STD_LOGIC; -- rst är tryckknappen i mitten under displayen
seg: out UNSIGNED(7 downto 0);
an : out UNSIGNED (3 downto 0));
end lab;
architecture Behavioral of lab is
component leddriver
Port ( clk,rst : in STD_LOGIC;
seg : out UNSIGNED(7 downto 0);
an : out UNSIGNED (3 downto 0);
value : in UNSIGNED (15 downto 0));
end component;
signal sreg : UNSIGNED(9 downto 0) := B"0_00000000_0"; -- 10 bit skiftregister
signal tal : UNSIGNED(15 downto 0) := X"0000";
signal rx1,rx2 : std_logic; -- vippor på insignalen
signal sp : std_logic; -- skiftpuls
signal lp : std_logic; -- laddpuls
signal pos : UNSIGNED(1 downto 0) := "00";
begin
process(clk) begin
if rising_edge(clk) then
if rst='1' then
-- init
elsif false then
-- do the thing
else
-- do the other thing
end if;
end if;
end process;
-- *****************************
-- * synkroniseringsvippor *
-- *****************************
-- *****************************
-- * styrenhet *
-- *****************************
-- *****************************
-- * 10 bit skiftregister *
-- *****************************
-- *****************************
-- * 2 bit register *
-- *****************************
-- *****************************
-- * 16 bit register *
-- *****************************
-- *****************************
-- * Multiplexad display *
-- *****************************
-- Inkoppling av komponenten leddriver
led: leddriver port map (clk, rst, seg, an, tal);
end Behavioral;
|