Jump to content

4-bit comparator


Recommended Posts

It checks if one input is higher, lower or equal to another input.

What you could use it for is if you have several ranches and you want to keep track of whether the population is growing, staying the same, or diminishing You can then count the number of eggs picked up over a certain time frame. Store the result in a 4-bit memory. And on the next count compare it against the stored count.
You can then hook it up to notifiers to keep you informed if the ranches are performing as they should. And pause/zoom if something is completely wrong. This enables you to not having to check your ranches on a regular basis but just have them running. The automation checks if they're performing correctly.

image.thumb.png.172a7cf8cd303f3ea4c1ecbd5b71293b.png

image.thumb.png.46a9be33b93ad58147e953186cc6d322.png

image.thumb.png.abb95f54b4af3f74e1640e5ab883e12a.png

4-bit memory can be found here: 

An old sample 4-bit counter build I had lying around

image.thumb.png.aee9c50c456ba99ced1f48604fea94a9.png

Note that you can use the inverted output to prevent overflow with a group OR gate, ie. a filter/buffer set to 0.1s

image.thumb.png.a975630ac43b4f8361286f9d6a09a0a3.png

I can't wait to see what other uses people can come up with.

Link to comment
Share on other sites

This kinda reminds be of the signal Distributor, is there any similarities or am I just confusing something?

I am extremely computer illiterate in terms of advanced [insert official name of RL automation designation], I am asking because to a illiterate like myself sometimes things might look similar but they are actually different when you get down to the nitty gritty.

Link to comment
Share on other sites

1 hour ago, Ntr1cate said:

This kinda reminds be of the signal Distributor, is there any similarities or am I just confusing something?

Absolutely none.

The first sentence of my post explains what it does.

13 hours ago, Saturnus said:

It checks if one input is higher, lower or equal to another input.

 

Link to comment
Share on other sites

Maybe I should explain how a comparator works because it's actually a good introduction into slightly more advanced automation.

If we for a minute forget about the build I posted above and I instead show a standard comparator setup where the inputs are ordered from most significant bit to least.

image.thumb.png.febb34cbd8ac4351e8aa72793a9a628f.png

The NOT-AND part checks if the bottom input is higher than the top input, so only in the case that this is true will the output be green
As you can see only the bottom option returns a green output.

image.thumb.png.85d1e93df2e555397680313de22ef585.png

The XNOR, ie. XOR with NOT on output checks if the two inputs are the same and outputs green if they are
image.thumb.png.c1f75c40956639f2078ef7e0b720f868.png

Now we have all the information we need to proceed because if the NOT-AND returns a green then the bottom input has higher value
And if the XNOR returns a green then we know the inputs are of the same value. And logically that also means that if neither is green then the bottom input is of lower value than the top input.

So if the bottom input is of higher value on the most significant bit then we don't really need to check anything else as it's value will always be higher than the top input no matter how many bits there are.

Similarly if the opposite is true that the top input being of higher value than the bottom one on the most significant bit then we don't need to check the rest of the bits.

The XNOR output is carried to an AND gate on all the lesser significant bits because if the most significant bit values are the same then we need to check the next most significant bit instead until we get to the least significant bit. You can see that in the top diagram where green XNOR outputs on the higher significant bits goes to AND gates on each of the less significant bits which allows the returning of any value from the comparator on each of the lesser significant bits because as we just established they only need to be checked if the higher significant bits are the same value.

My original design works the same way just working with ribbons directly, and using a feedback instead of a feedforward. If you trace it you'll see it's actually does exactly the same.

Anyway. Hope this was of some value to someone at least.

To round it of I've made a two bit comparator with all options so you can track the differences yourself to get a sense of how the cascading AND gates opens or blocks the result of the second comparator because with two bits there's just one.

image.thumb.png.3478117d6d3f508510405566d4ae64cf.png

Link to comment
Share on other sites

On 8/12/2022 at 1:55 AM, Saturnus said:

Maybe I should explain how a comparator works because it's actually a good introduction into slightly more advanced automation.

If we for a minute forget about the build I posted above and I instead show a standard comparator setup where the inputs are ordered from most significant bit to least.

image.thumb.png.febb34cbd8ac4351e8aa72793a9a628f.png

The NOT-AND part checks if the bottom input is higher than the top input, so only in the case that this is true will the output be green
As you can see only the bottom option returns a green output.

image.thumb.png.85d1e93df2e555397680313de22ef585.png

The XNOR, ie. XOR with NOT on output checks if the two inputs are the same and outputs green if they are
image.thumb.png.c1f75c40956639f2078ef7e0b720f868.png

Now we have all the information we need to proceed because if the NOT-AND returns a green then the bottom input has higher value
And if the XNOR returns a green then we know the inputs are of the same value. And logically that also means that if neither is green then the bottom input is of lower value than the top input.

So if the bottom input is of higher value on the most significant bit then we don't really need to check anything else as it's value will always be higher than the top input no matter how many bits there are.

