Building Logic Function with 74LS151 and NAND Gates?

In summary, A group of individuals were discussing a logic function problem involving an equation and how to build it using one 74LS151 8-to-1 multiplexer and NAND gates. The conversation included different solutions and approaches, with one participant asking for clarification and another providing a simpler solution. The conversation ended with everyone thanking each other for their help and a participant expressing gratitude for clarifying the problem.
  • #1
vptran84
46
0
Hello all,

I'm having trouble with this certain problem...

Given: f(A,B,C,D) = AB'D' + B'C'D' + A'B'CD' + ACD + AB'C'D'

How do I build this logic function using one 74LS151 8-to-1 multiplexer and NAND gates?

Any help would be appreciate. I just need to be pointed in the right direction. THanks in advance.
 
Engineering news on Phys.org
  • #2
Is this for a class assignment?

KM
 
  • #3
Yes sir, There were like 3 parts to this question, but i figured out the first 2. THis third part is the one that's giving me a huge headache. I'm just a beginner and I'm not used to this whole "stuff".
 
  • #4
First, try to simplify the equation. You can factor out a B'D' out of all but one term in the equation. You'll find that what's left of those four terms can then be very simplified.

(Post your progress here so I can verify your work.)

You're left with a very simple equation that should be quite easy to map into an 8-to-1 multiplexer. Consider using (AC)', B, and D as inputs to the multiplexer. You then just tie each of the eight inputs high or low to get the function you want at the output.

- Warren
 
  • #5
Look at the equation analytically. If you apply DeMorgan's law, etc. that equation can be reduced from five terms to just two. Then it can be handled with just three Or gates, or three NOR gates and four Inverters, or three NAND gates and four inverters.

