When I attempted my ALU, I got confused because of the order of the flags and that they could share the same output. (Not sure that even makes sense. :-) ) I think this is a fan-out thing?
Anyway this got me stuck:
if zx==1 then x=0
if nx==1 then x=0
So if both zx and nx are set, then value of x depends on the order of the if's. Is this a "normal" way to use flags like this, or is it just a sort of short-cut that we are taking to make things easier? What if I do set zx and nx? Is there a logical reason that nx trumps zx, or is it an assumption that we've made?
However, after looking at the book a bit more, there is a truth table which dictates the order, so first I want to try to construct it just using those bits. I'll probably still get stuck, but maybe not.
The order here does indeed matter, so focus on wiring up "zeroing x or leaving x alone" first, then focus on taking that result and "turning it into 0 or leaving it alone."