One way I think to approach this is to consider the dependance/indendance
of each variable in a truth table scheme. In a truth table, each of
your inputs are independant variables: you cannot "calculate" the value of
X, Y, or Bin; you arbitrarily assign them values when you list your 2^n
permutations of what their possible values. The
outputs, on the other hand, are
dependant variables. You cannot arbitrarily assign an output a value on a
truth table line; you must calculate its value using an equation that
defines the relation of its value to the values of the other variables.
The confusion, in this case, is because Bout "seems" to exhibit the
behavior of both types: "you calculate its value from the inputs, yet use
that calculated value to determine S. In this case, apply our definition
above: can Bout's value be arbitrarily assigned or must it be calculated
(there's only one case in which its both and this is not it). The answer
is that Bout's value must be calculated, hence it is an output and not an
input.
So how do we resolve the
"seeming" contradiction I've set up (it exhibts behaviors of both types,
yet can only be one)? The trick here is that outputs are defined to be
dependant on the values of the other VARIABLES, and not the INPUTS. In
layman's terms, we are first calculating the value of Bout from the
inputs, and then calculating the value of S from Bout and the inputs.
Bout, of course, is not really necessary to calculate the value of S:
instead of using Bout you could just substitute its equation composed of
inputs, resulting in S being calculated purely from inputs.
Two other cases I'd like to consider to make sure we've got this issued
fully and overly-explained:
(1) X = X. You could have a function that took X as an input and just
passed its value as an output (this is a buffer logic gate). Note our
defintions still apply: X can be arbitrarily assigned as an input and has
an equation defining its output value (= whatever is input).
(2) A + Y = X,
B + X = Y. Here you have your two outputs defined recursively in
terms of each other. By substitution you get:
A + B + Y = Y. Which makes the recursive definition of Y particularly
clear. Here Y is an output because its value must be calculated to fit
the given equation, yet must also be arbitrarily assigned in order to
solve this equation. This is a paradox (infinite recursion) and cannot be
solved (at least not without better math skills than mine!).
Hope this helped!
matt