Previously, we have studied this circuit:
Circuit enable the CPU to fetch the correct registers into the ALU inputs (to prepare for computation)
Previously, we studied this solution:
I will present a better (more efficient) solution to forward registers to the ALU inputs using tri-state-buffers
I will limit the discussion to forwarding 1 bit from the registers to the ALU:
Because you can use the same technique to forward the other bits !
The MUX solution to forward 1 bit from registers to the ALU is as follows:
The signals o3,o2,o1,o0 are the (1 bit) outputs from registers
Let's start afresh with the input signals:
We must select one of the signals o3,o2,o1,o0 for the ALU input
If we connect o0 to the ALU input (like this):
Then output o0 can be forwarded to the ALU input (in fact: is always forwarded...)
If we connect o1 to the ALU input (like this):
Then output o1 can be forwarded to the ALU input (in fact: is always forwarded...)
However, if we connect both o0 and o1 to the ALU input (like this):
Then outputs o0 and o1 are connected together (and it is forbidden -- it causes a short-circuit !)
Solution: use tri-state-buffers to control the making/breaking of these connections:
The only thing remaining is: control the making of the connections !
We can use a decoder to "translate" the selection signals:
We can use the decoder outputs to selectively connect the register outputs !
The complete solution is:
The decoder (circuit) will turn exactly 1 tri-state-buffer on and prevents multiple outputs being connected together !!
Example: if selection signals = 00, the decoder will only activate the lower tri-state-buffer:
I will now apply this solution to forward registers (4 bits each) to the ALU inputs...
Previously, we used this solution:
I will now present a (better) solution that uses tri-state-buffers
The solution using tri-state-buffers is as follows:
The decoder will active all tri-state-buffers of (exactly) 1 register which will connect to the ALU input
I have redrawn the solution without explaining inline text:
DEMO: /home/cs355001/demo/circuits/reg-TSB-alu and reg-TSB-alu2
Consider the solution that uses multiplexors:
It uses 2×N multiplexors = 2×N ×N gates; where N = # bits in a register
Consider the solution that uses tri-state-buffers: (tri-state-buffer is a basic gate)
It uses 2 decoders + 2×N tri-state-buffers = 2 ×N + 2×N gates; where N = # bits in a register