Presentation is loading. Please wait.

Presentation is loading. Please wait.

ECE 352 Digital System Fundamentals

Similar presentations


Presentation on theme: "ECE 352 Digital System Fundamentals"— Presentation transcript:

1 ECE 352 Digital System Fundamentals
Tristates In this presentation, we will discuss logic gates with tristate outputs.

2 Three-State Outputs Three-state (“tristate”) outputs have three possible conditions: 1, 0, high-impedance (hi-Z) The high impedance condition is denoted as Z Z is the lack of a 1 or 0 Output terminal is disconnected from both power and ground High impedance means an open circuit -- it is not connected Cannot drive a “Z” value onto a wire Often used to allow different drivers to share a wire/bus at different times Be careful of contention! Contention occurs when more than one gate drives a wire at the same time Only one driver can be active at a time! A tristate (or three-state) gate output has three possible output conditions. It can output a 0 or 1 like a conventional logic gate, but it can also disconnect its output from the circuit. Impedance is an electrical parameter referring to the difficulty that electricity has flowing through a circuit. The higher the impedance, the harder it is for an electrical current to flow. The highest possible impedance is an open circuit, which means it is not connected. The symbol for impedance is Z, so we refer to the disconnected condition as “hi-Z”. In truth tables, we show this condition using just “Z”. Note that Z is not a logic value – it means that the gate output is not connected to the circuit. We commonly use tristate gate outputs to allow multiple gates to drive a single wire – but NOT at the same time. Contention is what we call two or more gate outputs simultaneously driving the same wire. Contention can destroy a logic circuit, so we NEVER allow more than one driver on a wire to be active at a time.

3 Remember that “Z” is not a logic value!
Tristate Buffer Passes input if enabled, otherwise open circuit (disconnected) Gate Symbol: Truth Table: A buffer is a gate where the output is always the same as its input – it simply repeats the input value. A tristate buffer is a buffer with an enable input. When enabled, the tristate buffer simply drives its output with the same value as its input. When disabled, the output does not drive the wire it is connected to – internally it disconnects itself from the wire. The truth table is written as if Z is the output value when the gate is disabled, but remember that Z is NOT a logic signal – it denotes that the gate has disconnected its output from the wire! Remember that “Z” is not a logic value! Z means DISCONNECTED

4 Using Tristates Example: Can use tristates to select data inputs in a multiplexer We can use tristate buffers and a decoder to implement a multiplexer. Since only one buffer is ever enabled at a time, there is no possibility of contention, and the enabled buffer drives the output with the signal on that data input.

5 Implement Logic With Tristates
Remember – unless told otherwise, a circuit must output 1 or 0 for every input combination Easiest way to ensure this while avoiding contention is to use tristates enabled by a DECODER Otherwise, use tristates in pairs… Examples: F = A K = G·M E = C + D We can use tristate buffers to implement logic functions, but we need to be careful when we do so. It’s important to create an implementation that outputs a 1 for all of the function’s minterms, but it’s also important that the circuit outputs a 0 for all other cases. In other words – the circuit must ALWAYS output a valid logic level. Here are a few examples of building basic logic functions using tristates. In all of these cases, we will use a pair of tristates, enabled by opposite values of the same signal. This ensures that we do not have contention, and that our output is always a valid logic signal. First, we can build the NOT function by using a pair of tristates, where one has an active-high enable and the other has an active-low enable, as indicated by the bubble on the enable input. This is functionally equivalent to having two active-high enabled tristates but using an inverter for one of the enables. We use the input to the NOT function as the enable signal for both tristates, and value-fix the other inputs as shown. When the A input is 1, a 0 is driven by the top buffer and the bottom buffer is disabled. When the A input is 0, a 1 is driven by the bottom buffer, and the top buffer is disabled. We can implement the AND function in a similar fashion. We choose one signal to select which tristate should be enabled – in this case, signal M. When M is 0, the circuit output is 0. When M is 1, the circuit output is equal to G. Convince yourself using Boolean algebra that this results in the AND function. To implement the OR function, we again choose one signal as the select. If the select is true, the result should be true. If the select is false, the result depends on the other signal. Notice that we keep saying that a signal is selecting which tristate should be enabled. This structure, with two oppositely-enabled tristates controlled by a single signal, has the same function as a 2-to-1 multiplexer. Anything you can build out of a set of 2-to-1 muxes you can build with tristate pairs like this, and vice-versa. Also notice that we demonstrated how to build the NOT, AND, and OR functions. This means that a pair of oppositely-enabled tristates is universal, as is a 2-to-1 mux. G 1 A F M K C E 1 D Notice that each of these tristate pairs is a 2:1 multiplexer…

