Файл: Digital design with CPLD applications and VHDL (R. Dueck, 2000).pdf
ВУЗ: Не указан
Категория: Не указан
Дисциплина: Не указана
Добавлен: 13.06.2025
Просмотров: 8176
Скачиваний: 6
5.3 |
• Multiplexers |
191 |
||||||||||||||||
FIGURE 5.39 |
7-Segment |
|||||||||||||||||
Quadruple 2-to-1 MUX as a |
0 |
BCD/7SEG |
Display |
|||||||||||||||
Digital Output Selector |
||||||||||||||||||
D03 |
||||||||||||||||||
1 |
||||||||||||||||||
BCD |
D02 |
|||||||||||||||||
0 |
0 |
a |
||||||||||||||||
D01 |
||||||||||||||||||
b |
||||||||||||||||||
0 |
Y3 |
D3 |
||||||||||||||||
D00 |
c |
|||||||||||||||||
Y2 |
D2 |
d |
||||||||||||||||
1 |
Y1 |
D1 |
e |
|||||||||||||||
D13 |
f |
|||||||||||||||||
0 |
Y0 |
D0 |
g |
|||||||||||||||
BCD1 |
D12 |
|||||||||||||||||
0 |
||||||||||||||||||
D11 |
||||||||||||||||||
1 |
||||||||||||||||||
D10 |
||||||||||||||||||
S |
||||||||||||||||||
EXAMPLE 5.7 |
Draw the symbol for a multiplexer that will select one of four 4-bit channels and direct it to |
|||||||||||||||||
a 4-bit output. Create a VHDL file that implements this function and a simulation showing |
||||||||||||||||||
4 |
D0 |
the operation of the device. |
||||||||||||||||
4 |
Solution |
Figure 5.40 shows the symbol for the 4-channel, 4-bit multiplexer. This sym- |
||||||||||||||||
4 |
bol is shown with the data inputs and outputs in bus form. The data inputs are labelled in |
|||||||||||||||||
4 |
D1 |
Y |
||||||||||||||||
D2 |
groups D0 to D3, which contain the individual inputs [D03..D00] to [D33..D30]. |
|||||||||||||||||
4 |
A VHDL file describing this function is listed below. |
|||||||||||||||||
D3 |
||||||||||||||||||
–— quad4to1.vhd |
||||||||||||||||||
ENTITY quad4to1 IS |
||||||||||||||||||
S1 S0 |
PORT( |
|||||||||||||||||
s |
: IN |
INTEGER RANGE 0 to 3; |
||||||||||||||||
FIGURE 5.40 |
d0 |
: IN |
BIT_VECTOR (3 downto 0); |
|||||||||||||||
d1 |
: IN |
BIT_VECTOR (3 downto 0); |
||||||||||||||||
Example 5.7 |
||||||||||||||||||
4-channel 4-bit MUX |
d2 |
: IN |
BIT_VECTOR (3 downto 0); |
|||||||||||||||
d3 |
: IN |
BIT_VECTOR (3 downto 0); |
||||||||||||||||
y |
: OUT |
BIT_VECTOR (3 downto 0)); |
||||||||||||||||
END quad4to1; |
||||||||||||||||||
quad4to1.vhd |
||||||||||||||||||
quad4to1.scf
ARCHITECTURE mux4 OF quad4to1 IS BEGIN
–— Selected Signal Assignment MUX4: WITH s SELECT
y <= d0 WHEN 0, d1 WHEN 1, d2 WHEN 2, d3 WHEN 3;
END mux4;
Figure 5.41 shows a set of simulation waveforms for the multiplexer. The D inputs are shown in groups of four, the value of each shown as a steady hexadecimal value. The select inputs are grouped, showing an increasing 2-bit binary count as a hexadecimal value (0 to 3, then repeating). As the S inputs select each group of D inputs, their combined value is directed to the Y output group.
5.3 • Multiplexers |
193 |
waveforms from bottom to top, you will see that they generate a repeating binary sequence (000, 001, 010, 011, 100, 101, 110, 111, 000 . . .).
MUX |
|||
D0 |
|||
D1 |
|||
D2 |
|||
D3 |
Y |
||
D4 |
|||
D5 |
|||
D6 |
|||
D7 |
|||
CTR DIV 8 |
|||
S2 |
|||
Q2 |
|||
S1
CLOCK |
Q1 |
|
S0
Q0
FIGURE 5.43
Time-Dependent Selection of Eight Multiplexer Channels
If we connect the counter outputs Q2Q1Q0 to the select inputs of an 8-to-1 MUX, as in Figure 5.43, we will select the channels in sequence, one after the other. The counter is labelled CTR DIV 8 because its most significant bit output has a frequency equal to the clock frequency divided by eight. The triangle on the clock input indicates that it is active when the clock waveform makes a transition from one logic level to another. Since there is no inverting bubble on the clock input, we know that the active clock transition is from LOW to HIGH (i.e., a positive edge).
Waveform Generation. A multiplexer and counter can be used as a programmable waveform generator. The output waveform can be programmed to any pattern by switching the logic levels on the data inputs. This is an easy way to generate an asymmetrical waveform, a task which is more complicated using other digital circuits. The circuit can also generate symmetrical waveforms by alternating the logic levels of consecutive groups of inputs.
EXAMPLE 5.8 |
Draw a circuit that uses an 8-to-1 multiplexer to generate a programmable 8-bit repeating |
||||||||||
pattern. Draw the timing diagram of the select inputs and the output waveform for the fol- |
|||||||||||
lowing pattern of data inputs. |
|||||||||||
D7 |
D6 |
D5 |
D4 |
D3 |
D2 |
D1 |
D0 |
||||
0 |
1 |
1 |
0 |
0 |
1 |
0 |
1 |
||||
Solution Figure 5.44a shows the waveform generator circuit. The output waveform with respect to the counter inputs is shown in Figure 5.44b. This pattern is relatively difficult to generate by other means since it has several unequal HIGH and LOW sequences in one period.
194 |
C H A P T E R 5 • Combinational Logic Functions |
||||||
FIGURE 5.44 |
|||||||
Example 5.8 |
MUX |
||||||
Programmable Waveform |
|||||||
Generator |
D0 |
||||||
D1 |
|||||||
D2 |
|||||||
D3 |
Y |
||||||
D4 |
|||||||
D5 |
|||||||
D6 |
|||||||
D7 |
|||||||
CTR DIV 8 |
|||||||
S2 |
|||||||
Q2 |
|||||||
CLOCK |
S1 |
||||||
Q1 |
|||||||
S0 |
|||||||
Q0 |
|||||||
Q0
Q1
Q2
Y
EXAMPLE 5.9 |
The programmable waveform generator in Figure 5.44 generates a symmetrical pulse |
|||||||||
waveform having a frequency of 1 kHz when the data inputs are set as follows. |
||||||||||
D7 |
D6 |
D5 |
D4 |
D3 |
D2 |
D1 |
D0 |
|||
0 |
0 |
0 |
0 |
1 |
1 |
1 |
1 |
|||
How should the switches be set to generate a symmetrical 2 kHz waveform? A symmetrical 4 kHz waveform?
Solution
Pattern for 2 kHz:
D7 |
D6 |
D5 |
D4 |
D3 |
D2 |
D1 |
D0 |
0 |
0 |
1 |
1 |
0 |
0 |
1 |
1 |
5.3 • Multiplexers |
195 |
Pattern for 4 kHz:
D7 |
D6 |
D5 |
D4 |
D3 |
D2 |
D1 |
D0 |
0 |
1 |
0 |
1 |
0 |
1 |
0 |
1 |
Time Division Multiplexing
K E Y T E R M S
Time division multiplexing (TDM) A technique of using one transmission line to send many signals simultaneously by making them share the line for equal fractions of time.
Time slot A period of time during which a transmitted data element has sole access to a transmission path.
Bit multiplexing A TDM technique in which one bit is sent from each channel during the channel’s assigned time slot.
Byte (or word) multiplexing A TDM technique in which a byte (or word) is sent from each channel during its assigned time slot. (A byte is eight bits; a word is a group of bits whose size varies with the particular system.)
Time division multiplexing is a method of improving the efficiency of a transmission system by sharing one transmission path among many signals. For example, if we wish to send four 4-bit numbers over a single transmission line, we can transmit the bits one after the other, as shown in Figure 5.45.
p00 |
p10 |
p20 |
p30 |
p01 |
p11 |
p21 |
p23 |
p33 |
p00 |
FIGURE 5.45
4 4 Data Stream (Bit Multiplexing)
In Figure 5.45, we see the least significant bit of the 4-bit word p0 transmitted, followed by the LSB of p1, p2, then p3. After that, the second bit of each word is transmitted in sequence, then all the third bits, and finally, all MSBs in sequence. Each bit is assigned a time slot in the sequence. During that time, the bit has sole access to the transmission line. When its time elapses, the next bit is sent and so on in sequence, until the channel assignment returns to the original location. This technique, known as bit multiplexing, can be implemented by a circuit similar to the waveform generator shown in Figure 5.44. Rather than fixed switch inputs, the data inputs would be some data source, such as a digitized audio signal.
We can also arrange our circuit so that one byte (8 bits) or one word (a group of bits) is sent through a selected channel. In this case, we must keep the channel selected for enough clock pulses to transmit the byte or word, then move to the next one. This technique is called byte (or word) multiplexing. Figure 5.46 shows a data stream of four 4-bit words that are word-multiplexed down a data transmission path.
p00 |
p01 |
p02 |
p03 |
p10 |
p11 |
p12 |
p32 |
p33 |
p00 |
FIGURE 5.46
4 4 Data Stream (Word Multiplexing)