-
Notifications
You must be signed in to change notification settings - Fork 1
/
ex5_exponent.dot
42 lines (35 loc) · 897 Bytes
/
ex5_exponent.dot
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
// Data-flow diagram for Exponent register machine
digraph Exponent {
// the stack
stack [shape=box];
// labels
"expt-done" [shape=triangle];
"after-expt" [shape=triangle];
// constants
1 [shape=triangle];
0 [shape=triangle];
// registers
n [shape=box];
b [shape=box];
continue [shape=box];
val [shape=box];
// operations
"*" [shape=polygon,sides=4,distortion=0.6];
"-" [shape=polygon,sides=4,distortion=0.6];
// tests
"=";
// edges
"expt-done" -> continue;
n -> "=";
0 -> "=";
continue -> stack;
"after-expt" -> continue;
"-" -> n;
n -> "-";
1 -> "-";
stack -> continue;
"*" -> val;
val -> "*";
b -> "*";
1 -> val;
}