How to implement a tally?

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Post Reply
bcRIPster
Burner Inserter
Burner Inserter
Posts: 12
Joined: Thu Mar 31, 2016 4:56 pm
Contact:

How to implement a tally?

Post by bcRIPster »

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!

ratchetfreak
Filter Inserter
Filter Inserter
Posts: 950
Joined: Sat May 23, 2015 12:10 pm
Contact:

Re: How to implement a tally?

Post by ratchetfreak »

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!
Do you expect more than 2 billion items on the belt? if not then you can store it in a single wire signal.

bcRIPster
Burner Inserter
Burner Inserter
Posts: 12
Joined: Thu Mar 31, 2016 4:56 pm
Contact:

Re: How to implement a tally?

Post by bcRIPster »

Doh. Forgot I could have an edge clock, I got it. For anyone else who wants a tally counter, here's the plan:
tallycounter.png
tallycounter.png (1.52 MiB) Viewed 2380 times

bcRIPster
Burner Inserter
Burner Inserter
Posts: 12
Joined: Thu Mar 31, 2016 4:56 pm
Contact:

Re: How to implement a tally?

Post by bcRIPster »

Follow-up. Here's the latch-less version with a reset line for resetting your tally counts.
compact-tally-with-reset.png
compact-tally-with-reset.png (1.63 MiB) Viewed 2379 times

XKnight
Filter Inserter
Filter Inserter
Posts: 329
Joined: Thu May 28, 2015 10:40 pm
Contact:

Re: How to implement a tally?

Post by XKnight »

bcRIPster wrote:Any feedback? Just wondering if anyone had comments on this. Thanks! =D
If you want to hear my feedback...
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?

bcRIPster
Burner Inserter
Burner Inserter
Posts: 12
Joined: Thu Mar 31, 2016 4:56 pm
Contact:

Re: How to implement a tally?

Post by bcRIPster »

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

Post Reply

Return to “Gameplay Help”