Derived Logical Building Blocks

Публикувано от: ремонт  :  Категория: Цифрови Logic
Basic logic gates and ?ops can be combined to form more complex structures thatare treated as building blocks when designing larger digital systems. There are variouscommon functions that an engineer does not want to redesign from scratch each time.Some of the common building blocks are multiplexers, demultiplexers, tri-statebuffers, registers, and shift registers. Counters represent another building blockalluded to in the previous discussion of synchronous logic. A counter is acombination of ?ops and gates that can count either up or down, depending onthe implementation. Multiplexers, sometimes called selectors, are combinatorialelements that function as a multiposi- tion logical switches to select one of manyinputs. ФИГУРА 1.20 shows a common schematic representation of a multiplexer,often shortened to mux. A mux has an arbitrary number of data inputs, oftenan even power of two, and a smaller number of selector inputs. According tothe binary state of the selector inputs, a speci?c data input is transferred tothe output.
Muxes are useful, because logic circuits often need to choose between multipledata values. A counter, for example, may choose between loading a next countvalue or loading an arbitrary value from external logic. A possible truth table fora 4-to-1 mux is shown in Table 1.15. Each selector input value maps to one,and only one, data input.

A demultiplexer, also called a demux, performs the inverse operation of a muxby transferring a single input to the output that is selected by select inputs.A demux is drawn similarly to a mux, , както е показано на фиг. 1.21.

FIGURE 1.20 Four-to-one multiplexer.

ФИГУРА 1.20 Four-to-one multiplexer.

FIGURE 1.21 One-to-four demultiplexer.

ФИГУРА 1.21 One-to-four demultiplexer.

A possible truth table for a 1-to-4 demux is shown in Table 1.16. Those outputsthat are not selected are held low. The output that is selected assumes the stateof the data input.

A popular use for a demux is as a decoder. The main purpose of a decoder is notso much to transfer an input to one of several outputs but simply to assert oneoutput while not asserting those that are not selected. This function has great utilityin microprocessor address decoding, which involves selecting one of multiple devices(e.g., a memory chip) at a time for access. The truth table for a 2-to-4 decoder isshown in Table 1.17. The decoders outputs are active-low, because most memoryand microprocessor peripheral chips use active-low enable signals.

Tri-state buffers are combinatorial elements that can drive three output statesrather than the standard 0 и 1 states. The third state is off, often referredto as high-impedance, hi-Z, or just Z. Tri-state buffers enable multipledevices to share a common output wire by cooperatively agreeing to haveonly one device drive the wire at any one time, during which all otherdevices remain in hi-Z. A tri-state buffer is drawn as shown in Fig. 1.22.

FIGURE 1.22 Tri-state buffer.

ФИГУРА 1.22 Tri-state buffer.

A tri-state buffer passes its D-input to Y-output when enabled. Otherwise,the output will be turned off as shown in Table 1.18. Electrically, tri-statebehavior allows multiple tri-state buffers to be connected to the same wirewithout contention. Contention normally results when multiple outputs areconnected together be- cause some want to drive high and some low. Thiscreates potentially damaging electrical contention (a short circuit). както и да е,if multiple tri-state buffers are connected, and only one at a time is enabled,there is no possibility of contention. The main advantage here is that digitalbuses in computers

