Looking at the code, the function unit is the most simple. It arranges
the operand selection for the function unit. Note that it does not
define the actual operation that takes place inside the function unit,
-but simply accepts the (higher order) argument "op" which is a function
+but simply accepts the (higher order) argument \hs{op} which is a function
of two arguments that defines the operation.
\begin{code}
cpu (State s) input addrs opc = (State s', out)
where
s' = [ fu (multiop opc) inputs (addrs!0)
- , fu (+) inputs (addrs!1)
- , fu (-) inputs (addrs!2)
- , fu (*) inputs (addrs!3)
+ , fu add inputs (addrs!1)
+ , fu sub inputs (addrs!2)
+ , fu mul inputs (addrs!3)
]
inputs = 0 +> (1 +> (input +> s))
out = head s'