Example 1: Greatest Common Divisor (GCD)
... mov ebx, y; // a reg used for denom sub edx, edx; // zero dx idiv ebx; // signed integer divide mov n, edx; // remainder mov ebx, y; xchg ebx, x; // x = y mov ebx, n; xchg ebx, y; // y = n; mov ebx, y; cmp y, 0; jg DO01; DOEND01: ...
... mov ebx, y; // a reg used for denom sub edx, edx; // zero dx idiv ebx; // signed integer divide mov n, edx; // remainder mov ebx, y; xchg ebx, x; // x = y mov ebx, n; xchg ebx, y; // y = n; mov ebx, y; cmp y, 0; jg DO01; DOEND01: ...
Euler`s Phi Function and Graph Labeling
... Given a graph G(V, E) with n vertices is a simple graph with no loops and parallel edges. The vertices {v1 , v2 , . . . , vn } are labeled with the integers {1, 2, . . . , n} in such a way that for each edge vi vj ∈ E, f (vi ) and f (vj ) are relatively prime. i.e., f : V → {1, 2, . . . , |V |} is a ...
... Given a graph G(V, E) with n vertices is a simple graph with no loops and parallel edges. The vertices {v1 , v2 , . . . , vn } are labeled with the integers {1, 2, . . . , n} in such a way that for each edge vi vj ∈ E, f (vi ) and f (vj ) are relatively prime. i.e., f : V → {1, 2, . . . , |V |} is a ...