From 023e8550e96ed275acf746580642c9f6fee60329 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Fri, 27 Feb 2009 14:35:05 +0100 Subject: [PATCH] Add a two-port mux hardware model. --- Adders.hs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Adders.hs b/Adders.hs index ac93a33..4745d8c 100644 --- 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 -- 2.30.2