Turing Complete

Turing Complete

View Stats:
Conditions Level
First off, I have no background in computer science, or binary, truth tables etc. so please take that into account.

I just feel like I've really missed something in this level. So far, the game has left me understanding how the previous levels come together, e.g. the progression through adding numbers. But for this the only idea I can think of is to go through each option, expand the byte, and create some logic gates for that compares them all e.g. a bunch of XORs and a not for checking if zero. But there isn't anywhere near enough space for that, so that can't be right.

This level is placed after the component factory level, so am I supposed to create components for each comparison and then chain them together?

Comparison hasn't come up at all so far, I don't think? Else where on the forum some people were talking about 1 bit comparitors but I've got no idea what they are, and I can't find anything on google

I tried looking up some hints, and then even the solution but that didn't help at all - I can't even begin to understand why it would work.

Does anyone have anything for a beginner?
< >
Showing 1-7 of 7 comments
FlyingWalnuts 24 Dec, 2023 @ 9:47am 
uhhh... It turns out you _can_ just spaghetti mess it operation by operation. The question above would still be useful though
tonym1972 24 Dec, 2023 @ 7:48pm 
How to help without spoon feeding you a copy+paste solution which helps no one.

You have 3 problems to solve,
"Is Zero"
"Is positive"
"Is negative"

Solving "is negative", is just a case of sampling bit 7 (128), if TRUE then negative.
Solving "is positive", is just a case of NOT "is zero" AND NOT "is negative", if TRUE then positive.
"is zero" is where I suspect your current problem resides. I suspect based on your mention of trying to use XOR that your trying to build some kind of comparison between the input value and zero?

(cue the tricky bit, give help, not the solution). If we have some input A, we can deduce that it must be zero, if and only if all of its bits are zero. If we don't care about its distance from zero, we need only see if any bit is TRUE. using OR to combine all the bits would achieve that, although you would need to invert the output to have TRUE == zero.
Cheesepizza2 26 Dec, 2023 @ 10:08am 
There are two conditions that can matter. The first is if the number is equal to zero (true if every bit is off). The second is if the number is positive (true if the last bit is off). The third bit just inverts the answer.
FlyingWalnuts 3 Jan, 2024 @ 1:52pm 
Thank you for the advice! I've had another crack, and it certainly easier after some of the later levels as well. One of the things that made it easier was actually to build it in sandbox and spread it out a bit - and once you do that you can build a truth table and simplify, and it simplifies quite nicely!
kenpeter 8 Jan, 2024 @ 2:16pm 
2's comp Negate is no red herring, use it.
Last edited by kenpeter; 8 Jan, 2024 @ 2:20pm
Phyrefly 22 Jun @ 11:08am 
A comparator is easier than you think it is. It is true if the 2 values are the same, and false if 1 is true and 1 is false. "True if only one of the inputs is true" - does that sound familiar?

That's an XOR gate. "Not" the output to make a comparator, or use a NXOR gate

You can apply that logic to each bit to compare bytes.
For finding the =0 and !=0 results, I first started to use NOT gates and AND gates to ensure all of the value's bits were zero.... then I realized all I had to use was 4 OR gates. Just OR all of the bits. and OR those to get down to a 1 bit result. That gives you the !=0 result. Then one more NOT gate on the OR gates' output gaves you the =0 result.

For <0 and >=0, Bit #8 IS the indicator. If Bit #8 = 1, then val <0. If Bit #8 = 0, then value is EITHER 0 or > 0. So put a NOT gate on Bit #8 and you have the >=0 result.

For >0, I took an AND gate and just put >=0 on one input and !=0 into the other. (3rd input was the "Tell me if value is >0" from the input. )

For <=0, you can either (simple answer) OR the <0 result with the =0 result.
or - what I did - because my gates were laid out this way: I routed the "tell me if value is <=0" signal so it goes into both of the gates that give me the <0 result and the =0 result. SO the <0 gate is turned on for both "tell me if val <0" and "tell me if val <=0". And the =0 gate is turned on for both "tell me if val =0" and "tell me if val <=0"
Last edited by cehleggett; 15 Jul @ 5:48am
< >
Showing 1-7 of 7 comments
Per page: 1530 50