|
A uni-directional bus contains wires that are only used to transfer data in one specific direction
Example:
Notice that
no 2 outputs are
connected together
Therefore,
a uni-directional bus
can be constructed
without the use/help
of any special circuits
A bi-directional bus contains wires that are used to transfer data in any direction
|
Let's try to construct a bi-directional (data) bus for 1 bit transfer:
The design can easily generalized into a data bus for N bits
We connect the output of Dff 1 and the input of Dff 2 onto the data bus wire:
Now we can transfer the data (value) stored in Dff 1 to Dff 2 (by clocking Dff 2)
We connect the output of Dff 2 and the input of Dff 1 onto the data bus wire:
Now we can transfer the data (value) stored in Dff 2 to Dff 1 (by clocking Dff 1)
Situation:
Will this work ???
Unfortunately NO:
The outputs connected together will cause a short-circuit...
|
When control=1, the tri-state-buffer will connect the input to the output:
In this situation: control=1 and the input=0 and output=0 (= input)
When control=1, the tri-state-buffer will connect the input to the output:
In this situation: control=1 and the input=1 and output=1 (= input)
When control=0, the tri-state-buffer will disconnect the input to the output:
In this situation: control=0 and the input=0 and output=UNKNOWN (orange)
When control=0, the tri-state-buffer will disconnect the input to the output:
In this situation: control=0 and the input=1 and output=UNKNOWN (orange)
We have the follow design for an unsuccessful bi-directional bus:
The problem is: the outputs are connected together
We can fix this problem using tri-state-buffers (that provides controlled connection !)
Bi-directional bus using tri-state-buffers:
We make sure that the tri-state-buffers are never ACTIVE at the same time !!
(Then at most
one of the outputs will
be connected to the
data bus wire !!!)
DEMO:
/home/cs355001/demo/circuits/bi-dir-bus
The CPU emits a "R/W" controls signal on the control bus:
When the CPU wants to read data from memory, it sends out: R/W=1
When the CPU wants to write data to memory, it sends out: R/W=1
The CPU can control the direction of data transfer with this simple circuit:
R/W=1 indicates a
READ operation
(CPU gets data
from
memory)
R/W=0 indicates a
WRITE operation
(CPU stores data
to
memory)
What happens in a READ operation:
R/W=1 indicates a READ operation (CPU gets data from memory)
The settings of the tri-state-buffers enables data from memory to be copied into a register in the CPU
What happens in a WRITE operation:
R/W=0 indicates a WRITE operation (CPU writes data to memory)
The settings of the tri-state-buffers enables data from a register in the CPU to be copied into memory