-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdc motor.vhd
84 lines (56 loc) · 1.26 KB
/
dc motor.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity dc_motor is
port (
clk : in std_logic;
kontak : in std_logic;
ileri : in std_logic;
geri : in std_logic;
sag : in std_logic;
sol : in std_logic;
enable : out std_logic;
output1 : out std_logic;
output2 : out std_logic;
enable2 : out std_logic);
end dc_motor;
architecture Behavioral of dc_motor is
begin
process(kontak)
--variable i : integer := 1;
begin
if kontak = '1' then
enable <= '0';
enable2 <= '0';
if ileri = '1' --i <= 1005
then --i := i + 1;
enable <= '1';
enable2 <= '1';
output1 <= '1';
output2 <= '0';
elsif geri = '1' --i > 1005 and i < 1550
then
enable <= '1';
enable2 <= '1';
output1 <= '0';
output2 <= '1';
elsif sol = '1'
then --i := i + 1;
enable <= '0';
enable2 <= '1';
output1 <= '0';
output2 <= '1';
elsif sag = '1'
then --i := i + 1;
enable <= '0';
enable2 <= '1';
output1 <= '1';
output2 <= '0';
--else -- i = 1550 then i := 0;
end if;
else enable <= '0';
enable2 <= '0';
end if;
end process;
end Behavioral;