#Unsignad Less

1 messages ยท Page 1 of 1 (latest)

main sand
#

Clean, although not perfect

fluid garnet
#

That's pretty gate efficient ๐Ÿ‘.
Now time to make a delay optimised version.

main sand
#

don't ask me why this works (signed less)

main sand
fluid garnet
main sand
fluid garnet
#

brb

main sand
#

it doesn't fit in my head entirely, it's too complicated

fluid garnet
#

Sorry, it took a while, but here's my solution.
RSH by 1 CCs perform a constant/static logical right shift &
the remaining ones are just the legacy 1 bit switch replacement CCs:

main sand
crystal musk
#

It's the inductive method. A[n..] < B[n..] = A[n] < B[n] or (A[n] = B[n] and A[(n - 1)..] < B[(n - 1)..])

#

||The OR gates in the top-left calculates X | Y' aka X >= Y. The XOR calculates X ^ Y aka X != Y.

If you expand the inductive method expression I gave for n = 7, you'll end up with (A[7] < B[7]) or (A[7] = B[7] and A[6] < B[6]) or (A[7] = B[7] and A[6] = B[6] and A[5] < B[5]) ...; the long "and" chains are equivalent to "nor" chains with the operands inverted, because of de Morgan's law. Switches give you "or" for free, and the operands are already inverted (the OR and XOR are calculating >= and != instead of < and ==.||

crystal musk
#

(BTW you can get 62/5 if you use a different inductive method)

fluid garnet
crystal musk
#

Switches

valid lily
#

my solution, ||just uses XOR gates to get the different bits then selectors to either keep the existing result or change it starting from least to most significant||

#

signed less ||is just the same with a not gate for the last bit||

dense pulsar
fluid garnet
# dense pulsar The problem with this answer is that it outputs either 1 or Z instead of 1 or 0....

This is not a problem for the game's scoring & this won't likely change ever,
because of the simulation performance implications,
so this solution is perfectly valid in my eyes.

Anyways, while not exactly intended, this is perfectly acceptable & the reason
(or at least one of them) why the [save_breaker] alpha's scoring was changed the way it was,
was because switches in the [stable] release were OP in every possible usecase (that you could use them in),
now you have to actually think how to obtain the best score & not just spam switches everywhere.

If you don't want to take advantage of the Hi-Z -> 0 coercion of input pins, then just don't use it.

dense pulsar
fluid garnet
dense pulsar
#

You just voided the Delay=2 of the 3-port OR decided by the developpers...

fluid garnet
# dense pulsar You just voided the Delay=2 of the 3-port OR decided by the developpers...

In practice the use of that gate is very sub-optimal,
as it disables you from using the intermediary OR gate,
so it is always more optimal to implement it using 2 x 2 input OR gates,
especially if you need the intermediary signal or have the space for it.
Similarly with the 3 input AND gate.

And besides, it is usually beneficial to use normal gates instead of switches,
but as long as they aren't influencing the critical path of the circuit,
as they're always better gate-wise.

dense pulsar
#

Well, depends on the use. For a 8-input AND/OR, chaining 2-input AND/OR would lead to a delay of 3 instead of 4 while using 3x3-input + 1x2-input.

The intermediary signals are not always needed.

Using proper OR would only add 4 to the delay of your solution (which would still be the best atteignable delay without using unsafe hacks which could stop working at a later time and are definitively not "export to verilog" friendly)

fluid garnet
quartz moat
#

If this isn't export to verilog safe, that is a bug in the exporting functionality. I say that as the person who implemented it.

#

Using switches for this is fully indented functionality. This might get disabled once/if we get the transistor-based mode, but even then it will stay available in the main game

dense pulsar
#

so I don't think that it'd impact the functionnality that much

fluid garnet
dense pulsar
#

It could be quite fun... at least for people used to electronics... But for the "basic player" (if any), it could end-up being a real nightmare

#

(remind me University where I had to create a 8x8 bit pipelined multiplier on Compass)

quartz moat
#

Which is why it will never be the baseline experience

fluid garnet
dense pulsar
#

We could even end up with a behaviour like "Hi-Z on input means keep the previous value" (like it would with MOSFET thanks to the gate capacitance)...

quartz moat
#

It will not happen.

#

The current behavior is the result of 3 years of experimentation.

#

Something dramatic has to happen for this to be changed.

dense pulsar
quartz moat
#

Version 2.0 didn't actually change much with regard to how switches behave

#

Output components just gained the ability to distinguish between Z and 0, which makes them quite unique

dense pulsar
#

[by the way, is it possible to split the discussion and move it to some other (more adequate) channel ?]

#

Version 2.0 is still not "out of the box" ๐Ÿ˜‰ Who knows what changes may come for the version 3.0 ๐Ÿ˜‰

DRAM-like behaviour may add the use for an actual clock signal... which in turn would help in situation like pipelined processing.

fluid garnet
# dense pulsar We could even end up with a behaviour like "Hi-Z on input means keep the previou...

While this would be more likely to happen than erroring the circuit on Hi-Z
(as it would be as simple as to initialize a variable to what was on the wire in the previous tick),
but it would likely introduce even worse switch cheese in different situations.

And the only way that you could get the former behavior,
is when we'd get the front-end to perform very complex static analysis of the circuit,
to essentially allow it to test if there could be no or too many signal sources on a wire active at one time,
and then it would throw you some form of circuit compile-time error.
But that's not something that's likely to happen at this point, or ever TBH
(which was my impression of the way Stuffe & Megalng felt about this in other discussions).

quiet crag
#

my terrible solution

#

clean at least

#

(and easy to convert to signed)

abstract scroll
#

I've found a solution that is 41/16

#

pretty proud of that, although I know people have done better and I dont know how to improve it xd

main sand
abstract scroll
# main sand I'm terrible at hardware optimization lol. I don't know yall do it. I just barel...

Its nothing really that hard, you just have to know some tricks, at least to get you started.
First, you usually want to avoid using components, unless in some specific scenario.
Here is what I know:
After you replace the components with their logic gates, you can first see that in 7 of the 8 components of the output "A > B" is followed by a NOT. This means that in those cases you can remove the not gate and replace the AND gate with a NAND gate.
Then you can also see that the output "A = B" in the component is never used, so the NOR that is used there is a waste.
This one is a bit more tricky, but instead of using a NOT gate for both of the inputs in the component, you can NAND both inputs, and use the output for both AND gates you have rn. (This makes you save 7 + 8 + 8 gates)

main sand
#

So leave components away to deobfuscate whats happening on the gate level and with some boolean skills it becomes more visible that the logic is bloated and how to fix it