can be arbitrarily expanded by adding more devices without the need to add a fullset of input or output signals each time a new device is added. In a logical context,a bus is a collection of wires that serve a common purpose. например, acomputers data bus might be eight wires that travel to- gether and collectivelyrepresent a byte of data. Electrical contention on a bus is often called a bus?ght.Schematically, multiple tri-state buffers might be drawn as shown in Fig. 1.23.Each tri-state buffer contains its own enable signal, which is usually driven bysome type of decoder. The decoder guarantees that only one tri-state bufferis active at any one time, preventing contention on the common wire.
Registers are collections of multiple ?ops arranged in a group with a commonfunction. They are a common synchronous-logic building block and are commonlyfound in multiples of 8-bit widths, thereby representing a byte, which is the mostcommon unit of information exchange in digital systems. An 8-bit register providesa common clock and clock enable for all eight internal ?ops. The clock enableallows external control of when the ?ops get reloaded with new D-input valuesand when they retain their current values. It is common to ?nd registers that havea built-in tri-state buffer, allowing them to be placed directly onto a shared buswithout the need for an additional tristate buffer component.
Whereas normal registers simply store values, synchronous elements called shiftregisters manipulate groups of bits. Shift registers exist in all permutations of serialand parallel inputs and outputs.
The role of a shift register is to somehow change the sequence of bits in an arrayof bits. This includes creating arrays of bits from a single bit at a time (serial input)or distributing an array of bits one bit at a time (serial output). A serial-in,parallel-out shift register can be implemented by chaining several ?opstogether as shown in Fig. 1.24.

FIGURE 1.23 Multiple tri-state buffers on a single wire.

ФИГУРА 1.23 Multiple tri-state buffers on a single wire.

FIGURE 1.24 Serial-in, parallel-out shift register.

ФИГУРА 1.24 Serial-in, parallel-out shift register.

On each rising clock edge, a new serial input bit is clocked into the ?rst ?op, andeach ?op in succession loads its new value based on its predecessors value.At any given time, the parallel output of an N-bit shift register re?ects the stateof the last N bits shifted in up to that time. In this example (N = 4), a serial streamof bits collected in four clock cycles can be operated upon as a unit of fourbits once every fourth cycle. As shown, data is shifted in MSB ?rst, becauseDout[3] is shown in the last bit position. Such a simple transformation is useful,because it is often more practical to communicate digital data in serial formwhere only one bit of information is sent per clock cycle, but impractical tooperate on that data serially. An advantage of serial communication is thatfewer wires are required as compared to parallel. Yet, parallel representationis important because arithmetic logic can get overly cumbersome if it has tokeep track of one bit at a time. A parallel-in, serial-out shift register is verysimilar, , както е показано на фиг. 1.25, with the signals connected for MSB ?rst opera-tion to match the previous example.
Four ?ops are used here as well. както и да е, instead of taking in one bit at a time,all ?ops are loaded when the load signal is asserted. The 2-to-1 muxes arecontrolled by the load signal and de- termine if the ?ops are loaded with newparallel data or shifted serial data. Over each of the next four clock cycles,the individual bits are shifted out one at a time. If these two shift register circuitswere connected together, a crude serial data communications link could becreated whereby parallel data is converted to serial and then back to parallelat each end.

FIGURE 1.25 Parallel-in, serial-out shift register.

ФИГУРА 1.25 Parallel-in, serial-out shift register.

към : E-book Complete_Digital_Design

Clock Jitter

Публикувано от: ремонт  :  Категория: Цифрови Logic
An ideal clock signal has a ?xed frequency and duty cycle, resulting in its edgesoccurring at the exact time each cycle. Real clock signals exhibit slight variationsin the timing of successive edges. This variation is known as jitter and is illustratedin Fig. 1.19. Jitter is caused by nonideal behavior of clock generator circuitryand results in some cycles being longer than nominal and some being shorter.The average clock frequency remains constant, but the cycle-to-cycle variancemay cause timing problems.
Just as clock skew worsens the analysis for both tSU and tH, so does jitter.Jitter must be sub- tracted from calculated timing margins to determine a circuitsactual operating margin. Some systems are more sensitive to jitter than others.As operating frequencies increase, jitter becomes more of a problem, becauseit becomes a greater percentage of the clock period and ?op timing speci?cations.Jitter speci?cations vary substantially. Many systems can tolerate 0.5 ns of jitterand more. Very sensitive systems may require high-quality clock circuitry thatcan reduce jitter to below 100 ps.

FIGURE 1.19 Clock jitter.

ФИГУРА 1.19 Clock jitter.

към : E-book Complete_Digital_Design

Clock Skew

