projects
/
matthijs
/
master-project
/
cλash.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2d373e3
)
Add a D-Flip flop hardware model.
author
Matthijs Kooijman
<m.kooijman@student.utwente.nl>
Mon, 2 Feb 2009 16:21:31 +0000
(17:21 +0100)
committer
Matthijs Kooijman
<m.kooijman@student.utwente.nl>
Mon, 2 Feb 2009 16:21:31 +0000
(17:21 +0100)
Adders.hs
patch
|
blob
|
history
diff --git
a/Adders.hs
b/Adders.hs
index b09b98fdc4b43823fc13325f9887a7ea7f6cf260..10590fa7c765736ced0e4cf166160687c4ff2fd1 100644
(file)
--- a/
Adders.hs
+++ b/
Adders.hs
@@
-31,6
+31,13
@@
invinv a = hwnot (hwnot a)
dup :: Bit -> (Bit, Bit)
dup a = (a, a)
+-- Not really an adder either, but a simple stateful example (D-flipflop)
+dff :: Bit -> Bit -> (Bit, Bit)
+dff d s = (s', q)
+ where
+ q = s
+ s' = d
+
-- Combinatoric stateless no-carry adder
-- A -> B -> S
no_carry_adder :: (Bit, Bit) -> Bit