Really revert all of the recent rotating changes.
[matthijs/master-project/cλash.git] / Shifter.hs
1 module Shifter (main, mainIO) where
2 import Bits
3 import qualified Sim
4
5 main = Sim.simulate shifter [High, Low, Low, Low] [High, Low, High, Low]
6 mainIO = Sim.simulateIO shifter [High, Low, High, Low]
7
8 type ShifterState = [Bit]
9 shifter :: Bit -> ShifterState -> (ShifterState, Bit)
10 shifter i s =
11   (s', o)
12   where
13     s' = (o `hwxor` i) : (init s)
14     o  = last s
15
16 -- vim: set ts=8 sw=2 sts=2 expandtab: