Topic Finder for Chapter 4
Introduction
The 7442 Decoder
Sequencer Circuits
Anything Select Pulse Circuit
ASP and Sequencer Operating
Characteristics
A Motor Control Application
Example
The 74138 Decoder
The 74139 Decoder
Chapter 4 Overview
Review Questions
List of Figures
Figure 4.1 Pinout for
7442 Decoder
Figure 4.2 Simple Sequencer
Circuit Example
Figure 4.3 "Anything
Select Pulse" Cirucit Example
Figure 4.4 74138 Decoder
Pinout
Figure 4.5 74138 as Memory Chip Select Pulse
Circuit
Figure 4.6 Example of 74136 as Memory ChipSelector
Figure 4.7 Additional Example of 74136 Memory
Chip Selector
Introduction
The counter
has a variety of roles to play with respect to process control. It
is also important to realize that a counter such as the 74161 is a device
that records an event by expressing (creating) a specific binary pattern
at its output pins because some event has generated a square wave signal
at its CK input pin. For example, if the counter is monitoring a
flow totalizer that generates
a pulse for every gallon of fluid that is pumped into a tank, it will produce
a series of binary patterns that correspond to base 2 numbers that represent
the number of gallons of fluid pumped.. This is certainly the fundamental
idea of a counter but there is an alternate way to look at the same situation.
For the current example, the counter is encoding the pumping process
by producing a binary code value for the total number of gallons being
pumped as a function of time. Specifically, after the first gallon
of fluid was pumped the counter encoded the event by presenting the binary
pattern 0001 on its output pins. After the second gallon of fluid
was pumped, the counter encoded the new status by presenting the binary
pattern 0010 on its output pins. It is useful to keep this alternate
view in mind. Counters certainly count but they also serve as encoders.
Naturally, once you realize that some event has been encoded, in this case
the number of gallons pumped has been represented by a binary code, then
you will appreciate that it is important to have access to a decoder.
This chapter will discuss decoders and their applications in control schemes.
The decoder is a very versatile device.
Once you become familiar with digital circuit diagrams and are comfortable
reading them, it is always fun to examine then to see if a decoder is used
and how it is applied. This discussion will focus on just two general
applications for decoders. The first is the sequencer while the second
is the "Anything Select Pulse", ASP, circuit. Before any discussion
of these two ideas, the general operation of the TTL decoder will be presented.
The 7442 decoder was the first TTL decoder produced and is a good example to use in an initial explanation of what a decoder does. Figure 4.1 provides the pinout for the 7442. The device has four input pins, pin 12, pin 13, pin 14 and pin 15. These pins correspond to inputs D, C, B and A, respectively. The chip has 10 output pins, pin 1, pin 2, pin 3, pin 4, pin 5, pin 6, pin 7, pin 9, pin 10, and pin 11 which correspond to output channel numbers 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9, respectively. Like the other devices described earlier, the pin numbers on the 7442 drawing are located on the outside of the diagram. The pin function assignment labels are on the inside. This is a common device pinout notation practice although it is by no means a standard practice.
Dealing with the decoder pin numbers and their corresponding channel numbers can be confusing. If care is not take to distinguish one from the other problems often develop when wiring the device or trouble shooting circuits that contain it. It may be helpful to remember the simple fact that pin number 0 does not exist. Therefore, the side of the diagram that has the 0 label must be the side of the diagram that indicates the channel number. For the illustration in Figure 4.1, the 0 label is in the inside and indicates that pin 1 is assigned the channel 0 function.
Table 10 summarizes, the operation of the 7442. This table should clarify the role of inputs D, C, B, and A, i.e pins 12, 13, 14, and 15, respectively, with respect to the consequences those inputs have on a specific output channel. The first row of the table indicates that if the pattern 0 1 0 1 is presented to the 7442 inputs, then one output pin, pin 6, goes to 0. All of the rest of the output pins remain at 1. (Please remember that in these discussions 0 means logic zero and for TTL devices corresponds to 0 volts. Likewise, 1 means logic 1 and for TTL devices corresponds to 5 volts.)
The second row of Table 10 suggests that if the pattern 1 0 0 0 is placed on inputs D, C, B and A, respectively then output channel number 8, pin 10, goes to 0 while all of the other output channels remain at logic 1. Thus the 7442 decoder is constructed so that when a pattern appears on its input pins one specific output channel changes logic state. Basically, a decoder examines incoming pattern or codes, deduces what number the pattern represents and then changes the logic of the selected channel. For the 7442 and other TTL decoders the selected channel always goes to 0 while all the remaining un-selected output channels stay at logic 1.
A close examination of Table 10 reveals that the 10 possible four bit binary patterns from 0 0 0 0 through 1 0 0 1 correspond to the 10 available channels from 0 through 9. In addition, there are also five extra patterns from 1 0 1 0 through 1 1 1 1. Any one of these last five codes could be delivered to the input pins of the 7442 however, no output channel will be selected when that happens. For example, if the input pattern 1 1 0 1 is placed on inputs D, C, B, and A respectively, the 7442 would be expected to bring output channel #13 to logic 0. Since output channel #13 does not exist on this device, no 7442 output channel will go low and all of the channels will remain at logic 1.
Figure 4.2 has an illustration of a simplified sequencer circuit that uses a 7442 as the sequencing device. The circuit uses the 74161 to generate the sequential code patterns to be delivered to the D, C, B and A inputs of the 7442. Each of the output channels is connected to the input of a 7404 invertor device and the output of each invertor goes to the input terminal of a solid state motor ON/OFF control circuit. These 10 separate motor ON/OFF circuits are not drawn here however, the reader might realize that a minor modification of the solid state ON/OFF circuit sketched out in Figure 1.2 could easily be used in this application.
The specific modifications to the circuit in Figure 1.2 will be discussed later. For now, it should be easy to see from Figure 4.2 that as the counter responds to an incoming clock pulse the counter's outputs sequence through an increasing progression of 4 bit binary numbers. These patterns are presented as inputs to the decoder which recognizes them as the numbers 0 through 15. As each number from 0 through 9 is recognized the corresponding channel number goes to logic 0. This 0, in turn, is delivered to the input of a 7404 and ultimately becomes a logic 1 at the input terminal of the solid state ON/OFF control circuit. If, for the example in Figure 4.2, the last clock pulse delivered to the 74161 placed 1 0 0 1 on output pins 11, 12, 13 and 14, respectively, the 7442 senses this pattern and then forces channel 9, pin 11 on the 7442, to 0 which, in turn, forced pin 12 on the 7404 to logic 1. Therefore, solid state ON/OFF motor control circuit #9 is turned on while all of the other motor ON/OFF circuits remain off.
The reader should be able to anticipate what will happen when the next clock pulse shows up at pin 2 of the 74161. The counter will output the binary pattern for the number A. (Remember you are supposed to be able to easily count in base 2, base 8 and base 16. It is presumed that you can already count in base 10.) This forces the decoder to bring channel number 12, (base 8 of course), to logic 0. However, since the 7442 does not have a channel number 1010, (base 2 as you might have guessed), all of the channels will stay at logic 1. Under these conditions, the input to solid state ON/OFF motor control circuit # 9 will return to logic 0 and motor number 9 will stop running. In fact, in Figure 4.2, all of the motors attached to the motor ON/OFF circuits will remain off while the counter cycles through the remaining output patterns that correspond to base 16 numbers B, C, D, E, and F.
An example of an "Anything Select Pulse", ASP, circuit is shown in Figure 4.3. To reduce the clutter in the diagram so that the idea is presented more succinctly, the 74138 decoder is substituted for the 7442. The pinout for the 74138 is provided in Figure 4.4 and Table 11 presents its function table. But before checking them out, see if you can determine how the 74138 operates by examining the diagram in Figure 4.3.
The ASP in this example is constructed from a 74138 decoder, a 7408 AND and a 7404 Invertor package. Table 11 provides a summary of output pin responses for the 74138. The wires connected between the panel switches and input pins 1, 2 and 3 of the 74138 are identified as address wires. (A collection of address wires is known as an address bus.) The wire between the S4 panel switch and the AND input is called a control wire. (A collection of control wires is known as a control bus). When a selected address pattern is placed on the address bus and the control line is brought to logic 1, the selected motor control ON/OFF circuit permits the selected motor to run.
ASP and Sequencer Operating Characteristics
The ASP circuit in Figure 4.3 has a similar function as the sequencer circuit in Figure 4.2. Both circuits are used to start and stop selected motors one at a time. However there are a different set of rules or constraints being used in each of these circuits.
The motors controlled by the sequencer in Figure 4.2 start and stop according to a fixed sequence as set by the string of output 4 bit patterns that are generated by the 74161 counter. These output patterns are known ahead of time. If the current pattern is 0 1 0 1, then it should be no surprise that motor #5 is on and the next clock pulse at pin 2 of the 74161 will produce 0 1 1 0 as the counter output pattern. Therefore, motor #5 will stop running and motor #6 will begin to run.
By contrast, the ASP circuit in Figure 4.3 forfeits this sequential predictability and substitutes it with the ability to randomly select the motor that is to be started. Of course, this is not a random choice from the engineer's perspective. It is the operational sequence for the set of motors that matches the specific process application the engineer has in mind. For example, if the process calls for motor #2, then motor #0, then motor#2 and finally motor #1 to run, such an operation protocol would not fit the sequencer circuit in Figure 4.2 but is an easy assignment for the ASP circuit in Figure 4.3.
A Motor Control Application Example
Table 12 summarizes the operator actions for the motor control operation suggested above. To appreciate how a computer controls a motor review Figure 4.3 and follow the four steps suggested in the table. For now assume that you are the computer in the sense that you will manipulate the switches. Later we will see how the switches can be removed so that a computer can supply the voltages that are needed to run the control scheme.
The first step in the process is to operate motor #2. The three parts to step one are listed in the left hand column of Table 12 as Step 1A, 1B and 1C. The initial task in Step 1 is to pick motor #2. This selection is accomplished by manipulating control panel switches S2, S1 and S0 so that 0V, 5V, and 0V show up on 74138 input pins 3, 2, and 1, respectively. The pattern 010 on these address wires forces 74138 pin 13 to 0. This ultimately brings invertor output pin 6 to logic 1. Although this logic 1 state is delivered to AND input pin 13, motor #2 remains off. Once the operator moves S4 to the OPEN position so that a logic 1 appears on the control wire, motor #2 will start. Step 1C and step two of Table 12 give the operator action to continue the process. To stop motor #2, return S4 to the CLOSED position.
The next process action is to start motor #0. Place S2, S1 and S0 in their 0V, 0V, and 0V positions and then move S4 back to its OPEN position. These actions will put 000 on the address bus and select but not start motor #2. Return the control line, S4, to logic 1 allows motor #0 to start. For the third process step motor #0 is stopped when S4 is moved to logic 0 position. The address 010 is put on the address bus and motor #2 starts again when S4 is returned to logic 1. Once the process is ready for its final step, the control wire is returned to 0, the address is changed from 010 to 001 and then motor #1 is started as the control line is toggled back to logic 1.
In this example it was not necessary for the operator to turn S3 to the logic 0 state before the address was changed. Motor #2 would turn off and motor #0 would turn on if S4 was left at logic 1 and address switches S2, S1 and S0 were changed from 010 to 000. Please remember that Figure 4.3 represents a simplified ASP circuit and actual ASP circuits would not allow one motor to turn off just because the pattern on the address bus was changed.
The ASP circuit idea is used in a variety of digital process control circuits as well as computer interface circuits. The idea is only introduced at this point. It will be reviewed and expanded upon as more circuits are explored. For now, there are two points to retain.
First, an ASP circuit allows humans or computers to select and operate any motor in any random order that is desired.
Second, the ASP uses a pattern on an address bus combined with a logic 1 or logic 0 on a control line to start or stop a selected motor.
Figure 4.4 presents the 74138 decoder pinout. Pins 3,2 and 1 correspond to inputs C, B and A respectively. This is an octal decoder. There are eight possible input patterns, 000 through 111, and eight possible output channels, 0 through 7, to be selected. The 74138 functions just like the 7442. The complete 74138 decoder function table is provided in Table 13. If the pattern 010 shows up on pins 3, 2 and 1 then channel 2, pin 13, goes to 0. Unlike the 7442, the 74138 has three enable pins. Table 13 summarizes the operations of the 74138 and suggests that the chip holds all of its output channels at logic 1 unless the 74138 detects the proper logic signals on its enable pins. Unless pin 6, E1, AND pins 4, E2A, OR 5, E2B, are at logic 1 the decoder will not function. Thus if the logic pattern 1 0 1 or 1 1 0 is placed on pins 6, 5 and 4, respectively then the 74138 will respond to a pattern on inputs C, B and A by selecting an output channel and bringing that channel to a logic 0 state.
These enable pins provide the 74138 increased versatility by allowing different conditions to enable the 74138's decoding function. For example, if E1 is wired to a process START/STOP switch and the E2A and E2B are each wired to emergency ON/OFF switches located at two different places in a plant, then any motor could be stopped and none of the motors permitted to start if either of the emergency switches were moved from its 5V position to its 0V position.
There is one more important decoder that is actually very popular for a variety of interface activities. This is the 74139. The 7439 is a TTL package that actually contains two identical decoders. This is not unusual for TTL packages. In fact, there are six identical devices in that 7404 package.
The 74139 package contains two decoders. Each of these decoders has two address lines and four output pins. The input address lines for one of the decoders is labeled 1A and 1B. The input pins for the other decoder are labeled 2A and 2B. The output pins that are selectable because of a logic pattern on 1A and 1B are identified as 1Y0, 1Y1, 1Y2 and 1Y3. The output pins that are selectable because of a logic patten placed on the 2A and 2B input pins control the selection of the output pins identified as 2Y0, 2Y1, 2Y2, 2Y3. Table 13 summarizes these operations and indicates the status of the 1G ENABLE and 2G ENABLE pins. At this point, you should be able to predict the function of these pins before you review Table 14.
One of the decoders in the 74139 package is used in Figure 11.3. The circuit shown in Figure 11.3 is for the interface of a computer to its key board and its display device. There are many important digital interface principles involved with that figure. Each will be discussed in detail as the course progresses. However, for now please examine the figure and locate the 74139 in the diagram. Perhaps you can identify the part of the diagram that represents the key board. It actually should be easy to find the part of the diagram that represents the display.
The 74139 is also useful as a learning tool to practice the use of the base 16 numbering system (HEX)to mentally represent a 16 bit binary pattern. Figure 4.5 shows several 74139 decoder devices that are used in a computer interface to memory chips that the computer's microprocessor needs to function properly. At this point, the role of the memory chips let alone the microprocessor is not expected knowledge on the reader's part. However, the ability to determine the binary pattern that will place a zero on the active low memory chip pins labeled PO/PGM is. In addition it is important to express that 16 bit binary pattern as 4 HEX digits. (At this point, it will be easier to assign the value of zero to each of the address lines from A0, through A11. this will not always be the case but it is easier now since the point of this exercise is to just reinforce the function of the decoder.)
It is impossible to say which digital
device is the most important for the sucess of digital electronics.
However, the decoder is on the short list of most important players.
(Actually, all of the digital concepts are most important players and it
does not make much difference which package they come in.). This
chapter deals with the decoder and some of its applications. The
chapter deals with the ideas associated with sequencers as controllers.
It also introduces the very useful concept of an "anything select pulse
circuit". It will present a motor control application that uses the
human action of setting switches to provide inputs to a decoder driven
sequencer. Finally, the reader is introduced to the 74138 and the
74139. Attention is focused on the 74139 because of its historic
use in device select pulse circuits for computers and process controllers.
This chapter should be reread as the reader's knowledge base about digital
technology and its role in process control matures.
4. 1 What channel goes low on the 7442 if the pattern 1111 is placed on its input pins?
4. 2 Examine Table 11 and Figure 4.4. Draw a function diagram for a 74138 circuit that will perform like the circuit shown in Figure 4.2.
4. 3 Assuming that the counter in Figure 4.2 was initially cleared, what will happen when pulse "c" is detected by pin 2 of the 74161?
4. 4 Examine Figure 4.3. What are the switch positions, OPEN or CLOSED, if
a) Motor # 2 is to be turned ON? S4S2S1S0
b)Motor # 6 is to be turned ON? S4S2S1S0
c)Motor # 0 is to be turned ON? S4S2S1S0
4. 5 Examine Figure 4.3. What is the sequence of switch positions, OPEN or CLOSED, for the following sequence of events. Motor # 2 is turned on, then Motor # 0 is turn on, then Motor # 6 is turned on and then Motor # 4 is turned on.
S4S2S1S0
4.6 Examine Figure 11.3 and draw the Decoder
pinout for the 74139. ( Indicate the pins that can not be assigned to a
device function. See Figure 4.4 for an example of a Decoder Pinout diagram.
4.7 Examine Figure 4.6 and determine the 4 digit HEX numbers that represent the 16 bit binary patterns that will bring the active low pin, PO/PGM, of chip U21 low.
4.8 Examine Figure 4.7 and determine the
4 digit HEX numbers that represent
the 16 bit binary patterns that will bring the active
low pin, PO/PGM, of chip U22 low.