4
\$\begingroup\$

I'm creating a 2-bit alu. It has 8 defined functions (the functions are defined by a 3bit code), AND XOR etc, and these functions act on two, 2-bit binary numbers and produce a 2-bit answer.

my circuit diagram

From what I have done so far, I have a decoder that decodes what the function is, and the output of that powers/activates the corresponding purpose of that function.

for example the function code '000' activates the XOR terminal on the decoder and the XOR box spits out its answer, likewise '001' activates the AND box.

The problem I'm having is, the outputs of the two functions XOR and AND have to go into LSB,MSB and carryOut to indicate the answer, however since the outputs are tied together it causes an error. And I can't have 3 separate LED's defined for each function. I must only use that 3 (LSB,MSB and carryOut).

So my question is how do I not tie the outputs of the AND and XOR and produce a result depending on which function is active?.

*note on the image*

a - LSB of binary number 1  {these are controlled by switches}

b - MSB of binary number 1

c - LSB of binary number 2

d - MSB of binary number 2

cin - carry in.

Also everything inside the boxes are made using the basic gates and not from simulated blocks.

\$\endgroup\$
4
  • \$\begingroup\$ Honestly this is your homework right? you ought to figure it out for yourself - I'll give you a simple hint - you shouldn't be 'activating' a block to choose the function that appears on the outputs \$\endgroup\$
    – Taniwha
    Commented Mar 12, 2011 at 8:41
  • \$\begingroup\$ OK well thanks for your comment, for one I'm only asking here as I'm stuck, and the other is that, 'activating' a block was the starting point that I was told to go on??. \$\endgroup\$
    – silent
    Commented Mar 12, 2011 at 10:22
  • 1
    \$\begingroup\$ Are you allowed to use 3-state logic? en.wikipedia.org/wiki/Three-state_logic \$\endgroup\$
    – endolith
    Commented Mar 12, 2011 at 15:20
  • \$\begingroup\$ @endolith : oh cheers, I'm not able to use that, but thanks for the info:). \$\endgroup\$
    – silent
    Commented Mar 13, 2011 at 0:31

1 Answer 1

6
\$\begingroup\$

You need multiplexers for the outputs. The decoder is not strictly necessary.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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