-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path2021-12-07 ex2.lnt
77 lines (69 loc) · 1.58 KB
/
2021-12-07 ex2.lnt
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
module EX2 is
channel bool is (value : bool) end channel
process And_gate [Left, Right, Output : bool] is
loop
var l, r : bool in
par Left (?l) || Right (?r) end par;
Output (l and r)
end var
end loop
end process
process Or_gate [Left, Right, Output : bool] is
loop
var l, r : bool in
par Left (?l) || Right (?r) end par;
Output (l or r)
end var
end loop
end process
process Not_gate [Input, Output : bool] is
loop
var b : bool in
Input (?b);
Output (not (b))
end var
end loop
end process
process Wire [Input, Output : bool] is
loop
var b : bool in
Input (?b);
Output (b)
end var
end loop
end process
process Main [Input_0, Input_1, Input_2 : bool,
Output_0, Output_1, Output_2, Output_3 : bool] is
hide Output_c, Output_d, Output_e : bool in
par
-- porte a
Output_c, Output_e, Output_0 ->
And_gate [Output_c, Output_e, Output_0]
||
-- porte b
Input_0, Input_1, Output_1 ->
And_gate [Input_0, Input_1, Output_1]
||
-- porte c
Input_0, Input_1, Output_c ->
Or_gate [Input_0, Input_1, Output_c]
||
-- porte d
Input_1, Input_2, Output_d ->
Or_gate [Input_1, Input_2, Output_d]
||
-- porte e
Output_1, Output_e ->
Not_gate [Output_1, Output_e]
||
-- porte f
Output_d, Output_2 ->
Not_gate [Output_d, Output_2]
||
-- connexion entree /sortie
Input_2, Output_3 ->
Wire [Input_2, Output_3]
end par
end hide
end process
end module