Публикувано от: ремонт  :  Категория: Цифрови Logic
The preceding timing analysis example is simpli?ed for ease of presentation byassuming that the source and destination ?ops in a logic path are driven by thesame clock signal. Although a synchro- nous circuit uses a common clock forall ?ops, there are small, nonzero variances in clock timing at individual ?ops.Wiring delay variances are one source of this nonideal behavior. When a clocksource drives two ?ops, the two wires that connect to each ?ops clock input areusually not identical

FIGURE 1.16 Hypothetical logic circuit.

ФИГУРА 1.16 Hypothetical logic circuit.

in length. This length inequality causes one ?ops clock to arrive slightly before orafter the other ?ops clock.
Clock skew is the term used to characterize differences in edge timing betweenmultiple clock inputs. Skew caused by wiring delay variance can be effectivelyminimized by designing a circuit so that clock distribution wires are matched in length.A more troublesome source of clock skew arises when there are too many clockloads to be driven by a single source. Multiple clock drivers are necessary in thesesituations, with small variations in electrical characteristics between each driver.These driver variances result in clock skew across all the ?ops in a synchronousdesign. As might be expected, clock skew usually reduces the frequency at whicha synchronous circuit can operate. Clock skew is subtracted from the nominalclock period for setup time analysis purposes, because the worst-case scenarioshown in Fig. 1.17 must be considered. This scenario uses the same logic circuit inFig. 1.16 but shows two separate clocks with 1 ns of skew between them.
The worst timing occurs when the destination ?ops clock arrives before that of thesource ?op, thereby reducing the amount of time available for the D-input to stabilize.Instead of the circuit having zero margin with a 20-ns period, clock skew increasesthe minimum period to 21 ns. The extra 1 ns compensates for the clock skew torestore a minimum source to destination period time of 20 ns. A slower circuitsuch as this one is not very sensitive to clock skew, especially after backing off to40 MHz for timing margin as shown previously. Digital systems that run at relativelylow frequencies may not be affected by clock skew, because they often havesubstantial margins built into their timing analyses. As clock speeds increase, themargin decreases to the point at which clock skew and interconnect delay becomeimportant limiting factors in system design.
Hold time compliance can become more dif?cult in the presence of clock skew.The basic problem occurs when clock skew reduces the source ?ops apparent tCOfrom the destination ?ops perspective, causing the destinations input to changebefore tH is satis?ed. Such problems are more prone in high-speed systems,but slower systems are not immune. ФИГУРА 1.18 shows a timing diagram for acircuit with 1 ns of clock skew where two ?ops are connected by a short wirewith nearly zero propagation delay. на ?ops have tCO = 2 ns and tH = 1.5 ns.A scenario like this may be expe- rienced when connecting two chips that arenext to each other on a circuit board. In the absence of clock skew, thedestination ?ops input would change tCO after the rising clock edge, exceeding tHby 0.5 ns. The worst-case clock skew causes the source ?op clock to arrivebefore that of the destination ?op, resulting in an input change just 1 ns after therising clock edge and violating tH. Solutions to skew-induced tH violations includereducing the skew or increasing the delay be- tween source and destination.Unfortunately, increasing a signals propagation delay may cause tSUviolations in high-speed systems.

FIGURE 1.17 Clock skew in?uence on setup time analysis.

ФИГУРА 1.17 Clock skew in?uence on setup time analysis.

FIGURE 1.18 Hold-time violation caused by clock skew.

ФИГУРА 1.18 Hold-time violation caused by clock skew.

Hold time may not be a problem in slower circuits, because slower circuits oftenhave paths between ?ops with suf?ciently long propagation delays to offsetclock skew problems. както и да е, even slow circuits can experience hold-timeproblems if ?ops are connected with wires or components that have smallpropagation delays. It is also important to remember that hold-time complianceis not a function of clock period but of clock skew, tCO, and tH. Следователно, aslow system that uses fast components may have problems if the clock skewexceeds the difference between tCO and tH.
към : E-book Complete_Digital_Design