1 |
6 |
marta |
-- VHDL data flow description generated from `kontrol_kunci`
|
2 |
|
|
-- date : Sat Jul 28 17:00:56 2001
|
3 |
|
|
|
4 |
|
|
|
5 |
|
|
-- Entity Declaration
|
6 |
|
|
|
7 |
|
|
ENTITY kontrol_kunci IS
|
8 |
|
|
PORT (
|
9 |
|
|
clk : in BIT; -- clk
|
10 |
|
|
start : in BIT; -- start
|
11 |
|
|
rst : in BIT; -- rst
|
12 |
|
|
f_enkey : in BIT; -- f_enkey
|
13 |
|
|
f_invmul : in BIT; -- f_invmul
|
14 |
|
|
f_invadd : in BIT; -- f_invadd
|
15 |
|
|
rst_all : out BIT; -- rst_all
|
16 |
|
|
key_ready : out BIT; -- key_ready
|
17 |
|
|
s_enkey : out BIT; -- s_enkey
|
18 |
|
|
s_invmul : out BIT; -- s_invmul
|
19 |
|
|
s_invadd : out BIT; -- s_invadd
|
20 |
|
|
vdd : in BIT; -- vdd
|
21 |
|
|
vss : in BIT -- vss
|
22 |
|
|
);
|
23 |
|
|
END kontrol_kunci;
|
24 |
|
|
|
25 |
|
|
|
26 |
|
|
-- Architecture Declaration
|
27 |
|
|
|
28 |
|
|
ARCHITECTURE behaviour_data_flow OF kontrol_kunci IS
|
29 |
|
|
SIGNAL current_state : REG_VECTOR(3 DOWNTO 0) REGISTER; -- current_state
|
30 |
|
|
SIGNAL aux23 : BIT; -- aux23
|
31 |
|
|
SIGNAL aux19 : BIT; -- aux19
|
32 |
|
|
|
33 |
|
|
BEGIN
|
34 |
|
|
aux19 <= (current_state (3) or current_state (0));
|
35 |
|
|
aux23 <= (current_state (1) and current_state (0));
|
36 |
|
|
label0 : BLOCK ((not (clk) and not (clk'STABLE)) = '1')
|
37 |
|
|
BEGIN
|
38 |
|
|
current_state (0) <= GUARDED (not (rst) and (not (current_state (2)) or (not (current_state
|
39 |
|
|
(1)) and current_state (3)) or aux23) and (not (current_state
|
40 |
|
|
(1)) or (not (f_enkey) and start) or not ((not (current_state
|
41 |
|
|
(2)) and not (current_state (3))))) and (not ((not (current_state
|
42 |
|
|
(2)) and not (current_state (1)))) or (f_invmul and not (aux19))));
|
43 |
|
|
END BLOCK label0;
|
44 |
|
|
label1 : BLOCK ((not (clk) and not (clk'STABLE)) = '1')
|
45 |
|
|
BEGIN
|
46 |
|
|
current_state (1) <= GUARDED (rst or (not (current_state (2)) and not (current_state (1))
|
47 |
|
|
and not (current_state (3))) or (not (f_invadd) and aux23) or
|
48 |
|
|
(not (current_state (2)) and current_state (1) and (not (start)
|
49 |
|
|
or aux19)));
|
50 |
|
|
END BLOCK label1;
|
51 |
|
|
label2 : BLOCK ((not (clk) and not (clk'STABLE)) = '1')
|
52 |
|
|
BEGIN
|
53 |
|
|
current_state (2) <= GUARDED (not (rst) and (current_state (2) or not (aux19)) and (not (current_state
|
54 |
|
|
(1)) or (f_invadd and aux19)));
|
55 |
|
|
END BLOCK label2;
|
56 |
|
|
label3 : BLOCK ((not (clk) and not (clk'STABLE)) = '1')
|
57 |
|
|
BEGIN
|
58 |
|
|
current_state (3) <= GUARDED (not (rst) and ((current_state (2) and aux23) or (current_state
|
59 |
|
|
(3) and not ((f_invadd and current_state (1)))) or (not (current_state
|
60 |
|
|
(2)) and ((current_state (3) and current_state (1)) or (not
|
61 |
|
|
(current_state (1)) and not (current_state (0)))))));
|
62 |
|
|
END BLOCK label3;
|
63 |
|
|
|
64 |
|
|
s_invadd <= (not (rst) and ((not (current_state (2)) and current_state (3))
|
65 |
|
|
or (not (f_invadd) and current_state (2) and (not (current_state
|
66 |
|
|
(0)) or current_state (1)) and aux19)));
|
67 |
|
|
|
68 |
|
|
s_invmul <= (not (rst) and ((current_state (2) and ((not (current_state (0))
|
69 |
|
|
and current_state (3)) or (not (current_state (1)) and not (current_state
|
70 |
|
|
(3))))) or (not (current_state (2)) and not (current_state (1))
|
71 |
|
|
and not ((not (current_state (3)) and (f_invmul or current_state
|
72 |
|
|
(0)))))));
|
73 |
|
|
|
74 |
|
|
s_enkey <= (not (rst) and not (current_state (2)) and not (f_enkey) and
|
75 |
|
|
not (current_state (3)) and start and current_state (1));
|
76 |
|
|
|
77 |
|
|
key_ready <= (not (rst) and current_state (2) and ((not (current_state (1))
|
78 |
|
|
and current_state (3)) or (current_state (0) and f_invadd and
|
79 |
|
|
current_state (1))));
|
80 |
|
|
|
81 |
|
|
rst_all <= (rst or (not (current_state (2)) and not (current_state (3))
|
82 |
|
|
and (current_state (0) or (not (start) and current_state (1)))));
|
83 |
|
|
END;
|