From: Matthijs Kooijman Date: Thu, 19 Feb 2009 10:24:01 +0000 (+0100) Subject: Add stateful alu (with empty state). X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=d704c6a23e75f563d4816a0e01219fa7a3be266c;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git Add stateful alu (with empty state). --- diff --git a/Alu.hs b/Alu.hs index 78c5afc..f26bb83 100644 --- a/Alu.hs +++ b/Alu.hs @@ -51,6 +51,10 @@ alu :: AluOp -> Bit -> Bit -> Bit alu High a b = a `hwand` b alu Low a b = a `hwor` b +salu :: AluOp -> Bit -> Bit -> () -> ((), Bit) +salu High a b s = (s, a `hwand` b) +salu Low a b s = (s, a `hwor` b) + type ExecState = (RegisterBankState, Bit, Bit) exec :: (RegAddr, Bit, AluOp) -> ExecState -> (ExecState, ())