Similarly if the opposite is true that the top input being of higher value than the bottom one on the most significant bit then we don't need to check the rest of the bits.

The XNOR output is carried to an AND gate on all the lesser significant bits because if the most significant bit values are the same then we need to check the next most significant bit instead until we get to the least significant bit. You can see that in the top diagram where green XNOR outputs on the higher significant bits goes to AND gates on each of the less significant bits which allows the returning of any value from the comparator on each of the lesser significant bits because as we just established they only need to be checked if the higher significant bits are the same value.

My original design works the same way just working with ribbons directly, and using a feedback instead of a feedforward. If you trace it you'll see it's actually does exactly the same.

Anyway. Hope this was of some value to someone at least.

To round it of I've made a two bit comparator with all options so you can track the differences yourself to get a sense of how the cascading AND gates opens or blocks the result of the second comparator because with two bits there's just one.

image.thumb.png.3478117d6d3f508510405566d4ae64cf.png

It's provided some insight for me, thanks for the explanation

Link to comment
Share on other sites

Is ranch such a problem?

1) Build an auto-trap Critter Drop-Off on your farm with a higher priority.
2) Build an Incubator on your farm with a higher priority so that the manipulators lay eggs there first.
3) Connect the Critter Sensor to the Incubator. (Only count creatures).
4) Build a second Critter Drop-Off in your kitchen or animal mortuary.
(A system for dumping animals into a room where water is automatically filled and drowns animals.
The Duplicant Sensor will prevent you from drowning a Duplicant.
The animal may not die, so make the system auto-reset flooding until the animal dies.)
5) For non-sinking animals, you can vacuum the system and use magma instead of water.
6) Eggs are destroyed on the Egg Cracker.

Minimal automation. Farms should NEVER be monitored at all.

It is interesting to watch the use of complex automation, but in practice I do not see any use in it.

Link to comment
Share on other sites

9 minutes ago, Genry said:

Is ranch such a problem?

I don't think you quite get the reason behind it. The build came up because someone asked if it was possible to have a large ranching set up that you never ever had to actively watch and where dupes did the least amount of work possible so the player that asked could concentrate 100% on making builds elsewhere on the map and never have to worry about the ranching stuff.

It really doesn't matter if it could be done differently. That's completely irrelevant.

Link to comment
Share on other sites

8 minutes ago, Saturnus said:

I don't think you quite get it. The build came up because someone asked if it was possible to have a large ranching set up that you never ever had to active watch and where dupes did the least amount of work possible so the player that asked could concentrate 100% on making builds elsewhere on the map and never have to worry about the ranching stuff.

I do not understand.
The ranch has a limited number of places. It is physically impossible to make it big. Duplicants still have to keep an eye on the creatures at the station.
The only thing they need, besides this, is the transfer of the animal from one place to another once every few cycles. The eggs are immediately delivered to the kitchen, where the chef is already working with them.

If you need resources, then you cannot fully automate everything.
If you want 1,000,000 wild creatures and food, then nothing needs to be watched, it lives its own life, and the manipulator collects meat.
So what's the point?

Link to comment
Share on other sites

5 minutes ago, Genry said:


The ranch has a limited number of places. It is physically impossible to make it big.

What are you talking about? Of course you can make it big. We're talking dual 6 stacked ranches with layering pez and all critters limited to move in one tile only.

Link to comment
Share on other sites

17 hours ago, Genry said:


The only thing they need, besides this, is the transfer of the animal from one place to another once every few cycles. The eggs are immediately delivered to the kitchen, where the chef is already working with them.

I believe your looking at the reasoning incorrectly, the purpose of the design is precision efficiency on a large scale, while timers and other automation can fullfil the casual players desires on casual game play precision, it still lacks accuracy for a precision design on a higher level for those with the desire for a higher sense of game play.

Its like a person her buys a second hand normal car verses a person who buys a fuel efficient sports car. they both drive you from "A" to "B" but the fuel efficient sports car is both fast and more fuel efficient while being a little more expensive on the initial cost while the second hand car is cheaper initially but it's long term usage turns a loss overall over time.

17 hours ago, Genry said:

If you need resources, then you cannot fully automate everything.

It's not about everything being in a condition of fully automated without duplicant interaction, it's about fully automating those things that can be automated. from doors for duplicant movements, eggs availability in drowning stations or incubators, and how many critters in each stable at any given time, etc etc.

18 hours ago, Genry said:

If you want 1,000,000 wild creatures and food, then nothing needs to be watched, it lives its own life, and the manipulator collects meat.
So what's the point?

Whether someone plays on a accuracy or plays on a "accumulate until infinity" or plays fast or plays slow, is each players opinion and has nothing to do with you with the exception for yourself.

Link to comment
Share on other sites

On 8/14/2022 at 1:44 PM, Ntr1cate said:

