0
\$\begingroup\$

I have the following exercise:

Design a circuit that takes a 2 bit binary and makes it x^3 (x cubed), using a decoder 
of your choice.

I thought to do it with a 3 to 8 decoder, because I have 2 bits of input, and 4 bits of output, since the largest output is 11011 (which is 27 in decimal).

I have managed to get to a truth table. Input = \$x_0x_1x_2\$. Output= \$a,b,c,d,e\$.

\begin{array}{|c|c|c|c|c|c|c|c|} \hline x_0 & x_1 & x_2 & a & b & c & d & e \\ \hline 0 & 0 &0 &0 &0 &0 &0 &0\\ \hline 0 &0 &1 &0 &0 &0 &0 &1\\ \hline 0& 1 &0 &0 & 1 &0 &0 &0\\ \hline 0 &1 &1 &1 &1 &0 &1 &1\\ \hline \end{array}

However, I am not quite sure what should I do now. I have to get to a function to represent it in gates? How can I make a karnaugh map from that table?

I am aware that I would have to add three more outputs to the 3 to 8 decoder, but they will be just "don't cares".

Your help is appriciated.

\$\endgroup\$
  • \$\begingroup\$ If you were not using the decoder, I would say to draw 5 small Karnaugh maps, one for each output, using your 2 bits of input. Since you are using a decoder, there is no need for Karnaugh maps. Just follow Brian's advice. \$\endgroup\$ – Tut Jun 26 '14 at 11:25
3
\$\begingroup\$

With some thought you can do it with less logic ... a single 2-input gate.

I'll not give the whole game away, but one technique that may help is to treat each output bit individually, and minimise the logic for that output alone.

Start with bit c as it is the simplest.

Then put the individual solutions together.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Actually, it looks like he needs no extra gates at all (assuming he uses the required decoder) \$\endgroup\$ – Tut Jun 26 '14 at 12:10
  • \$\begingroup\$ Right : the trick is to use a decoder to mimic a simple gate... \$\endgroup\$ – Brian Drummond Jun 26 '14 at 12:13
  • \$\begingroup\$ +1 This took me a moment but I see it. Very clever observation. At least the solution I see requires a single gate as Brian had suggested. I am not sure how this would be done with only a decoder and no external logic? \$\endgroup\$ – sherrellbc Jun 26 '14 at 13:20
  • 1
    \$\begingroup\$ @BrianDrummond I think I might got it. I got expressions for all the outputs: a=x1*x2, b=x1, c=0, d=x1*x2, e=x2. Now when I make the circuit I just connect the gates? I'm not exactly sure I should I treat d and a since they're equal. Please correct me if I'm wrong, and I thank you for your help. \$\endgroup\$ – Alan Jun 26 '14 at 20:09
  • 1
    \$\begingroup\$ I never said anything about 4 bits of output : but in a sense, you DO only have 4 bits of output because a and d are equal. I would simply connect them together. (In a large design there are other considerations - read about "fanout" in TTL logic - but not here.) \$\endgroup\$ – Brian Drummond Jun 26 '14 at 20:20
2
\$\begingroup\$

To answer the question in general, from this point you would look at each output variable and construct the appropriate logic on that line.

Each of your output variables, in general, will be constructed independent of the others. However, there are often cases where there is similarity (or they are identical) and as such may be formed used into a single logic configuration and taken twice on the output. The following is taken directly from the wiki.

For instance, the truth table for a 2 to 4 decoder looks like this:

http://i.imgur.com/68oe6ce.png

Where the output expressions are derived for each respective output variable with respect to the input states.

http://i.imgur.com/N622HPl.png

And from these expressions you can directly design the decoder:

http://i.imgur.com/cOBxAss.png

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ @sherrllbc I understand why the input is 2 bit long, but I don't understand why the output is 4 bit long? because 3^3 is 27 - a 5 bit outpout. \$\endgroup\$ – Alan Jun 26 '14 at 19:46
  • \$\begingroup\$ Which output? The output of the decoder schematic I presented above? \$\endgroup\$ – sherrellbc Jun 26 '14 at 19:48
  • \$\begingroup\$ No, the output bits I have shown in the table in the original post. Thank you btw! \$\endgroup\$ – Alan Jun 26 '14 at 19:50
  • \$\begingroup\$ I think I might got it. I got expressions for all the outputs: a=x1*x2, b=x1, c=0, d=x1*x2, e=x2. Now when I make the circuit I just connect the gates? I'm not exactly sure I should I treat d and a since they're equal. Please correct me if I'm wrong, and I thank you for your help. @sherrellbc \$\endgroup\$ – Alan Jun 26 '14 at 20:10
  • \$\begingroup\$ Yes, that is what Brian was talking about above. For the case that a=d just have the output of x1*x2 taken to both bits a and d. No big deal there. \$\endgroup\$ – sherrellbc Jun 26 '14 at 20:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.