CPU can retain information in registers, so it has D-flipflops and so do the computer memory.
When the CPU read some data from memory, the value stored in the D-flipflops in the memory is transfered into some D-flipflops in the CPU.
Similarly, when the CPU writes some data to memory, the value stored in the D-flipflops in some register in the CPU is transfered into some D-flipflops in the memory.
I will illustrate the subtleties using a 1-bit register and a 1-bit memory element....
So we need to make the following red connections:
So far, so good: we did not connect any outputs together and the connections can be made "safely".
So we need to make the following blue connections:
Uh oh.... we connected 2 outputs together and the connections CANNOT be made "safely".
All material has some resistance to electricity and people have constructed circuits that consists of "sandwiching" a number of "positively" and "negatively" dotted silicon. These material form a "PN junction" and the width of this junction can be increased and decreased by removing or injecting free electrons, respectively. The wider the junction, the higher the resistance of the dotted material becomes, and conversely.
You can read more on the PN-junction at PBS: click here
If the control signal is equal to 1, then the tri-state-buffer conducts very well. The result is akin to the situation where the input and output of the tri-state-buffer are connected by a piece of copper wire.
If the control signal is equal to 0, then the tri-state-buffer conducts very poorly. The result is akin to the situation where the input and output of the tri-state-buffer are connected by a piece of match stick or nylon wire. It behaves as if the input and the output are disconnected... (because disconnected circuit end points have extremely high resistance...
The following figure summarizes the operation of the tri-state-buffer:
/home/cs355001/bin/cs355sim /home/cs355001/demo/circuits/Tri-State-Buffer |
Please note that this particular tri-state-buffer works as follows:
So the meaning of the control signal is reverse (that should not be a big deal to adjust to...)
/home/cs355001/bin/cs355sim /home/cs355001/demo/circuits/bi-dir-bus |
The Dff on the left represents the data inside the CPU
The Dff on the right represents the data inside the RAM (computer) memory
The functions of the keys are as follows:
To transfer data from CPU to memory (left to right):
|
To transfer data from memory to CPU (right to left):
|
|
You will see an error message from EDiSim warning you that 2 components are trying to change the same (output) signal