I believe your looking at the reasoning incorrectly, the purpose of the design is precision efficiency on a large scale, while timers and other automation can fullfil the casual players desires on casual game play precision, it still lacks accuracy for a precision design on a higher level for those with the desire for a higher sense of game play.

Its like a person her buys a second hand normal car verses a person who buys a fuel efficient sports car. they both drive you from "A" to "B" but the fuel efficient sports car is both fast and more fuel efficient while being a little more expensive on the initial cost while the second hand car is cheaper initially but it's long term usage turns a loss overall over time.

It's not about everything being in a condition of fully automated without duplicant interaction, it's about fully automating those things that can be automated. from doors for duplicant movements, eggs availability in drowning stations or incubators, and how many critters in each stable at any given time, etc etc.

Whether someone plays on a accuracy or plays on a "accumulate until infinity" or plays fast or plays slow, is each players opinion and has nothing to do with you with the exception for yourself.

Let's say I play 150 duplicants:
I don’t have enough labor to take the creature from the farm to the chamber with water every 10 cycles (how long does the egg mature there without boosts?).
Let's say I play 15 duplicants:
Why do I need 150 conditional sad hatches on 1 cell?

I breed animals for resources, and 1 farm is enough for me for all my needs (stone huts, polished huts, both types of drekko, puffs, etc.).
In a large amount, you will not have resources to feed (for DLS), and resources are unnecessary in such quantities - coal, fibers for example.

You are talking about full automation, but I also tell you that I have duplicants, except for the obligatory courtship and transfer of the creature every 10 cycles, they do nothing.
Eggs are delivered automatically.
Animals are killed automatically.
Meat from animals is delivered automatically.
On the farm, I always have the exact number of animals.
And I'm using basic automation - and/or/no/buffer/filter.
So what are you talking to me about? About what kind of automation?
What basically the comparator will give you?

You just come up with complex automation for things that can work the same way without complex automation.

Yes, I agree, it's great. But it's not that it's poorly thought out, but that it's not needed under any circumstances/style of play.

Link to comment
Share on other sites

Really wish we could have more support for more than 4 bits on a ribbon. I know you can rig it such that they carry more bits, but why not just allow this directly on the inpus and outputs. 

@Saturnus, I don't get the upper and gate. the top not gate seems to always output true on all 4 bits

Link to comment
Share on other sites

32 minutes ago, Jann5s said:

Really wish we could have more support for more than 4 bits on a ribbon. I know you can rig it such that they carry more bits, but why not just allow this directly on the inpus and outputs. 

@Saturnus, I don't get the upper and gate. the top not gate seems to always output true on all 4 bits

That's just because the 3 most significant bits happens to be equal in the example posted. The most significant bit will however always be green on the feedback AND gate no matter what. Here's an example where all inputs are different.

Remember that the feedback AND gate carries the XNOR back to the input so you only need one AND gate. Note that between the XOR and NOT there's the less significant bit distribution readers/writers however they still just form an XNOR combined.

image.thumb.png.3af764d32a6ce6ee0e14bc4b6cf704b9.png

 

Link to comment
Share on other sites

17 hours ago, Genry said:

Let's say I play 150 duplicants:
I don’t have enough labor to take the creature from the farm to the chamber with water every 10 cycles (how long does the egg mature there without boosts?).
Let's say I play 15 duplicants:
Why do I need 150 conditional sad hatches on 1 cell?

I breed animals for resources, and 1 farm is enough for me for all my needs (stone huts, polished huts, both types of drekko, puffs, etc.).
In a large amount, you will not have resources to feed (for DLS), and resources are unnecessary in such quantities - coal, fibers for example.

You are talking about full automation, but I also tell you that I have duplicants, except for the obligatory courtship and transfer of the creature every 10 cycles, they do nothing.
Eggs are delivered automatically.
Animals are killed automatically.
Meat from animals is delivered automatically.
On the farm, I always have the exact number of animals.
And I'm using basic automation - and/or/no/buffer/filter.
So what are you talking to me about? About what kind of automation?
What basically the comparator will give you?

You just come up with complex automation for things that can work the same way without complex automation.

Yes, I agree, it's great. But it's not that it's poorly thought out, but that it's not needed under any circumstances/style of play.

Everything is answered in the quote that you quoted me, I won't repeat myself. If you can't see the answer then you can't see the answer.

I have no intention of continuing to discuss with you since it is the same thing but with different words which aligns it to trolling and I have no desire to be part of that..

Link to comment
Share on other sites

Just a brief update. I was actually able to compact it a bit (pun intended) more by using a ribbon reader as bitshifter. That means a ribbon reader and a ribbon writer can be saved. Not much but it does allow more rerouting as well making it possible to make it more compact. That however also makes it slightly more difficult to see what is going on so I included overlays with and without visible ports.

image.thumb.png.275457ee0c6af661a8c4344e53e02a2a.png

image.thumb.png.4427faed4d5d748e325fae5f00144807.png

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...