A bus connects together multiple devices so that they can talk to one another through shared communication lines. Only one device can write to the bus, drive it, at any point in time but multiple devices can simultaneously read from it.
A tri-state device is one that has a third output state in addition to 0 and 1. This third state is a high impedance state called Hi-Z which has the effect of disconnecting the device from the circuit. This Hi-Z state can be used to disconnect device outputs from the bus and allow one device to drive the bus. Tri-state devices commonly have an /Output Enable which when asserted forces the devices output into the Hi-Z state.
One method of ensuring only one device is driving the bus at a time is to connect the /OE controls of all the tri-state devices to a decoder and use the decoder to select which device is enabled. All other devices will be forced into their high impedance Z state. This is a fairly fool proof method and there are decoders that will 'break before make' when switching between devices.
As the /OE is active low an inverting decoder needs to be used so that the selected output is low and all the other outputs are high.
As the /OE is active low an inverting decoder needs to be used so that the selected output is low and all the other outputs are high.
A single 3-to-8 decoder can be used to select between 8 devices connected to a bus. If control of more than 8 devices is required two or three decoders can be chained together e.g. to create a 4-to-16 decoder.
A similar method can be used to select between multiple devices that can read from the bus. Assuming the devices latch their value from the bus on the next rising edge of the clock signal a decoder combined with AND gates can be used to 'arm' the clock input of the selected device so that only one of the devices sees the rising clock on it's clock input and reads from the bus.
Unlike ensuring that only one device is driving the bus at a time using a decoder to select between devices to read from the bus is not an electrical necessity but simply a convenience as we only need to write to one device at a time and it reduces the number of control lines required.
A transceiver such ad the 74HC245 is a bus driving device with 3-state outputs in both directions.
A transceiver such ad the 74HC245 is a bus driving device with 3-state outputs in both directions.
No comments:
Post a Comment