Can u make if A>=B then output=1 Else output=0 using these logic gates?

In summary, the conversation discusses the challenge of creating a comparator using only NAND, AND, NOR, OR, and ExclusiveOR gates in an electronics lab. The conversation includes a suggestion for using a K-Map to find the circuit and mentions the inputs being 1-bit values. The final solution involves using the gate images from Wikipedia and creating the circuit manually in Photoshop.
  • #1
esalihm
90
0
[SOLVED] can u make "if A>=B then output=1 Else output=0" using these logic gates?

Homework Statement



this is not quite a homework problem. I am designing a device and I need to use A>=B comparator.

The challenge is I need to do this using only NAND, AND, NOR, OR and ExclusiveOR gates. Because these are all we have at the electronics laboratory.

This might look like a computer science problem at first. But I have to make this using actual gates, cables and LEDs. (Hence, this is electronics :))

Homework Equations



no equations, just boolean logic

The Attempt at a Solution



tried using some different arrangements but can't really find one that works
 
Last edited:
Physics news on Phys.org
  • #2
hi,

I have just got the equal to part completed. now I need the "greater than" part.

equal to is

A
EOR ==> NOT ==> (output)
B

(inputs A and B are going to the EOR gate)
 
  • #3
The truth table of your gate is [C is the output]:

Code:
+---+---+---+
| A | B | C |
+---+---+---+
| 0 | 0 | 1 |
| 1 | 0 | 1 |
| 0 | 1 | 0 |
| 1 | 1 | 1 |
+---+---+---+

This logic can be given by:

[tex]
C = \overline{A}~\overline{B} + A\overline{B} + AB[/tex]

[tex]
C = A + \overline{A}~\overline{B}
[/tex]

So, you get,

A (OR) (!A (AND) !B)

or:

http://img89.imageshack.us/img89/6882/pflogicxbt7.jpg
 
Last edited by a moderator:
  • #4
How many bits are A and B? If they are small enough it wouldn't be that hard to write out the K-Map and find the circuit by brute force, would it?
 
  • #5
nicksauce said:
How many bits are A and B? If they are small enough it wouldn't be that hard to write out the K-Map and find the circuit by brute force, would it?

from his second post, I'm guessing both inputs are 1-bit values only.
 
  • #6
thanks, that helps a lot
(the inputs are one bit each, either high (1) or low(0) )
 
Last edited:
  • #7
hey rohanprabhu, what program did u use to make that drawing?
 
  • #8
esalihm said:
hey rohanprabhu, what program did u use to make that drawing?

it's made by hand.. in photoshop.. nothing automated. I used the gate images from wikipedia.
 

1. What are logic gates?

Logic gates are electronic circuits that perform basic logical operations, such as AND, OR, and NOT, based on the input signals.

2. How do logic gates work?

Logic gates work by receiving input signals and producing an output signal based on the specific logic operation they are designed to perform. They use transistors as switches to allow or block the flow of electric current.

3. What is the purpose of using logic gates to implement conditional statements?

Logic gates are used to implement conditional statements in order to perform logical operations and make decisions based on input conditions. This allows for the creation of complex logic circuits that can perform a variety of tasks.

4. How can the given statement "if A>=B then output=1 Else output=0" be implemented using logic gates?

This statement can be implemented using logic gates by using an AND gate to compare the values of A and B and an OR gate to combine the output of the AND gate with the output of a NOT gate, which flips the output to 0 if the input is 1.

5. What are the advantages of using logic gates to implement conditional statements?

The advantages of using logic gates to implement conditional statements include their speed, reliability, and scalability. They can process large amounts of data quickly, are less prone to errors, and can be combined to create more complex logical operations.

Similar threads

  • Advanced Physics Homework Help
Replies
1
Views
988
  • Engineering and Comp Sci Homework Help
Replies
2
Views
2K
  • Introductory Physics Homework Help
Replies
25
Views
4K
  • Advanced Physics Homework Help
Replies
4
Views
4K
  • Introductory Physics Homework Help
Replies
12
Views
2K
Replies
5
Views
4K
  • Engineering and Comp Sci Homework Help
Replies
7
Views
6K
  • Engineering and Comp Sci Homework Help
Replies
10
Views
4K
  • Introductory Physics Homework Help
Replies
4
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
5
Views
2K
Back
Top