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:
82e9069
)
Add a two-port mux hardware model.
author
Matthijs Kooijman
<m.kooijman@student.utwente.nl>
Fri, 27 Feb 2009 13:35:05 +0000
(14:35 +0100)
committer
Matthijs Kooijman
<m.kooijman@student.utwente.nl>
Fri, 27 Feb 2009 13:35:05 +0000
(14:35 +0100)
Adders.hs
patch
|
blob
|
history
diff --git
a/Adders.hs
b/Adders.hs
index ac93a3366db359f3fc368467fe7280320aece926..4745d8cd66b1984ae6e119f2e1e5399f38110ea2 100644
(file)
--- a/
Adders.hs
+++ b/
Adders.hs
@@
-16,6
+16,10
@@
show_add f = do print ("Sum: " ++ (displaysigs s)); print ("Carry: " ++ (displ
b = [Low, Low, Low, High]
(s, c) = f (a, b)
+mux2 :: Bit -> (Bit, Bit) -> Bit
+mux2 Low (a, b) = a
+mux2 High (a, b) = b
+
-- Not really an adder, but this is nice minimal hardware description
wire :: Bit -> Bit
wire a = a