6 More Complicated Functions
Methodology – work backwards from the output Choose one variable as the “last” select Use Boolean algebra to recast the function in terms of sub-functions for the select being true vs. false Repeat on each sub-function Example: Y = A   B  C + B C = B ( A C) + B( C ) = B (F) + B(G) F = A C = A (C) + A(0) What if we need to build something more complex than a simple logic function? Well, we could design it using NOT gates and 2-input AND and OR gates, then replace those gates with the tristate pairs shown on the previous slide. Or we can use Boolean algebra to implement it more directly. Let’s look at an example, where we’ll apply the Boolean algebra method. We first choose one variable to use as a select signal. It can be any of them, but it will usually be easier to choose one that appears in both complemented and un-complemented form in the equation. In this case, we’ll choose variable B. We manipulate the function until we have two sub-functions ORed together: one where B can be entirely factored out, and one where /B can be entirely factored out. In other words, when B is false, Y is equal to /A C, and when B is true, Y is equal to /C. Let F and G represent these two sub-functions. Notice we’re building the circuit backwards from the output. We then apply the same approach to our sub-functions. For sub-function F, we’ll use A as our select. We know what to put on the data inputs of the tristates here because we rewrote the function using Boolean algebra. Unless you’re really comfortable with this, it’s best not to skip this step. Next we implement sub-function G to complete our circuit. It’s much easier to use this divide-and-conquer approach instead of trying to create the whole circuit at once. G = C = C (1) + C(0)

7 What Not To Do What if B = 0? What if B = 0? What if A = 0?
When implementing logic functions using tristates, there are a few common errors people tend to make. You should avoid these. You never want to have a single tristate connected to a wire. What happens if B is 0? Then the output is not a valid logic value. It may be tempting to create this second type of structure when you’re trying to implement an AND function. But if B is 0 the output is not valid. If A is 0, the data input to the second tristate is not valid, so the output of that gate is also not valid. Remember that no input signal on a logic gate is NOT the same as a logic 0. If a gate’s input is not a valid logic signal, the output of the gate is unknown and in fact, it can even destroy the gate. This next circuit has two problems. If B is 1 and A is 0, then the circuit does not drive the output. If B is 0, the enable of the lower tristate isn’t driven; it’s neither enabled nor disabled. Failing to explicitly control the gate with a valid enable signal is not the same as either enabling it or disabling it! Both of these bottom circuits have problems. Note that the circuit on the right may somewhat appear to implement an OR, but it does not. If A and B are both 0, neither circuit drives the output, which is not the same thing as outputting a 0. If A and B are both 1, both tristates are enabled, and contention results. This is obvious problem if C and D are different values, but even when both tristates are driving the same value this is problem. So that’s some examples of what NOT to do. Next we’ll look at what you should do… What if A and B are both 0? What if A and B are both 1?

8 What To Do When building logic functions using tristates:
Make sure every gate input is driven by a valid logic signal (0 or 1) at all times Make sure the output is a valid logic signal (0 or 1) for all possible input combinations Make sure a wire is never driven by two or more tristate outputs at the same time Tristates with connected outputs are normally enabled by a decoder or similar logic Make sure a wire is never connected to only one tristate output When you’re building circuits with tristates, make sure that every gate input is always driven with a valid logic signal. Make sure that the circuit output always produces a valid logic signal. Be sure that exactly one of the tristate outputs connected to a wire is enabled at any given time. This is easy to ensure if the tristate outputs’ enables are driven by a decoder. Don’t have a single tristate connected to a wire. If a single tristate is connected to a wire, it must be enabled at all times, so why have a tristate there at all?

9 ECE 352 Digital System Fundamentals
Tristates This concludes our video on tristates.


Download ppt "ECE 352 Digital System Fundamentals"

Similar presentations


Ads by Google