The multiplexer isn't really needed. What you could do with it then is the following. Note that B' occurs that way in each term in which it appears. Thus you could use B' to enable the Multiplexer and just the four terms in which it is used to determine multiplexer inputs (ie. ACD => 000, 001 --- 110, 111). Use A, C, and D then to drive the mux (making sure that if A is the 'high order' bit in your table it is also used to drive the high order input to the mux. Thus, you'd have:
ACD' = 110
AC'D' = 100 (These first two make up the AB'D' term, with B' dropped)
AC'D' = 100
A'C'D' = 000 (these make up the B'C'D' term, notice the redundancy)
A'CD' = 010 (This makes up the A'B'CD' term)
AC'D' = 100 (This makes up the AB'C'D' term, again notice the redundancy)
Then for each of the values above, simply tie that (data) input to the multiplexer (there are four, the even values) up to Vcc (through a resistor; and ground the other four. Take the A, C and D lines also to a three-input NAND (in order to get the ACD term). Now, I am assuming the 74LS151 to have a 'non-inverting' output (I don't have the specs with me). If so, take the mux output along with the inversion of the B' input to another NAND; if not, leave it out. Finally, take the output from the mux, and from the just described NAND gate to another NAND.

Hope you can follow. Sorry I don't have the mux specs.

KM
 
  • #6
KM,

Your solution, while perhaps workable, is not the simplest. All you need is a single two-input NAND and the 8-to-1 mux's inputs. You don't need to use enables or anything else.

- Warren
 
  • #7
i simplified the boolean equation and this is wat i got:

B'D' + ACD

is that correct?
 
  • #8
vptran: yep, that's what I got too. Now, can you see an easy way to map that into the select pins of an 8-to-1 multiplexer?

- Warren
 
  • #9
i drew up the truth table of the boolean equation and i got 1's at 0000, 0010, 1000, 1010, 1011, 1111.

So do i just put 1's at those numbers? and ground the rest?
 
  • #10
Well, the 8-to-1 multiplexer only has three select bits -- it's not a 16-to-1. So you'll need to use a NAND gate to combine two of your inputs into one first.

- Warren
 
  • #11
ok, so i used A C D as the inputs where A is the most significant bit. For B, i put it into a 2 input nand gate, which gives B' and connect that to Do, D2, D4, D6...for the rest, i grounded them. I guess it is becuase B is the one that controls the mux?? Can you tell me if I am on the rite track?
 
  • #12
You are good as far as you go, but what about the ACD case. You'll need one more wire for that. Also don't forget to ground the enable. This is a clever approach. The one I gave required two NANDs to handle the ACD case.

KM
 
  • #13
As I've already said, use (AC)' as one of the select bits. Use B and D as the other two.

One NAND, one 8-to-1 mux, no need for enable logic.

The problem with the enable, Kenneth, is that it does not ground the outputs; it turns off the output drivers, putting them into the high-impedance (tri-state) state. You'd then have to add pull-up or pull-down resistors on the outputs. So now you're stuck with pull-up resistors and two NANDs, one of which is three-input -- a weird beast.

Basically, your solution is "clever" insofar as "clever" is a synonym for "pretty bizarre." There are better and cleaner ways to do it, as I have explained.

- Warren
 
  • #14
vptran:

As I've said, use (AC)', B, and D as the select inputs to your mux, and you're done.

- Warren
 
  • #15
Unfortunately, I didn't have the specs for the 151 and tried to do it from memory. That's never totally safe.

KM
 
  • #16
Thank you for both of your help. YOu've cleared up some of the "stuff" that was a little unclear to me. Thank you!
 
  • #17
I'm bringing up again a discussion from which my participation was interrupted a while back when I lost my primary Internet access. I was going from dial-up to DSL, and ran into all kinds of mishaps, but that I'd rather not go into. The original problem statement went as follows:

vptran84 said:
Logic Function Using 74LS151
Hello all,
I'm having trouble with this certain problem...

Given: f(A,B,C,D) = AB'D' + B'C'D' + A'B'CD' + ACD + AB'C'D'

How do I build this logic function using one 74LS151 8-to-1 multiplexer and NAND gates?

Any help would be appreciate. I just need to be pointed in the right direction. THanks in advance.


Kenneth Mann said:
What you could do with it then is the following. Note that B' occurs that way in each term in which it appears. Thus you could use B' to enable the Multiplexer and just the four terms in which it is used to determine multiplexer inputs (ie. ACD => 000, 001 --- 110, 111). Use A, C, and D then to drive the mux (making sure that if A is the 'high order' bit in your table it is also used to drive the high order input to the mux. Thus, you'd have:
ACD' = 110
AC'D' = 100 (These first two make up the AB'D' term, with B' dropped)
AC'D' = 100
A'C'D' = 000 (these make up the B'C'D' term, notice the redundancy)
A'CD' = 010 (This makes up the A'B'CD' term)
AC'D' = 100 (This makes up the AB'C'D' term, again notice the redundancy)
Then for each of the values above, simply tie that (data) input to the multiplexer (there are four, the even values) up to Vcc (through a resistor; and ground the other four. Take the A, C and D lines also to a three-input NAND (in order to get the ACD term). Now, I am assuming the 74LS151 to have a 'non-inverting' output (I don't have the specs with me). If so, take the mux output along with the inversion of the B' input to another NAND; if not, leave it out. Finally, take the output from the mux, and from the just described NAND gate to another NAND.

Hope you can follow. Sorry I don't have the mux specs.

KM
Actually, this circuit could have tied either the first four inputs to Vcc, or the even inputs, etc. depending on how the ACD inputs are arranged. If the ACD inputs go in reverse order (DCA), what you would get is that shown in figure 3 of the accompanying attachments. This is the way I described them above. In hindsight I would have done it in forward order; it is a bit clearer.
chroot replied as follows:
chroot said:
KM,

Your solution, while perhaps workable, is not the simplest. All you need is a single two-input NAND and the 8-to-1 mux's inputs. You don't need to use enables or anything else.

- Warren
I agree now, that it isn't the simplest. The 'enable' input to the mux, however must be asserted. It cannot be left floating. The selected inputs also cannot be left to float.

Vptran84 did very well. He/(she?) began as follows:

vptran84 said:
i simplified the boolean equation and this is wat i got:

B'D' + ACD

is that correct?

On this, we all agree.

KM
chroot said:
vptran: yep, that's what I got too. Now, can you see an easy way to map that into the select pins of an 8-to-1 multiplexer?

- Warren

vptran84 said:
i drew up the truth table of the boolean equation and i got 1's at 0000, 0010, 1000, 1010, 1011, 1111.

So do i just put 1's at those numbers? and ground the rest?

chroot said:
Well, the 8-to-1 multiplexer only has three select bits -- it's not a 16-to-1. So you'll need to use a NAND gate to combine two of your inputs into one first.

- Warren

vptran84 said:
ok, so i used A C D as the inputs where A is the most significant bit. For B, i put it into a 2 input nand gate, which gives B' and connect that to Do, D2, D4, D6...for the rest, i grounded them. I guess it is becuase B is the one that controls the mux?? Can you tell me if I am on the rite track?

Actually, he could have done as he described, or he could have used D0, D1, D2 and D3, etc. depending on how the inputs are routed to the select logic. This circuit is shown in figure 2, and is the simplest of all. Note that the 'enable' input (G) must be selected by grounding it. ACD is selected by tying it to Vcc.
Kenneth Mann said:
You are good as far as you go, but what about the ACD case. You'll need one more wire for that. Also don't forget to ground the enable. This is a clever approach. The one I gave required two NANDs to handle the ACD case.

KM


chroot said:
As I've already said, use (AC)' as one of the select bits. Use B and D as the other two.

One NAND, one 8-to-1 mux, no need for enable logic.

The problem with the enable, Kenneth, is that it does not ground the outputs; it turns off the output drivers, putting them into the high-impedance (tri-state) state. You'd then have to add pull-up or pull-down resistors on the outputs. So now you're stuck with pull-up resistors and two NANDs, one of which is three-input -- a weird beast.

Basically, your solution is "clever" insofar as "clever" is a synonym for "pretty bizarre." There are better and cleaner ways to do it, as I have explained.

- Warren

In this case chroot is simply WRONG! First, the Enable input (G) to the mux MUST be grounded. (All inputs must be asserted in some way.) Second, nobody said anything about grounding OUTPUTs. Third, the output drivers to the 74LS151 are NOT turned off. This is NOT a Tri-state device. (Refer to the following:)

http://www.ee.washington.edu/stores/DataSheets/74ls/74ls151.pdf
http://grail.cba.csuohio.edu/~jackie/eces301/ds/sn74ls151rev5.pdf

The main problem, however, is chroot's use of the term "bizarre". That was unprofessional.


chroot said:
vptran:
As I've said, use (AC)', B, and D as the select inputs to your mux, and you're done.

- Warren

Actually, he's not done at that point. All of the data input lines (Ds) must also be tied (in this case to Vcc). Inputs can never be left to float. As it turns out, vptran's own solution was the best, but he was probably too intimidated to use it.

The three drawings in the accompanying attachment are used to illustrate the three approaches. Figure 1 shows the approach advocated by chroot, which I will admit is simpler than that of figure 3 (though I don't think that of figure 3 rises to the level of "bizarre"). Finally Figure 2 shows the approach put forth by vptran, which is the simplest (the best). (Note, that the NAND used could easily have been a simple inverter.)

Figure 4 is the statement of the original equation, which is mapped (one variation) in figure 6. From this map, the circuit in figure 3 can be readily defined. Figure 5 shows the equation partially simplified, which leads directly to the K-Map of figure 7. This can be readily translated into the circuit of figure 2.

It should be noted that a complete simplification of an equation gives a SSOP (Simple Sum of Products) or a SPOS Simple Product of Sums solution. These ore directly translatable to the use of NANDs or NORs. They do not readily yield answers for more complex devices, unless there is another step added, that of device-fitting, which can be quite complicated.

KM
 

Attachments

  • exc08.jpg
    exc08.jpg
    15.9 KB · Views: 821
  • exc09.jpg
    exc09.jpg
    12.2 KB · Views: 646
  • exc10.jpg
    exc10.jpg
    16.7 KB · Views: 776
Last edited by a moderator:
  • #18
Kenneth,

When I said "you don't need to use enables," I didn't mean "you can leave them floating." I simply meant that you can tie them low or high as appropriate, and not use them as part of the logic.

My circuit is, in fact, much cleaner than either yours or the original created by vptran. Why? Because all of the inputs are tied high. When this circuit goes to layout, it'll be much easier to lay down copper to tie all the inputs high than it will be to run traces to every other input. My circuit is minimal in component count, layout sensibility, and comprehensibility. Yours is not minimal in any of those ways.

I'm a professional electrical engineer, KM. I apologize for offending you by my use of the word "bizarre," but, in fact, your solution would be immediately rejected by ANY engineer. Sorry to burst your bubble.

- Warren
 
  • #19
chroot said:
Kenneth,
My circuit is, in fact, much cleaner than either yours or the original created by vptran. Why? Because all of the inputs are tied high. When this circuit goes to layout, it'll be much easier to lay down copper to tie all the inputs high than it will be to run traces to every other input. My circuit is minimal in component count, layout sensibility, and comprehensibility. Yours is not minimal in any of those ways.

I think that I admitted long prior, that the circuit that I presented was not the minimal one. I will still say, however that the idea by vptran is superior to yours. I can point out to you that there are six ways that the data inputs can be arranged with the same results, simply by rearranging the 74LS151 A, B and C inputs. The only reason I did it the way previously shown was because it made it compatible with the one I had previously given. The circuit of the accompanying figure is derived simply by reversing the A, C and D lines in. Furthermore - - -

chroot said:
I'm a professional electrical engineer, KM. I apologize for offending you by my use of the word "bizarre," but, in fact, your solution would be immediately rejected by ANY engineer. Sorry to burst your bubble.
- Warren

I'm disappointed. I expected more imagination than that. After thirty years of designing digital systems my only answer to that statement is "hogwash".

KM
 

Attachments

  • exc11.jpg
    exc11.jpg
    9.4 KB · Views: 989
  • #20
If you've been designing digital circuits for thirty years, and your best attempt at a solution for this problem involved three NANDs, one of which was a three-input, I think it's high time for a career change. I certainly hope I never have to work alongside you.

- Warren
 

1. What is a 74LS151 logic function and how does it work?

The 74LS151 is a type of integrated circuit that is used to perform logic functions, or mathematical operations, on binary inputs. It has 8 input pins and 1 output pin, and can perform a variety of logic functions such as AND, OR, and XOR.

2. How is a 74LS151 used in digital circuits?

The 74LS151 is typically used in digital circuits to select one of multiple inputs based on a control signal. It can also be used to perform logic operations on binary inputs, making it a versatile component in digital circuit design.

3. What are the advantages of using a 74LS151 logic function?

One advantage of using a 74LS151 is its compact size, which allows for more efficient use of space in a circuit. It also has a wide operating voltage range and low power consumption, making it suitable for a variety of applications.

4. What are the limitations of a 74LS151 logic function?

One limitation of the 74LS151 is its limited number of input pins, which restricts the complexity of logic functions that can be performed. It also has a slower operating speed compared to other types of logic functions.

5. How can I troubleshoot issues with a 74LS151 logic function?

If you encounter issues with a 74LS151 logic function, first check that all connections are secure and that the correct inputs are being used. You can also refer to the manufacturer's datasheet for troubleshooting tips and consult with a professional if needed.

Similar threads

  • Electrical Engineering
Replies
12
Views
1K
  • Electrical Engineering
Replies
1
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
4K
  • Engineering and Comp Sci Homework Help
Replies
7
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
9
Views
2K
  • Electrical Engineering
Replies
8
Views
5K
  • Engineering and Comp Sci Homework Help
Replies
4
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
10
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
4
Views
26K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
6K
Back
Top