BD n-pulsers

A place to talk to other users about the mod.
Post Reply
User avatar
Harcion
Posts: 59
Joined: Thu Jul 21, 2011 9:20 am

BD n-pulsers

Post by Harcion »

Disclaimer: I'm aware (now that I looked more in-depth in the automatic tree farm thread, see Stormweaver's post here: http://sargunster.com/btwforum/viewtopi ... e5ed#p5773) that you can do this similarly using a clock, a BD-counter and a RS-NOR latch. Regardless, this way might be more compact for certain values of n. I also wanted to throw the concept out there to see if anyone thinks of something cool to do with it, or comes up with a nice generalisation or simplification.

I wanted a circuit that given an initial pulse outputs n pulses, for some value of n.

For 1 <= n <= 8, this circuit does that:
Spoiler
Show
Image
The input is behind the BD, the output is anywhere along the redstone line closest to the camera. The redstone torch is just for testing that it works by counting how many times it turns off. You have to fill the BD with n different conductive block types and one non-conductive block or entity. The number of repeaters can be changed in the obvious way. In this picture, a pulse generated by a button can be handled, with for example just 2 repeaters you have to use a shorter input pulse.

For larger values of n things become a little trickier. If you put two of the first circuit in parallell and stack one with n conductive blocks and the other with m conductive blocks (plus a non-conductive in each) the output will be lcm(n,m) - 1. Here, lcm(a,b) means the least common multiple of a and b. For example, lcm(3,5) = 15. Check https://secure.wikimedia.org/wikipedia/ ... n_multiple if you are unfamiliar with the concept, it's pretty straightforward.

If you ignore everything to the right of and including the BD on the right in the following picture, this illustrates the circuit:
Spoiler
Show
Image
Unfortunately, this only gives you n in {9, 11, 13, 14, 15, 17, 19, 20, ...} where I didn't check higher numbers. The point is that 10, 12, 16 and 18 are not included. Of course my application needed precisely n=10. Hence the right-most part in the picture, this is simply a BD-counter loaded with 1 conductive block and k-1 non-conductive stacks.

This means that you can divide the output from the first part of the circuit by k, so for example using n = 3, m = 7 and k = 2 will give you (lcm(3,7) - 1) / 2 = 20 / 2 = 10.

Unfortunately (again!), this still does not work for 12, 16 and 18 as multiplying by 2 and adding one yields 25, 33 and 37 which are bad numbers in this case. Note that lcm(5,5) = 5 and not 25.

I haven't really tried to prove which numbers that are permissible, but using some tables it's pretty easy to check for larger numbers too.

What you can do for 12, 16, 18, etc. is the following:
Spoiler
Show
Image
The idea is that you have one slow n-pulser driving a fast m-pulser so that each pulse from the n-pulser yields m pulses from the m-pulser resulting in n*m pulses in total. I didn't fiddle around with it enough to match up the delays on them, but I think it is possible to get the output pulses evenly timed here too.

Of course, you could also use the last design for 10 output pulses instead of the parallell design. However, I still like the parallell one more for some reason, even though it takes one more BD.
Last edited by Harcion on Tue Aug 09, 2011 4:27 am, edited 1 time in total.
User avatar
Stormweaver
Posts: 3230
Joined: Wed Jul 06, 2011 7:06 pm

Re: BD n-pulsers

Post by Stormweaver »

ooooh, nice and in-depth, I like it.

I normally tie in this kinda of functionality with the counter I'm using - it works out more space efficient in some cases, and can get you around the repeater-freeze issue with BD clocks - but as a stand alone concept, this seems great.

EDIT: I'll just tack this on, in-case anyone finds it useful. When using the BD as a B-Flip flop, if you don't want to use a redstone torch + conductive block as the output (often due to space issues), due to the BD requiring a constant signal to maintain it's state you can replace the conductive block with redstone wire, and place a redstone wire on top of the BD for the same effect.
PatriotBob wrote:Damn it, I'm going to go eat pumpkin pie while I still think that it tastes good.
Rasuth
Posts: 141
Joined: Sat Jul 09, 2011 7:57 am

Re: BD n-pulsers

Post by Rasuth »

Stormweaver wrote:ooooh, nice and in-depth, I like it.

...

EDIT: I'll just tack this on, in-case anyone finds it useful. When using the BD as a B-Flip flop, if you don't want to use a redstone torch + conductive block as the output (often due to space issues), due to the BD requiring a constant signal to maintain it's state you can replace the conductive block with redstone wire, and place a redstone wire on top of the BD for the same effect.

If the BD is powered directly it will also power the Block in front of it. Meaning: Unless you need the redstone on top of the BD for some other curcuitry you can leave it out.
TaterBoy wrote:Well, now I know. And as GI-Joe says, knowing is half the battle. :)
The other half is violence.
Unless you're GI Socrates. Then the other half is "You don't know anything
- TheAnarchitect
User avatar
Stormweaver
Posts: 3230
Joined: Wed Jul 06, 2011 7:06 pm

Re: BD n-pulsers

Post by Stormweaver »

Rasuth wrote:
Stormweaver wrote:ooooh, nice and in-depth, I like it.

...

EDIT: I'll just tack this on, in-case anyone finds it useful. When using the BD as a B-Flip flop, if you don't want to use a redstone torch + conductive block as the output (often due to space issues), due to the BD requiring a constant signal to maintain it's state you can replace the conductive block with redstone wire, and place a redstone wire on top of the BD for the same effect.

If the BD is powered directly it will also power the Block in front of it. Meaning: Unless you need the redstone on top of the BD for some other curcuitry you can leave it out.
there's that too; I've been trying to avoid it in a lot of places though; it's too easy to get into a habit of powering everything with repeaters.
PatriotBob wrote:Damn it, I'm going to go eat pumpkin pie while I still think that it tastes good.
Post Reply