summaryrefslogtreecommitdiff
path: root/tp1/test/nadder.mj
diff options
context:
space:
mode:
authorAlex AUVOLAT <alex.auvolat@ens.fr>2013-11-04 22:05:57 +0100
committerAlex AUVOLAT <alex.auvolat@ens.fr>2013-11-04 22:05:57 +0100
commitcebd07b64f1f537c5ecf00ec21ff4b7c4032f0a3 (patch)
tree9d2048313fe3ad4c92865c8f0236bed24e64449b /tp1/test/nadder.mj
parentf253f98136def21b5e50c5922246e2ddfe315442 (diff)
downloadSystDigit-Projet-cebd07b64f1f537c5ecf00ec21ff4b7c4032f0a3.tar.gz
SystDigit-Projet-cebd07b64f1f537c5ecf00ec21ff4b7c4032f0a3.zip
Added stub C simulator (defined dumb-down syntax for netlists).
Diffstat (limited to 'tp1/test/nadder.mj')
-rw-r--r--tp1/test/nadder.mj19
1 files changed, 0 insertions, 19 deletions
diff --git a/tp1/test/nadder.mj b/tp1/test/nadder.mj
deleted file mode 100644
index 0c95386..0000000
--- a/tp1/test/nadder.mj
+++ /dev/null
@@ -1,19 +0,0 @@
-fulladder(a,b,c) = (s, r) where
- s = (a ^ b) ^ c;
- r = (a & b) + ((a ^ b) & c);
-end where
-
-adder<n>(a:[n], b:[n], c_in) = (o:[n], c_out) where
- if n = 0 then
- o = [];
- c_out = 0
- else
- (s_n1, c_n1) = adder<n-1>(a[1..], b[1..], c_in);
- (s_n, c_out) = fulladder(a[0], b[0], c_n1);
- o = s_n . s_n1
- end if
-end where
-
-main(a, b) = (o, c) where
- (o, c) = adder<1>(a,b,0)
-end where \ No newline at end of file