-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added all the examples used in my presentation
use the makefile in examples_pk/presentation to run them after installing pk2000 the symmetry examples does not work, because one variable can't have multiple slot accesses at the same time. therefore, there can't be a symmetry check this way.
- Loading branch information
Lars
committed
Nov 15, 2012
1 parent
ff62d08
commit 868324b
Showing
4 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
all: | ||
ruby ../../pkc.rb -i inc.pk | ||
echo "\n\nputs \"* Increment function\"\nputs \" inc(1): ( \"+Plankalkuel.p1(1)[0].to_i.to_s+\", \"+Plankalkuel.p1(1)[1].to_i.to_s+\")\"\nputs \" inc(65535): ( \"+Plankalkuel.p1(65535)[0].to_i.to_s+\", \"+Plankalkuel.p1(65535)[1].to_i.to_s+\")\"" >> inc.rb | ||
ruby inc.rb | ||
ruby ../../pkc.rb -i maj.pk | ||
echo "\n\nputs \"* Major function\"\nputs \" max(16, 18): \"+Plankalkuel.p2(16, 18).to_i.to_s\nputs \" max(18, 16): \"+Plankalkuel.p2(18, 16).to_i.to_s\nputs \" max(16, 16): \"+Plankalkuel.p2(16, 16).to_i.to_s" >> maj.rb | ||
ruby maj.rb | ||
ruby ../../pkc.rb -i sym.pk | ||
echo "\n\nputs \"* Symmetry (for 16bit numbers)\"\nputs \" sym(0): \"+Plankalkuel.p3(0).to_i.to_s\nputs \" sym(8): \"+Plankalkuel.p3(8).to_i.to_s" >> sym.rb | ||
ruby sym.rb | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
P1 (V0[:16.0]) => (R0[:16.0], R1[:0]) | ||
1 => Z0[:0] | ||
0 => R0[:16.0] | ||
W1(16)[ | ||
!(V0[i:0] ~ Z0[:0]) => R0[i:0] | ||
V0[i:0] & Z0[:0] => Z0[:0] | ||
] | ||
Z0[:0] => R1[:0] | ||
END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
P2 (V0[:16.0], V1[:16.0]) => R0[:16.0] | ||
V0[:16.0] > V1[:16.0] -> (V0[:16.0] => R0[:16.0]) | ||
! V0[:16.0] > V1[:16.0] -> (V1[:16.0] => R0[:16.0]) | ||
END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
P3 (V0[:16.0]) => R0[:0] | ||
0 => Z1[:4.0] | ||
15 => Z2[:4.0] | ||
1 => Z0[:0] | ||
W[ | ||
Z1[:4.0] < Z2[:4.0] -> [ | ||
(V0[Z1[:4.0]:0] ~ V0[Z2[:4.0]:0]) & Z0[:0] => Z0[:0] | ||
Z1[:4.0] + 1 => Z1[:4.0] | ||
Z2[:4.0] - 1 => Z2[:4.0] | ||
] | ||
] | ||
Z0[:0] => R0[:0] | ||
END |