powercrystals / MineFactoryReloaded

92 stars 121 forks source link

New PRC function #206

Open Glease opened 11 years ago

Glease commented 11 years ago

What I need: Gated Square wave;(normal square wave still output waves when input is 0 ) timer(have the same function as a RP2 timer) Gated timer(I don't think this one need explanation)

Lots of thanks for adding these.

stranger1029 commented 11 years ago

Gated logic is combine Passthrough (Gated) logic. Timer is combine Square wave and One-Shot Pulse logic. It's not 100% same the RP2's logic, but very similar. and, if you need more longer timer gap, combine Counter logic.

powercrystals commented 11 years ago

I'm not sure what you want the timer to do that the square wave doesn't already.

Glease commented 11 years ago

well,the square wave output the following signal: 0000111100001111000011110000…… but what i need is: 000010000100001…… the other part of the system will get corrupted if the signal is like "00001111".It only works with a signal like "0000100001". Yes,Square wave and One-Shot Pulse logic will do the trick,only if i need a pulse every 2n ticks where 2n represent an even number.Unluckily,my system require an odd number,or it will eventually result in a grand explosion and serious radiation.Yes,I use it in CRCS nuclear reactor.

Emys commented 11 years ago

Actually, you can get an odd number, through ~trickery~.

Say you want a pulse every 3 ticks. What you have is square wave output: 000111 000111 000111

Stick that in a variable, and run it to a oneshot 000100 000100 000100

Also run it through a inverter*, 111000 111000 111000

which goes through a variable to another oneshot 100000 100000 100000

Put those on the same output, or combine them with AND: 100100 100100 100100

Admittedly, it is a bit convoluted, but hey, it makes odd ticks possible.

*whoops, meant this. Originally put "negator".

powercrystals commented 11 years ago

The new multipulse circuit lets you define time-high and time-low independently, as well. The square wave will gain that ability in 1.6.

Glease commented 11 years ago

To Emys: err,I got a little shocked.I've never think of this.Thx a lot,both you and negator!But,it may take some diamonds in order to do that as my PRC is full and i need several PRC Logic Expansion card 003 to expand it.. To powerctystals: That's great!