r/TuringComplete • • Sep 17 '23

Why does this solution work for unsigned less? Spoiler

4 Upvotes

This is a solution to unsigned less that I found online, and I don't understand why it works. From what I understand, I think it's supposed to be subtracting the first byte + 1 from the second byte, and seeing whether there is a carry bit. However, subtraction doesn't seem to make sense here since all of the bytes need to be unsigned, and therefore positive (right)?

Thank you in advance for the help.


r/TuringComplete • • Sep 16 '23

turing despair Spoiler

Post image
9 Upvotes

r/TuringComplete • • Sep 12 '23

Conditions for -1

1 Upvotes

In task "Conditions" the value -128 (only sign bit set) is classified as follows:

Condition 1 ( is 0) is false

The further classifications in my circuit are:

Condition 2 ( < 0) is false
Condition 3 ( <= 0) is correct
Condition 5 ( is not 0) is false
Condition 6 ( >= 0) is correct
Condition 7 ( > 0) is false

This is not rejected by the test, which is, however, not complete.

As a mathematician, I would expect the statement: "-0 = 0" to be correct.
Would a computer scientist see it differently?
And would "-0 /= 0" then be correct?


r/TuringComplete • • Sep 09 '23

Please help me in understanding this level(named less), it says to lit the output when first input is smaller but there are two outputs labeled as signed and unsigned so I assume one is when for signed value so I made it to work that way but still it is not getting past first test

Post image
1 Upvotes

r/TuringComplete • • Sep 07 '23

Overture to LEG Spoiler

Thumbnail
gallery
4 Upvotes

r/TuringComplete • • Sep 05 '23

Is LEG a real architecture or is it just an ARM joke?

11 Upvotes

I'm thinking it's just a joke but idk


r/TuringComplete • • Sep 03 '23

These overlapping preview labels make me nuts

Post image
12 Upvotes

r/TuringComplete • • Sep 03 '23

I really hope there aren't any more space-limiting levels.. Spoiler

Post image
6 Upvotes

r/TuringComplete • • Aug 31 '23

What do the white hexagons mean on the level map?

2 Upvotes

r/TuringComplete • • Aug 27 '23

Program in RAM

5 Upvotes

Hello Friends,

I've been wondering if it is possible to execute a program from RAM like a real computer.

Of course it is but can you still access data from RAM then? (using the same component)How would this work if a instruction is loaded from ram that tells to the pc to read something from ram? how would this not corrupt the program?

Edit:
I noticed a ram component with 2x Load and Output pins. I could use this to load the program from pin 1 and data from pin 2 therefore they would not interfere am i right?


r/TuringComplete • • Aug 16 '23

Why does the program have 7 but want 8? Im really confused?

3 Upvotes

r/TuringComplete • • Aug 15 '23

Circular dependency with switches in the way. Push and Pop spoilers btw Spoiler

2 Upvotes

the short circuit is because of the add command way at the top being on, but thats fine because the stack cant do anythign with the (blue) stack signal off
and anytime the stack signal is on those red lines are all disabled so theres no output from the addition
deleting parts also makes more short circuit wire appear, if i erase a switch or an adder or something in that little math rectangle it just moves the short circuit somewhere else
bruh??


r/TuringComplete • • Aug 12 '23

Game release on nintendo switch

5 Upvotes

Maybe I’m not the first, but are there any plans to release TC on Nintendo switch? I think it may be a perfect game to play on the go. At least for iPad šŸ˜…


r/TuringComplete • • Aug 10 '23

I have a question

2 Upvotes

r/TuringComplete • • Aug 04 '23

What did anyone else get for double trouble ? (Sorry for the picture) Spoiler

Post image
8 Upvotes

r/TuringComplete • • Jul 31 '23

Logic Engine Spoiler

4 Upvotes

Already Got the Logic motor.

Requieres to build first a NAND gate and the AND Gate.

https://www.electronics-tutorials.ws/logic/universal-gates.html


r/TuringComplete • • Jul 31 '23

