This exercise from Introduction to Computing Systems from Bits and Gates to C/C++ & Beyond by Yale N. Patt and Sanjay J. Pattel asks what the value of OUT signifies in this circuit. If it's 0, then there are many cases that give 0, same for 1. So, am I supposed to study all these cases (which is a LOT of work that I don't think is the goal of the exercise)? And if I did so and found out what combinations give 0 and those that give 1, how will this help me find the significance of OUT. Moreover, they didn't even tell what the circuit does, nor what IR, P, Z and N on the top of the circuit are, probably registers but they also didn't tell what they are meant for, so how am I supposed to know the significance of OUT without knowing all of what I mentioned?
With a background in many processors and their instruction sets, my conclusions are:
IRcommonly means "instruction register".
Pusually designates the parity flag in a processor's status set.
Zusually designates the zero flag in a processor's status set.
Nusually designates the sign flag in a processor's status set (n for "negative").
The logic circuitry NORs the left 4 bits of the
IR together, so that the output of the NOR is true only if all 4 bits are zero.
Each of the 3 next bits to the right is individually ANDed with one of the mentioned flags of the status set. Thus such a bit gates the flag. The outputs of the 3 ANDs are ORed together, which means that any of them can to be true to drive the last AND.
This last AND outputs true only, if the instruction in the
IR has its 4 leftmost bits at zero and at least one of the next 3 bits is true and the respective flag is also true. Else the output is false.
One could now try to find some existing instruction set, but I don't see the necessity.
We can safely assume that this is the first part of the instruction decoder for condition jumps or branches or skips or a group of other conditional operations. For example:
|0000 000 ...||
||jump never (yes, there are such instructions sets!)|
|0000 100 ...||
||jump on minus|
|0000 010 ...||
||jump on zero|
|0000 110 ...||
||jump on not positive (negative or zero)|
|0000 001 ...||
|jump on parity even
(could also be jump on parity odd, depending on the definition of
For simplicity they designed this simple mask scheme, which might allow only one of set mask bit. Combinations are possible, but some are ... hrm ... strange.
Final line: So
OUT signifies the condition of a conditional command. It does not have to be an operation to change the flow of control, though!
Note: If the book really does not prepare you for this question (I didn't read it), you should consider to drop it and read another one.
- IR is the instruction register.
- P, Z, N are bits in the status register.
- P, Z, N are each and-ed with a dedicated mask bit in the IR.
- The left 4 bits of the IR are AND-ed together.
The output is true when:
- the left 4 bits of the IR are zero, since only then the 4-input NOR will output 1, and
- any of the flags gated by the 3 right bits in the IR are set.
The output is false otherwise.
As for what does the output signify: nothing useful. The flag "masking" scheme as shown is useless. This is not, for example, how you'd decode a conditional jump, even though the authors probably had that intention.
The circuit's function can be exactly described, as above, but it is a useless circuit. Make your own conclusions from that.