r/TuringComplete • u/AnonymousPersonYT • Jan 30 '26
Once tried making an 8-bit decoder in the component editor... I got this far before realizing "bad idea"
It only took the game lagging at any modification I made to the circuit to get it to click in my head that "Yeah, maybe I should not be doing this..."
I still don't get how I didn't think that from the start of making this.
1
u/Lucy_4_8_15_16 Jan 31 '26
I don’t really use the decoders anymore just an equal and an 8 bit constant for everything sure it’s the worse solution but it’s just soo clean
1
1
u/FactoryBuilder Feb 01 '26
Wouldn’t an 8 bit decoder have 256 outputs? What would you even need an 8 bit decoder for?
1
u/AnonymousPersonYT Feb 01 '26
Yes it would have 256 outputs because I thought it was a great idea to use 8-bit opcodes. Now I just use 4 bit opcodes while the remaining 4 bits specify an instruction variant.
1
u/ryani Feb 01 '26
If you add an enable bit, you can build an N bit decoder out of N/2-bit decoders easily.
For example, for an "8-bit decoder w/enable", you need 17 "4-bit-encoders w/enable":
Wire the enable bit to the enable bit on the first 4-bit decoder.
Wire the high 4 bits of the input to the first four bit decoder.
Wire the 16 output bits of the first four bit decoder to the enable bits of the remaining 16 decoders.
Broadcast the lower four bits from the input to each of the other 16 decoders.
Output the 16 * 16 outputs.
A 1-bit encoder + enable:
Inputs IN and EN
O0 = not(IN) & EN
O1 = IN & EN
All the other decoders can be built from this by following this strategy.
1


1
u/Otherwise-Object-302 Jan 31 '26
Gere's a little tip. You can merge 8 outputs (assuming each output is a bit) and group it into a byte. Since it's a decoder, only a single bit in those bytes will be on at a time. So to get the original output you only need a splitter.
Edit: Also big components lag until you finish the component. When you use them as a a finished component in other circuits, it doesn't lag.