X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=Adders.hs;h=4745d8cd66b1984ae6e119f2e1e5399f38110ea2;hb=23f93793c5f5f44f1443493c171a0b98295a1651;hp=ac93a3366db359f3fc368467fe7280320aece926;hpb=0082f01a853476cdcec0e73bacf8c0d4508dbec0;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git 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