Build 1 bit comparator using 2 to 4 decoder?

In summary, to build a 1 bit comparator using a "2 to 4" decoder, first create a truth table with inputs A and B and outputs A>B, A<B, and A=B. Then, use a 2 by 4 decoder to generate the outputs based on the minterms. Finally, use gates, such as an OR gate, to match the outputs to the desired values.
  • #1
asdf12312
199
1
build 1 bit comparator using "2 to 4" decoder??

Homework Statement


1eux48.png


The Attempt at a Solution


worked out truth table:
Code:
A     B    A>B   A<B   A=B
0     0     0     0     1
0     1     0     1     0
1     0     1     0     0
1     1     0     0     1

prty sure that's right. just need part B now. now i have a 2 by 4 decoder, know wat it is, just confused because the outputs is different from what i have in the truth table. also, there is only 3 outputs in my truth table, the decoder has 4 outputs. so how does that work :\
 
Last edited:
Physics news on Phys.org
  • #2
You need to make a circuit with the Decoder plus gates to generate those three outputs. What does the raw output of the decoder look like (what is its truth table given A and B as inputs)?

BTW, nice change to code tags on your table! :smile:
 
  • #3
decoder outputs are from minterms. so a'b' outputs 1 in the 0 output, a'b outputs 1 in the 1 output, and so on. so all i have to do is change the output of ab input to match the output of a'b'? so that and gate will be an or instead: ab + a'b' ??
 

1. How does a 2 to 4 decoder work?

A 2 to 4 decoder takes in a 2-bit input and produces a 4-bit output, where only one output is active at a time based on the input combination. It essentially decodes the binary input into one of the four possible outputs.

2. What is a comparator and how does it work?

A comparator is a logic circuit that compares two binary inputs and produces an output based on their relative magnitudes. It works by comparing the bits of the two inputs and determining which one is greater, equal, or less than the other.

3. How can a 2 to 4 decoder be used to build a 1 bit comparator?

A 2 to 4 decoder can be used to build a 1 bit comparator by using the two input bits as the inputs for the decoder and using the decoder's outputs to represent the different comparison outcomes (greater, equal, or less). The active output from the decoder would indicate the result of the comparison.

4. What is the advantage of using a 2 to 4 decoder to build a 1 bit comparator?

The advantage of using a 2 to 4 decoder to build a 1 bit comparator is that it simplifies the logic required for the comparison. Instead of using multiple logic gates, the decoder can handle the decoding and output selection in a more efficient way.

5. Can a 1 bit comparator built with a 2 to 4 decoder handle more than two inputs?

No, a 1 bit comparator built with a 2 to 4 decoder can only handle two inputs. Each additional input would require another bit of comparison, which would require a larger decoder or a different comparator design.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
4
Views
4K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
8K
  • Engineering and Comp Sci Homework Help
Replies
9
Views
954
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
4
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
6
Views
16K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
5
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
4K
Back
Top