X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=Adders.hs;h=10590fa7c765736ced0e4cf166160687c4ff2fd1;hb=171a9d286a1b4d5df44af79d67b6785620d41d5e;hp=b09b98fdc4b43823fc13325f9887a7ea7f6cf260;hpb=2d373e3ef037e8d5e0e8d67337a21a213254e61f;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git diff --git a/Adders.hs b/Adders.hs index b09b98f..10590fa 100644 --- 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