Lab 2

advertisement
CpE 272 Digital Logic Laboratory
Lab #2
Multiplexers and De-Multiplexers
Fall 2007
Part 1 - Multiplexers:
A multiplexer is a device that combines signals together into single output. The
Multiplexer that we will use today (the DM74ALS151) is basically an electronic switch
bank that you can use to choose various binary inputs to pass along to a single binary
output. While there is no common schematic symbol for a multiplexer like there was for
the logic gates you used last week, you can still draw it schematically (you just put the
part name inside a box instead). Just like you drew the schematics last time you will still
be labeling inputs and outputs, but there will also be a new type of input that will be
added called control input. Control inputs are inputs that control how a device operates
and can change the way it behaves on the other inputs it receives and also the outputs
that it will generate. In a schematic the control inputs are usually labeled on the bottom
of the box and on our particular Multiplexer (the DM74ALS151) the schematic should
look like this:
This particular multiplexer is called an 8-to-1 multiplexer. As you can see from the schematic
there are eight “data inputs” but there are two “data outputs”, the second output (W) is
actually the negative of the first output (Y) so you can think of both outputs as the same just
negatives of each other. This is were the “8-to-1” comes from, if you wanted to have a larger
amount of inputs then you could have a 16-to-1 multiplexer there are many different
variations, but the number of inputs will always be a power of two (2, 4, 8, 16,….). Another
thing to notice is the new “control inputs” added on the bottom of the schematic. An
important one to take note of now is the Enable (or Strobe on this chip) pin. This pin enables
the chip so that it will operate the way it should. To do so it needs a LOW logic signal always
going into this particular pin of the chip, otherwise the chip will not be enabled and will
always generate the same output (Y=LOW) no matter what the inputs are. So always have a
wire coming from Ground into the Enable pin of this chip. You will see some other chips that
have this same exact pin on it throughout this lab, and many of them behave the same exact
way but some don’t so you should always check the datasheet to make sure.
Once the enable pin is set to ground then this device is ready to be used, and how this device
operates is pretty simple. The three control inputs called “select inputs” are used to select one
of the eight “data inputs” and will then pass on whatever binary input that particular pin has
to the output pin Y (and its negative to W). The mapping for the combinations of the “select
inputs” is the same as the values in a binary number system equivalent to the decimal number
labels used for the “data inputs” on the schematic. With C of the “select input” bits being the
MSB (most significant bit) with B following and A being the LSB (least significant bit) the
mapping follows this table.
It can be observed from this table that when a pin is selected whatever binary input that is on
that pin will become the output for the multiplexer. The output will change from one of two
possible changes, either the input on the selected pin is changed or the “select inputs” change
and a new input is selected. If you notice the “control inputs” part of the table looks exactly
like a three input truth table and the output column does not have actual binary values like
last lab, but instead there symbols that will be replaced with binary symbols once the “data
inputs” have been applied to the chip.
We can use this fact to our advantage when implementing a logic function. By wiring the
data inputs to HIGH and LOW signal any three input function can be implemented with this
particular multiplexer. If we wanted to make a three input AND gate, then we would wire
pins D0-D6 to LOW (Ground) and pin D7 to HIGH (5 V). Replacing the Symbols D0-D7
with theses binary values we get the truth table:
As you can see this is the same truth table as a three input AND gate. Any variation of this
truth table can be implemented by an “8-to-1” multiplexer (for more inputs you need a larger
multiplexer). In this part of the lab you will get accustomed to the multiplexer and try
implementing some functions with it.
Test 1:
Hook up the 74151 as shown by this except form the datasheet.
After connecting power, take two pieces of wire and connect the outputs Y and W to LEDs
then connect the eight “data inputs” to 5V from the power supply on the top row of the
breadboard with wire. Connect the three “select inputs” C, B, and A to switches. Then
connect the Strobe pin to 5V. Switch through all eight combinations of the “select inputs”.
Notice that the output never changes; switch some of the “data inputs” to Ground to further
prove that if the enable pin is not connected to Ground then this device will not operate
correctly. Now connect the Strobe pin to Ground and see how know the chip will work as
described before. Continue on to the next section. Include the truth table for the Multiplexer
along a schematic with pin numbers labeled also with the pin names (i.e. S (Strobe), E
(Enable), D0, Y, etc) for you lab report.
Test 2:
Connect the data inputs like so. Connect pin D0 5V and pins D1 to D7 to Ground. Go
through all the combinations and fill out the truth table below.
What Function did you implement? Include this truth table along with you answer to this
question in your report.
Test 3:
Now implement the logic function Y = AB + C by using the multiplexer. First fill out a truth
table for this function, then hookup 5V to data inputs that need logic HIGHs and Ground to
pins that need logic LOWs. Go through all the combinations of the select inputs and
demonstrate to you instructor when you are done. Include the truth table you derived along
with a schematic of the logic function Y = AB + C in your report.
Part2-Demultiplexers:
De-Multiplexers are used to select (read: enable) other chips. Normally used to address
memory, you can also use them to select chips so that they operate only when you want them
to. These chips (the DM74ALS138) have only control inputs. They still have the enable
inputs and the select inputs, just no data inputs this time. There are three enable inputs on this
chip now called G1, G2A’, and G2B’. G1 must be connected to logic level high and both of
the G2’s need to be connected to ground for this chip to be enabled. The three select pins are
called the same and follow the same order C,B,A.
The way this chip works is that the select pins now select which output you will be effecting.
Just like the multiplexer, the select pins represent a binary number that is equivalent to the
decimal labels given to the pins on the datasheet. So with C = 1, B = 0, and A = 1 then the
“data output” called pin Y5 would be the pin in question. What would happen, given the
enable pins are correctly hooked up, is that pin Y5 would give an output of LOW while the
rest of the pins would read HIGH. You may be asking shouldn’t it be the other way around
where pin Y5 should be high and the rest are LOW. And on some chips they are like that, but
this method is used because most enable pins need low signals so that is why you will usually
see De-Multiplexers that work like this. This excerpt from the data sheet shows the truth table
and the wiring diagram.
Test 1:
First apply power and hook up the enable pins as described above. Then hook switches to
the select inputs of the de-multiplexer. Finally hookup up all eight data outputs to LEDs.
Verify the truth table and include it in your report with a schematic diagram of the
DeMultiplexer along with pin numbers labeled also with the pin names (i.e. G1, G2A’, Y0,
etc).
Test 2:
You can also implement logic functions with a De-Multiplexer. What you would do is
first fill out the truth table for your desired function, for this example we will use this
one:
We know that A*0 = 0, and that whatever the De-Multiplexer select inputs are equal to that
the corresponding data output pin will be equal to zero. What we will do is connect every
corresponding pin that has a combination from the truth table that equals zero and AND all
the signals together. Schematically we would implement this truth table as shown below:
Hook up this schematic and verify the truth table above. Now implement this truth table
with a De-Multiplexer and show your instructor when you are done.
Include a schematic of how you wired the De-Multiplexer for this last truth table along with
what type of basic logic gate this truth table represents in your lab report.
Test 3:
Now implement the logic function Y = A’ + BC by using the De-Multiplexer. Show your
instructor when you are done.
For your report include the truth table you derived along with a schematic of both the logic
function Y = A’ + BC itself and the schematic for how you hooked up the DeMultiplexer.
Download