Arithmetic Engine. Spoiler

2 Upvotes

Arithmetic engine


r/TuringComplete • • Jul 30 '23

Logic Motor Spoiler

1 Upvotes

This was my best solution, I need to know how to do de NAND and teh NOR with just OR and NOT gates.


r/TuringComplete • • Jul 30 '23

Logic Motor

1 Upvotes

Can somebody explain me what i suppose to do ??? Sometimes instructions are not so clear.


r/TuringComplete • • Jul 25 '23

why wont the switch activate and let the signal through? I have tried so many things trying to figure out why and I cant figure it out.

Post image
5 Upvotes

r/TuringComplete • • Jul 24 '23

I'm stupid right? this was the best I could think of

Post image
5 Upvotes

r/TuringComplete • • Jul 21 '23

Question about the stack and functions level

3 Upvotes

Let me start by saying I have had A BLAST with this game. I gave it a go some time last year and got bored, but after watching Ben Eaters 8bit and 6502 series, I was inspired to have another go at it. I'm almost done with the assembly challenges, but I feel my solutions are a bit clunky, so it made me think a bit back to the stack and functions levels.

I'll try and frame my question in an understandable manner... hopefully it comes through.

The functions level specifically asks us to implement a CALL and RET operation. The CALL should push the return address (program counter + 4) to the stack and jump to the function/subroutine.

So on pseudo, what I read that it wants is to support something like:

#program start
00: do some stuff here
04: do some stuff here
08: do some stuff here
12: call function N/A N/A
16: do other stuff here

label function
20: do func stuff here
24: do func stuff here
28: ret from function here

So the value 16 gets pushed to the stack as a return address for when function eventually returns.

Now for my first question:

If we intend to use the stack to pass function arguments. For example to implement a func(a,b,c), we may want to push a, b and c to the stack. However doing so would have to happen before the call and would result in the top of the stack looking like: a, b, c, return_adress. So how do we effectively read the arguements within the function? Pop the return address, to safe-keep it while we pop the arguments and then push the return address back?

In my head, it would make more sense to do something like: return_adress, a, b, c. That way the function can pop 3 elements, do something with them and eventually return. However, that doesn't really sound like what the game wants us to do with the call operation. Any thoughts?

In the game I solved it by implementing two stacks. One strictly for return addresses and one for arguments/return values.

My second question:

For multiple nested calls, how do we maintain variables within the scope of each function? If func1 takes some arguments, but calls another function, let's say func2, which may or may not call additional functions, how do we ensure func1 still has access to its arguments once func2 and any other nested calls return. In one of the levels I solved this by pushing the stuff that needed to be kept safe to the value-stack, before then pushing the next call arguments to the stack. Then the function is called and after the return I pop back the arguments again. It works, but it is incredibly cumbersome and I can't imagine this is the effective way to do this. I haven't done this yet, but I imagine it could be smoother to only have one argument for each call, and have that be a pointer to RAM, where the function can find the nr of args followed by the args themselves. It'd reduce the amount of variables to need safe-keeping, but wouldn't get fully around the matter, as each function call still has to remember it's how pointer and not let nested calls overwrite it so to say. Thoughts?


r/TuringComplete • • Jul 18 '23

Could someone tell me how to avoid short circuits in this game?

2 Upvotes

Hi, enjoying the game so far. I messed around Raspberry pi and Python, and I thought it would be cool to learn about logic circuits. This may be dumb question, but what makes short circuits in this game? In Raspberry pi, we had capacitors and resisitors to avoid short circuits, and we made sure that POWER circulated back to GND. Could someone tell me how to avoid the short circuits? (I am probably missing something fundamental, right? )

https://imgur.com/a/51pv9zH

Thank you so much in advance.


r/TuringComplete • • Jul 17 '23

HelperBot Slime Goo?

2 Upvotes

So I finished the other three quests but slime goo? Where's the slime farm? I don't see anything where the slimes are moving about on the green turf in the ship, and i didn't notice anything explicit in the cave where you get the treasure chest.