Discussions
The Fundamentals of Digital Electronics, Part 6 - Tri-state - Printable Version

+- Discussions (https://lawsonlabs.com/bboard)
+-- Forum: Lawson Labs Products (https://lawsonlabs.com/bboard/forumdisplay.php?fid=1)
+--- Forum: Start Here (https://lawsonlabs.com/bboard/forumdisplay.php?fid=2)
+--- Thread: The Fundamentals of Digital Electronics, Part 6 - Tri-state (/showthread.php?tid=38)



The Fundamentals of Digital Electronics, Part 6 - Tri-state - Tom - 03-17-2022

The Fundamentals of Digital Electronics, Part 6 - Tri-state

Part 5 of this series got us to microprocessors. That is a big step. More than a few new approaches were needed in order to make microprocessors practical. One of those new concepts was that of the tri-state logic circuit. A tri-state output can be high or low, like ordinary logic outputs, but it also has a third condition. That third state is called high-impedance. In plain terms, that means the output is simply inactive, as if the output were disconnected from the circuit. Tri-state is necessary to employ a data bus, because outputs from different logic circuits will drive the bus at different times. Some say the invention of the number zero enabled modern mathematics. In something like that fashion, tri-state outputs upped the game for digital logic.

The concept of tri-state is inseparable from the idea of an interconnecting bus, but how did we get here? As digital circuitry matured, the individual digital chips offered more function, and had more pins for interconnection. The digital interconnections problem went way beyond the previous analog situation. A transistor has three terminals. A resistor or capacitor has two. It is not that difficult to learn how to arrange analog components on a circuit board in order to achieve the desired circuit. Even with the advent of integrated operational amplifiers, the interconnection problems were manageable because an op amp typically had 8 pins. Digital ICs usually started at 14 pins and went up. A 7400, the first part number in TTL logic, contains four logic NAND gates with three pins each, plus two power pins. The interconnections between a field of logic gates is often a chaotic tangle. Those four gates might be used in different parts of the circuit, while the analog equivalent tends more toward a flow from input to output.

To deal with hand-building a digital prototype, a technique called wire wrap was often used. Wire wrap was borrowed from telephone switching circuitry, which also requires a very large number of interconnections. You ended up with a pile of tangled wire, even if you were careful to be systematic. Wire wrap was not fully reliable unless done exactly right, and was hard to rework or troubleshoot. It has mostly disappeared since the 1970's, and is not widely missed.

Once you got your circuit working, and laid it out on a printed circuit board for production, needing all those connections made it hard to pack the logic gates into a reasonable area. Replacing an analog function with a digital function required fitting the equivalent circuitry into something like the same space. Digital couldn't be bulkier if it was going to be seen as better. That's where the data bus came in.

Individual digital packages could contain ever more complex functions, and they could all share a set of generalized parallel circuit traces on a circuit board, but in order to share, the digital circuits needed to be able to get out of each other's way. The means for achieving that cooperation is tri-state outputs.

In a microprocessor-based system, a Central Processing Unit, or CPU, controls the address bus. A particular location is written to the address bus and a strobe is asserted by the CPU that tells the addressed device to read the bits on the data bus, or to write it's own bits to the data bus. Lets dig a little deeper, there.

The device mentioned above would be what is called a peripheral. That is, a circuit that works in concert with the CPU to provide some addition functionality. Lets say it is an external memory register. The register stores the last word that was written to it, and provides that word to the data bus when requested. So, storage resister defines a device. Next, how does the address bus work? In a simple computer system, only the CPU drives the address bus. External devices connected to the address bus are inputs, only. No tri-state needed. Decoders are used to determine which device is being addressed by the CPU. A decoder is basically a multi-bit digital comparator. It takes in a certain number of address lines and compares to a predetermined pattern corresponding to a range of addresses. The ultimate output of an address decoder is a digital signal, or strobe, that says either, yes, the CPU is talking to this register, or no, it is not. In the case of a memory register, there would be a read strobe and a write strobe to tell the register whether to store a word from the data bus or to write the word previously stored to the bus.

Every peripheral device does not need to fully decode the address bus. That would require too many connections and too much redundant logic. Instead, blocks of addresses are decoded together and subsequent decoders separate smaller blocks until an individual address is identified. When a peripheral device is told to write to the data bus, it has to be the only device that is writing at that time. If more than one device is writing simultaneously, the fight between outputs will result in indeterminate data. Everything else on the data bus must be in the tri-state condition for a selected device to write successfully.

So, the tri-state driver is essential for the operation of a data bus, and a data  bus is essential for the operation of generalized, miniaturized digital circuitry. These relatively simple concepts were quickly overwhelmed by more complex enhancements. For example, Direct Memory Access, DMA, was used to allow peripherals to take control of the address bus and read or write to memory independent of the CPU. That was done to increase the speed of data transfers, so the timing all needed to be worked out carefully to avoid extra delay, but also to prevent outputs fighting over the bus. Timing diagrams for early microprocessor systems taking all these details into account can appear to be overwhelmingly complex. Other enhancements involve what are called interrupts, which preempt what the CPU was doing and send it off temporarily to another task. Recently, more function is integrated in with the CPU, so the external interface can seem to simplify.

For perspective, here is a list of microprocessor peripheral devices from a 1980's data book:

DMA Controller
Asynchronous Serial Communications Controller (serial ports)
Counter/Timer
Video System Controller
System Timing Controller
Numeric Data Co-processor
Universal Interrupt Controller 
Hard Disk Controller
etc.

More and more integration has eased the designer's task, and shifted the playing field for how the user interacts with the system, but remember that you can build it all from the ground up by combining three simple logic functions, AND, OR, and NOT. After layer on layer of integration, the personal computer was the most visible result of that evolutionary process. 

Apple and IBM became the main players for personal computers. PCs put the new microcomputers to work for ordinary users. Apple and IBM had different ideas about how to best go about it, which would be a good topic for future treatment here. 


Tom Lawson

March 2022