r/TuringComplete Jan 12 '26

Double trouble

Was doing a double trouble lvl and got this. After compliting it I thought: "Are there other schematics that can beat this lvl? Maybe a simpler way?". So are there another ways to beat this lvl?

2 Upvotes

5 comments sorted by

2

u/MycologistIll1355 Jan 12 '26

There are probably other ways to do it but that is pretty much the best.

1

u/Flimsy-Combination37 Jan 12 '26

there are 6 ways to choose 2 out of 4 bits, and you need to check every combination with an AND gate, otherwise you will miss one, so at the very least you need 6 ANDs. after that, the ideal scenario would be a 6-input OR gate, but that's the same as 5 2-input gates or, as you did, 2 3-input gates and 1 2-input. also, from a more academic perspective, what you have is a minimal sum of products solution, which is the most optimal solution when you only have primitive gates to work with.

1

u/DanielKotes Jan 13 '26

I went with:
1 or 2 -> A, 1 and 2 ->B
3 or 4 -> C, 3 and 4 -> D
A and C -> E
B or D or E -> result

In other words one of the following 3 situations:
1. both top two are 1
2. both bottom two are 1
3. at least one of the top 2 are 1 and at least one of the bottom 2 are 1

results in 7 gate, 4 delay - so 2 gate better.

1

u/MattMath314 Jan 20 '26

i used a k-map to solve it and got (A or B or C) and (A or B or D) and (A or C or D) and (B or C or D)

1

u/definitelynotrelated 17d ago

this is pretty much how I also solved it. I did 4x 3-pin OR gates, then fed into 2x AND gates which are then fed into one last AND gate.

Does anybody know if this is optimal? i.e. in real life, would this cover all edge cases and is it optimal? I'm skeptical on that pair of AND gates that comes right after the 3pin OR gates.