Jump to content

Compact 32 Bit Encoder Decoder


Recommended Posts

So essentially the 4-bit lines are actually at least 32 bit and the couplers have an ElCheapo implementation that just does bit-shifts but no input masking? Obviously not made by a good security coder ;) 

Still sounds a bit exploity to me...

Anyways, if so, it should be possible to bring this down more in size by a add4bits-shift-add4bits-shift-add4bits-... sequence.

Link to comment
Share on other sites

1 hour ago, Gurgel said:

So essentially the 4-bit lines are actually at least 32 bit and the couplers have an ElCheapo implementation that just does bit-shifts but no input masking? Obviously not made by a good security coder ;) 

Still sounds a bit exploity to me...

Anyways, if so, it should be possible to bring this down more in size by a add4bits-shift-add4bits-shift-add4bits-... sequence.

I agree it is very exploity.

Judging by the information in this thread, the state of every wire, including the regular ones is a 32 bit signed integer. I just think that they didn't expect us to *gasp* use the circuitry in a different way than exactly how they advertised, just to see what would happen. I would call it an accident, but what's weird is that there are hard coded exceptions written into the not gate and ribbon reader to avoid causing regular wires to overload if they followed the normal 32 bit rules. Regular wires will overload if any bit besides the first bit (barring the 32nd bit loophole) is green. If not gates followed the 32  bit rules, every not gate would cause regular wires to overload. When a not gate's input is a regular wire, it only flips the first bit and sets the rest to 0. When the input is a ribbon, it flips the first four (why not all 32, I have no idea) and sets the rest to 0. The ribbon writer and reader function as bit shifters, except for when the ribbon reader outputs to a regular wire. In that case it shifts, then keeps the first bit and sets the rest to 0, again to avoid overloading the regular wire.

Unfortunately it is not possible to do a bit shift of 4 using only one writer or reader, because they actually "shift" by one less than the number advertised. In order to read or write to the first bit you don't have to shift at all, 2 shifts by 1, 3 shifts by 2, and 4 shifts by 3 up (down when you look at the wire, but it's a left shift towards the more significant bits) in the case of writers and the opposite for readers. Another important thing to note is the the right shift performed by readers is arithmetic, meaning that if the 32'd bit is green, it will fill in more greens from the right, not add 0s.

 

Link to comment
Share on other sites

19 minutes ago, AverageHuman said:

I would call it an accident, but what's weird is that there are hard coded exceptions written into the not gate and ribbon reader to avoid causing regular wires to overload if they followed the normal 32 bit rules.

Well, some masking, even conditional masking is in there, but other things transfer more than the channel advertises. Not that big a deal here, but I felt very much reminded of quite a few code exploits I have looked at. There often is some additional functionality that should not be there, in some parts it is masked and in others handled, but in some places it got overlooked and that is where the attackers get in. The root-cause is non-obvious functionality, like 32 bit in what claims to be a  4 bit channel.

Now, the security aspect is of course completely irrelevant here. But I still think they should either mask out the bits above 4 or give us a real 32 bit or 64 bit value transfer with all the operations that implies (logic, arithmetic, shifts, comparison, constants). Personally, I think the latter is taking things way too far. Gate-logic as currently present is all the game needs, even the 4-bit wires are, in my view, "specialty content" that can be ignored without any impact on most of the gameplay. Actual electronics goes rarely beyond a few gates these days and typically uses a microcontroller for anything more complex. Of course, a, say 4 bit MCU with, say, 4 bit input, 4 bit output, 16 4 bit registers and program memory for 32 instructions in some assembler-like language would be the thing to do next. Whether that is still ONI or some other game is up to debate. I never have needed more than simple logic in this game and adding complex logic without any need and as its own purpose might not be a good idea.

Link to comment
Share on other sites

I quote you dupes above, then say: I clearly remember, from the stream... "You could run Pong on that".

Then someone else in some post... "Can it run Doom"?

Maybe not. But everything else.. try it. Do it. I'm eager to see.

I know the crazy sound engineer (IIRC) is gonna deliver. So hurry up.

Spoiler

Super PlumberDupe Bros, lvl 1-1.

 

Link to comment
Share on other sites

16 minutes ago, Saturnus said:

I don't see how. Honestly, please explain how ribbons being able to be used with up to 32bit instead of 4bit gives any actual advantage to game play.

Only an advantage in that you're allowed to use a type of wire that technically doesn't exist. Basically all they need to be doing is provide a bit mask on the type of wire and make no assumptions in the logic chips themselves. like say there is an OR gate with 1 1-bit wire and 1 4-bit wire as inputs and a 1-bit wire output. z = ((x & 0x1) | (y & 0xF)) & 0x1. the logic chip would be referencing the mask from the wire directly.
 

Link to comment
Share on other sites

37 minutes ago, Risu said:

Only an advantage in that you're allowed to use a type of wire that technically doesn't exist. 

Exactly what I mean. It can help geeks like us to make simple snake or pong games within the game but it has absolutely no actual impact on the game itself.

It doesn't let you build a more effective oxygen set up or save some power in your power plant for example so why even worry about it. Just use it if you want to.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...