Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Logic question

Status
Not open for further replies.

TsAmE

New Member
Design a system which generates a 1 if (and only if) an odd number of buttons (ie 1 or 3) are being pressed.

Attempt (refer to attachment):

I dont understand why my attempt isnt right. I mean if you press both button 1 and 3 a '1' is produced and the unpressed button 2, produces a '1', as its '0' is inverted. As a result the AND-gate produces a logic 1.
 

Attachments

  • Logic 7.jpg
    Logic 7.jpg
    68 KB · Views: 323
It has to work if button 1 is pressed and if button 2 is pressed and if button 3 is pressed and if buttons 1 2 and 3 are pressed.
 
TsAmE ,

I dont understand why my attempt isnt right. I mean if you press both button 1 and 3 a '1' is produced and the unpressed button 2, produces a '1', as its '0' is inverted. As a result the AND-gate produces a logic 1.

Why haven't you produced a truth table and evaluated it with a K-map? If you did, you would see that it is a 3-input XOR gate. A XOR is called a odd function because it has a output only when a odd number of bits are set. See the attachment for the correct way to work the problem.

Ratch

P.S. Notice how the top AND gate in the "correct" answer is connected wrong.
 

Attachments

  • XOR.pdf
    15.4 KB · Views: 339
Last edited:
It has to work if button 1 is pressed and if button 2 is pressed and if button 3 is pressed and if buttons 1 2 and 3 are pressed.

If buttons 1,2 and 3 are pressed at the same time then how would this be right? (since button 2 is an even number and not odd)

@Ratchit. I havent learnt about XOR gates yet, and this problem stated a hint that it must be done with 4 AND gates, some inverters and an OR gate.
 
You're confusing the button symbols with the number of buttons pressed. Relable the buttons A, B & C and then redoo the question. Now an odd number of buttons pressed is still 1 or 3.

Mike.
 
Reworded: It has to work if button 1 is pressed or if button 2 is pressed or if button 3 is pressed of if buttons 1 2 and 3 are pressed.
 
Last edited:
TsAmE,

@Ratchit. I havent learnt about XOR gates yet, and this problem stated a hint that it must be done with 4 AND gates, some inverters and an OR gate.

It doesn't matter what it is called. If you make a truth table and K-map it, then you come up with with 4 minterms in a sum of products (SOP) expression. The 4 minterm expression is easily implemented with 4 AND gates, 1 OR gate, and some inverters.

Ratch
 
Last edited:
Status
Not open for further replies.

Latest threads

Back
Top