Hi, I am trying to figure out how to store a count. I would like to be able to increment a tally when something goes onto a belt and then decrement that value when the item comes off the belt.
I can see how to do this by making a ripple carry adder but that seems overkill and would be the size of a large city to build. It seems like there would be a simpler way to implement a tally. What am I missing here?
Thanks!
How to implement a tally?
-
- Filter Inserter
- Posts: 952
- Joined: Sat May 23, 2015 12:10 pm
- Contact:
Re: How to implement a tally?
Do you expect more than 2 billion items on the belt? if not then you can store it in a single wire signal.bcRIPster wrote:Hi, I am trying to figure out how to store a count. I would like to be able to increment a tally when something goes onto a belt and then decrement that value when the item comes off the belt.
I can see how to do this by making a ripple carry adder but that seems overkill and would be the size of a large city to build. It seems like there would be a simpler way to implement a tally. What am I missing here?
Thanks!
Re: How to implement a tally?
Doh. Forgot I could have an edge clock, I got it. For anyone else who wants a tally counter, here's the plan:
Re: How to implement a tally?
Follow-up. Here's the latch-less version with a reset line for resetting your tally counts.
Re: How to implement a tally?
If you want to hear my feedback...bcRIPster wrote:Any feedback? Just wondering if anyone had comments on this. Thanks! =D
1) Any practical usages? because counting items inside chest is a little bit useless... several pictures with the real usages will be nice.
2) Lack of optimisation. If your target was to make a simple item counter than you have to reach 3 combinators build (1 comb per 2 inserters, 2 comb for counter).
3) In your build comb #5 (left-bottom) and #4 (right-middle) are useless, comb #6 is optional.
4) Why are you using everywhere strict item type specification? this limits your possibilities.
5) It is possible to speed-up this build (2 ticks are wasted).
6) What will happen if one item is moved from chest, and another item is moved in simultaneously? Think about this.
P.S. awesome decor, what app have you used to make it?
Re: How to implement a tally?
Hi, the images where just done up in photoshop, but thanks.
As for the questions. This was just a quick concept around an idea of a factory with a single belt where everything is built on-demand and moves down the belt resulting in a rocket at the very end (so no extra materials moving down the line, only exactly what is needed for any given factory down the --very long-- belt). It's not going to be the fastest thing around, it's just for fun. If it turns out neat maybe I can put together some screens. IDK...
Anyways, I've actually worked out some of the items you mentioned in my working version. My need was to find a way to count what is on the belt at any given time so factories can be turned off and on as needed, when needed. The finished version looks different than what's in those images.
Those pictures are not optimized, they were just putting together the idea into images to share as soon as the idea popped into my head. But thanks for the feedback.
As for the questions. This was just a quick concept around an idea of a factory with a single belt where everything is built on-demand and moves down the belt resulting in a rocket at the very end (so no extra materials moving down the line, only exactly what is needed for any given factory down the --very long-- belt). It's not going to be the fastest thing around, it's just for fun. If it turns out neat maybe I can put together some screens. IDK...
Anyways, I've actually worked out some of the items you mentioned in my working version. My need was to find a way to count what is on the belt at any given time so factories can be turned off and on as needed, when needed. The finished version looks different than what's in those images.
Those pictures are not optimized, they were just putting together the idea into images to share as soon as the idea popped into my head. But thanks for the feedback.