From: Matthijs Kooijman Date: Mon, 2 Feb 2009 16:21:31 +0000 (+0100) Subject: Add a D-Flip flop hardware model. X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=171a9d286a1b4d5df44af79d67b6785620d41d5e;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git Add a D-Flip flop hardware model. --- 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