1
\$\begingroup\$

I have something as below featuring XOR, AND, OR, XNOR, NAND and NOR gates. I have to get the bottom 3 outputs set to 1. As you can see, I've managed to do it as below but was wondering out of the 720 possible combinations, how many are there actually? Am I missing some logic myself or is there an online resource to help?

For the benefit of this, the inputs remain the same. Only the position of the gates can change.

enter image description here

\$\endgroup\$
11
  • \$\begingroup\$ Which "720 possible combinations"? Input combinations? \$\endgroup\$
    – devnull
    Commented Dec 18, 2021 at 15:49
  • \$\begingroup\$ 6 gates as mentioned which is 6! combinations they can be in \$\endgroup\$
    – pee2pee
    Commented Dec 18, 2021 at 15:50
  • 2
    \$\begingroup\$ There only 4 inputs. So you only have to worry about 2^4=16 input possibilities. \$\endgroup\$
    – SteveSh
    Commented Dec 18, 2021 at 15:52
  • 1
    \$\begingroup\$ for such a small example, even an exhaustive search would be trivial. \$\endgroup\$
    – user16324
    Commented Dec 18, 2021 at 16:06
  • 1
    \$\begingroup\$ @pee2pee Simply create every combination and test it (in VHDL or a Python script or whatever). If there were billions of combinations it wouldn't be trivial, of course, in terms of resources, but for fewer than a thousand... \$\endgroup\$
    – user16324
    Commented Dec 21, 2021 at 14:48

1 Answer 1

1
\$\begingroup\$

What I would do is use something called LogicFriday. By drawing out the circuit, the associated truth table can be generated to show all the combinations that meet the needed criteria

enter image description here

enter image description here

So there are 4 combinations which produce 0b111 output

Unfortunately the site did not renew the domain, but can still be found here: https://web.archive.org/web/20131022021257/http://www.sontrak.com/

With 4 input's there is 16 combinations that need to be scanned, this is viable by hand

\$\endgroup\$
4
  • \$\begingroup\$ How would you do it for every combination of gate in the image/post? \$\endgroup\$
    – pee2pee
    Commented Dec 21, 2021 at 9:31
  • \$\begingroup\$ For every combination of gates? Do you mean changing the physical gates or the inputs? Every combination of inputs is shown in the image within the truth table \$\endgroup\$
    – user16222
    Commented Dec 21, 2021 at 9:35
  • \$\begingroup\$ Gates, hence the remark about 720 possible combinations as I think it'll be 6! \$\endgroup\$
    – pee2pee
    Commented Dec 21, 2021 at 9:42
  • \$\begingroup\$ @JonRB It is a puzzle. Inputs and outputs are given and we have to find the permutations of the 6 gates in the 6 positions which, given the inputs, provide the desired outputs. So it is just a brute force search for all possible combinations/permutations. \$\endgroup\$
    – devnull
    Commented Dec 21, 2021 at 10:41

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.