Page 1 of 1

How to implement a tally?

Posted: Thu Mar 31, 2016 5:02 pm
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!

Re: How to implement a tally?

Posted: Fri Apr 01, 2016 10:13 am
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.

Re: How to implement a tally?

Posted: Sat Apr 02, 2016 1:29 pm
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 2446 times

Re: How to implement a tally?

Posted: Sat Apr 02, 2016 1:31 pm
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 2445 times

Re: How to implement a tally?

Posted: Tue Apr 05, 2016 6:28 pm
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?

Re: How to implement a tally?

Posted: Wed Apr 06, 2016 4:09 am
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. :)