Electronic – How to avoid input/output conflicts with a bus

cpuregister

How does a system bus work?

I don't understand how can a circuit avoid input/output issues with a bus. I included an image to better explain my thinking.

enter image description here

The circuit has 2 general purpose registers connected to a system bus. The left wires of each GP register is input and the right wires is output. Currently, the input is going inside the output, causing logisim to mark the wire red (error). What are the solutions to avoid this?

Here is the black-box for the registers.

enter image description here

Best Answer

Instead of AND gates you need to use tristate drivers. These drivers go to a high-impedance state when they are not enabled, which allows some other device on the bus to control the bus signal voltages. Presumably, the control logic allows only one register output to be enabled at any given time.

Logisim calls these drivers a "controlled buffer", by the way.