BG1, PRELOAD BG2, PRELOAD

Logic Blog

Welcome To the Wonderful World of Wenches!!

Rating: 7 votes, 5.00 average.
Welcome to the Wonderful World of Wenches!


Indeed, what better way to kick off the logic blog than with a basic overview of my favouritest thing in the (littleBig) World: wenches!! Yes, as many of you know, the vast majority of the logic I use involves a winch somewhere in it, so it seems the best place to start is with a rundown of basic winch techniques.

Now I know I said I wasnít planning on doing a ďhere are some generic switchesĒ type approach, but as it turns out, that's exactly what I'm about to do. Iím pretty sure you are all familiar with the ANDs and ORs and suchlike that Iím listing here, but thatís not important. What is important is laying down the skills and technical understanding, to build upon in future.


It's painfully obvious to me that I have gone overboard on this post. I apologise in advance for its obscene length. I could have broke it out into two parts, but I didn't, feel free to take a break after Section 3.




------------------------------------------------------------------------------------------------------



1. Why Winches?
Winches are quite a unique thing in LBP. Depending on how you look at them, they can be one of the most versatile of all components in the game. But massively overlooked and under appreciated. The winch has one simple, fundamental property:
  • Winches can pull an object in, but they cannot push it away.


Now everyone knows this, but I think a lot of people didn't really appreciate the scope for such a simple feature. We can manipulate this one property to perform a whole host of tasks. So letís cover a couple of very simple examples that many of you should be familiar with.

Spoiler Spoiler - geekNotes - On Winch Analogies





------------------------------------------------------------------------------------------------------



2. The Set Ė Reset Switch
Probably the easiest winch-based logic circuit to understand is the set-reset switch, plus you should all be familiar with it from the Logic Pack. The set-reset has two inputs, set to turn on the output and reset to turn it off.

If you make set TRUE, then the output becomes TRUE, but then when you make set FALSE again, the output remains TRUE. Similarly if you make reset TRUE, the output becomes FALSE, and when you let reset become FALSE again, the output remains FALSE. In this way it has a kind of memory Ė itís output doesnít just depend on what the inputs are doing at that moment in time.


2.1. Building the Switch
So where do the winches come in? Well, the set-reset device is shown below:



The lengths of the winches are such that when extended, the winch will have no effect on the magnetic key block. The winch on the same side as the magnetic switch is the set, the one on the opposite side is the reset. Both winches are set to be backwards and operate at 0.1s timing, so that when activated, they pull the block towards them.


2.2. How Does it Work?
The following is a slightly verbose analysis of the whys of the switch, as we move on I'll start being more succinct with my explanations:


If the set is TRUE and reset is FALSE, its winch will pull the magnetic key towards the magnetic switch and the output will become TRUE:



Similarly when reset is TRUE and set is FALSE, the winch pulls the magnetic key away from the magnetic switch, making the output FALSE:



If neither input is TRUE, then both winches are extended (because they are backwards) and so neither of them has any effect on the magnetic key. It will stay exactly where it is, in either of the positions shown above.


2.3. Tweaking the Device
The analysis above says nothing about the fourth condition, when both set and reset are TRUE at the same time. Both will be pulling on the key and there is no clear indication of what will happen. To accommodate for this, we can adjust the strengths of the winches so the device favours either set or reset.

For example. If the set winch is at strength 10, and the reset winch is at strength 5, both will act normally when activated individually, but when both are activated at the same time, we have a situation where the two connectors are ďfightingĒ each other, just like in a tug of war. Now, itís important to note that there isnít really a fight, we can analyse this situation by simple summation of forces and find it's quite neat and predictable.

If we consider that
  1. winches can only ever exert a force towards themselves
  2. In this case, the strength of the connectors is proportional to the force exerted
  3. Movement towards the magnetic switch is considered positive.


We can draw up the following table.

Code:
.
    Set    |   Reset   ||     Output     | 
-----------|-----------||----------------|
 FALSE (0) | FALSE (0) || No Change (0)  |
 FALSE (0) | TRUE (-5) ||   FALSE   (-5) |
 TRUE (10) | FALSE (0) ||    TRUE   (10) |
 TRUE (10) | TRUE (-5) ||    TRUE   (5)  |
------------------------------------------
.
The numbers in brackets are the forces involved; as you can see, the overall force (in the output column) is simply the sum of the connector forces from the other two columns. A large amount of logic can be developed around this simple concept of summing forces. As long as you keep all of the motion in a single dimension (i.e. in a straight line), the analysis is quite easy.


2.4. Notes
There are a couple of things to note about this device.

  1. A minor thing is that it has to be stationary and horizontal at all times. Encased in dark matter as shown it is fine. Otherwise, when both inputs are inactive, the glass will slide around and cause all kinds of nastiness. More on this in a later edition.
  2. You cannot directly see what the inputs are doing. On a typical piston-driven switch, you can see the inputs activate and deactivate as the pistons move. Not true here, you can only see the output. This is a typical thing with winch logic and is likely to cause you much anguish during debug. Don't say I didn't warn you.





------------------------------------------------------------------------------------------------------



3. The OR Gate
I know what youíre thinking: ďBut Richard, everyone can make OR gates! my Nan can make a freakin' OR gate in her sleep! why are you showing us this?Ē Well, this OR gate is smaller and lower thermo than more conventional implementations, I invented it, and Iím almost 100% sure that itís not possible to implement a lower-thermo combinatorial OR gate than these, so turn the smugometer up to 11 and bear with me here. More importantly, it's a key component design for everything I do, so it's needed.


3.1. Building the Switch
The winch-based OR gate is shown below:

. . . .


Tweak the connectors to the following:

Code:
.
 Connector  |   Min   |   Max   |   Strength   |   Time   | 
------------|---------|---------|--------------|----------|
   Piston   |   0.1   |    5    |      5       |    0.1s  |
   Winch    |   0.1   |    5    |      10      |    0.1s  |
-----------------------------------------------------------
.
Note: that both connectors are set to backwards and inputs are directional. Also note the difference in the strengths. This is the "weak piston / strong winch combo" I've been touting for the last few months.


3.2. How Does it Work?
Well as before, we can analyse the system in terms of strengths of the connectors. Remember that the piston is stiff, so that keeps our motion in one dimension and also makes things easier.

We will consider motion to the left to be positive, so when active:
  • The piston exerts a force of 5
  • The winch exerts a force of 10


and when inactive:
  • The piston exerts a force of -5
  • The winch exerts a force of 0


So if we draw up another table:

Code:
.
 Winch Input  |   Piston Input   ||   Output   | 
--------------|------------------||------------|
  FALSE  (0)  |    FALSE (-5)    || FALSE (-5) |
  FALSE  (0)  |    TRUE   (5)    || TRUE   (5) |
  TRUE  (10)  |    FALSE (-5)    || TRUE   (5) |
  TRUE  (10)  |    TRUE   (5)    || TRUE  (10) |
------------------------------------------------
.

If either of the inputs is TRUE then the overall force (in the output column) becomes positive and so the output becomes TRUE. It should be clear that this is the characteristic behaviour of an OR gate. Note as well that the overall force is never zero - it's always going to push or pull.


3.5. Notes
As it has only one moving part, it is lower thermo than a conventional gate, which would typically use two. It can also take up less physical space than conventional versions as well, if that's what you're into.

I have done thermonalysis on this many moons ago to see if the "multiple connectors on one object" causes a boost. It doesn't.

Note again that you can never see value of the inputs. The moving part shows you the outputs, but you have to go back to the sources to check the input states.




------------------------------------------------------------------------------------------------------



4: The AND Gate
The winch-based AND gate is very similar to the winch based OR gate. In fact it has the exact same configuration, but the piston and winch are no longer set to backwards and the magnetic key is inverted.

. . . .

Now this brings up an interesting point about inversion. In electronics, we have these concepts of NOT gates. Not gates just take a single input and output the opposite. Due to the backwards property of connectors and the invert property of switches, we can pretty much handle all of our inversion inside the existing gates.


Spoiler Spoiler - geekNotes - On De Morgan's Theorem



4.1. How Does it Work?
Same analysis as for the OR gate:

We will consider motion to the left to be positive again, but everything is inverted. So when active:
  • The piston exerts a force of -5
  • The winch exerts a force of 0


and when inactive:
  • The piston exerts a force of 5
  • The winch exerts a force of 10


Also remember that we need a negative overall force (movement to the right - check the pictures) to get a TRUE output. So if we draw up another table:

Code:
.
 Winch Input  |   Piston Input   ||   Output   | 
--------------|------------------||------------|
  FALSE (10)  |    FALSE  (5)    || FALSE (15) |
  FALSE (10)  |    TRUE  (-5)    || FALSE  (5) |
  TRUE   (0)  |    FALSE  (5)    || FALSE  (5) |
  TRUE   (0)  |    TRUE  (-5)    || TRUE  (-5) |
------------------------------------------------
.
So the output is only TRUE if both inputs are TRUE. Which would be an AND.

4.2. Notes



------------------------------------------------------------------------------------------------------



5. Flexible Number of Inputs
With these ANDs and ORs, having one moving part on a two input gate is a slight improvement on other designs. But what if you could have only one moving part for any number of inputs you want? Well, itíd be awesome is what and Iíve got good news for you: the designs above can be extended to take any number of inputs.

OK, I say "any number", I tried it with the nice round number of 16 and that performed fine, I canít vouch for any more than that, because I got bored, or somat more interesting happened.


5.1 Flexible Number of Inputs OR
This flexible number of inputs is achieved by adding an extra winch for each extra input. This winch is configured the same as the first winch. That's it, all you need to do. Below is an image of the flexible OR:

. . . .



I'm not going to do the analysis in full, but feel free to do it yourself, it's just summation of forces again. As a hint, you will need 16 rows for your truth table to cover all of the input combinations. It's probably quicker to just make one of these in create mode and show yourself it works.


5.2. Flexible Number of Inputs AND
You can do the exact same thing with the AND gate from section 4 as well.

. . . .



5.3. Notes
As before, hard to see inputs, blah-de-blah, etc, you get the idea...

Obviously the thermo saving of this technique should be clear to every one. More traditional methods would have a single moving part per input. By going this route we half the number of moving parts for 2 inputs, quarter it for 4 etc. etc. The bigger the gate, the more you save.



------------------------------------------------------------------------------------------------------



6. The Quick Reset Timer
The quick reset timer is another nice switch from the Logic Pack. It has the characteristic of moving in one direction very fast (0.05s) and back the other way as slowly as you want. Hence "quick reset".


6.1. Building the Switch
The image below shows the quick reset timer device. It's exactly the same as the AND from above, except the magnetic switch has a larger detection area - it should only activate when the key reaches the very end of its motion.

. . . .


The magnetic switch is set to inverted and the piston and winch are set up with the following settings:
Code:
.
 Connector  |   Min   |   Max   |   Strength   |   Time   | 
------------|---------|---------|--------------|----------|
   Piston   |   0.1   |    5    |      5       |    10s   |
   Winch    |   0.1   |    5    |      10      |    0.1s  |
-----------------------------------------------------------
.
Connect the buttonís direction output to both the piston and the winch so they are both either extending or contracting.


6.2. How Does it Work?
When the input is activated, the input to both the piston and the winch becomes TRUE and they both start to extend. Remember that the winch cannot push, so only the piston has any effect. It pushes out slowly and takes 5 seconds to fully extend (half the time as it is only going one way)

When the input to both of the connectors becomes FALSE they start to retract. Because the winch is stronger than the piston, it can overpower it. Effectively, only the winch is taken into account, the timer pulls back in using the 0.1s timing. This gives us the quick reset. Simples

Spoiler Spoiler - geekNotes - On Connector Tweaking and Relative Power





------------------------------------------------------------------------------------------------------



7. Summary
Sooo... nothing actually new here, in terms of the switches, but I have surreptitiously introduced you to:
  1. Basic Winchy logic concepts
  2. How connectors interact when opposing each other.
  3. Use of mathematical analysis of designs
  4. Truth Tables
  5. A teensy bit of Boolean Theory, if you followed that geekNote under the AND gate (don't feel bad if you didn't - that part made comphermc go weak at the knees )

All of which will be important as we move forward.

7.1. Did I make a level with this stuff in?
Why of course I didn't! Not because I'm mean, I just want you to go out and make them. None of them are hard to make and the instructions are all there. If you hit any problems then I'll be glad to help out, but you need to memorise how to make these devices, and the best way to do so is by doing it yourself.

By the end of the year you will see why there is no logic in my popit (no, that's not a euphemism, tsk at you!) - everything gets build from scratch. If you are going to keep up with these blogs, it's quite important that the designs are seared into your memory.


7.2. What next?
In the next two blog posts, we will be looking at ways to reduce thermo in logic networks by analysing the interactions between multiple logic gates, rather than just reducing the thermo requirements at individual gate level. In the meantime, fool around with some wenches (that one might be a euphemism ).

Also, if this blog isn't long enough for you (oh teh lulz) and you are looking for some more reading materials, check out these other applications of winches in logic:



.

Updated 12-18-2009 at 10:46 AM by rtm223

Categories
Logic Blog

Comments

Page 1 of 2 1 2 LastLast
  1. comphermc's Avatar
    Excellent!

    I didn't really learn much that you haven't taught me already, but it's nice to have everything in one place, so when people ask a question, I can just stare back at the them and point in this direction.

    Two things:

    You have a typo in the heading of the flexible AND section. It says "OR" and your bold tags are open.

    Did you tell us your real name? Richard?

    Anyways, thanks for all of this. Next week... binary adder?

  2. rtm223's Avatar
    Ta, I gave up on proofreading and hoped someone would pick me up on little things like that

    Rumour has it I don't have a real name, just a serial number. Maybe it is my real name, maybe it isn't - it could just be a cunning ruse...

    I can't do the adder example yet, I have to run through a fair bit more theory before that will make sense. I'll probably be able to do it as a new year treat!
  3. comphermc's Avatar
    Oh boy! Can't wait...
  4. MrsSpookyBuz's Avatar
    Woah, nice one, Richard! Or can I call you Dickie?

    Well, that was 30 minutes well spent. As you may remember, I don't use wenches as much as you blokes like to do, but this has possibly tempted me into finding out why you like using and manipulating wenches so much.

    Cheers for that - good blog, my little Dickie!

    Updated 12-02-2009 at 07:05 PM by MrsSpookyBuz (**** is a name, not a rude word! :()
  5. Burnvictim42's Avatar
    loving the blog RTM, yay for switchery! On an unrelated note, i believe i am now suffering from "avatar envy"
  6. rtm223's Avatar
    Well, I have been called worse, so I'm sure I can deal with it! "Using and manipulating" sounds a little too sordid for my liking though, I must say.

    Wenches rock, although I think I've decided where to take the next post, and it may well be 100% winch free, if you can believe that!
  7. rtm223's Avatar
    Ahhhh crap I just realised there is an error in the relative strengths section. That equation is inaccurate - I meant to check it before posting this but then I forgot.

    I'll remove it now.

    @bv - I love this avatar, zwollie maded it for me 'cause I didn't have one. Sad thing is, that costume no longer exists
  8. Rogar's Avatar
    In section 2. The Set-Reset switch: "Similarly if you make set TRUE, the output becomes FALSE" - set should be reset, obviously.
  9. rtm223's Avatar
    Looks fine to me

    Thanks.
  10. ladylyn1's Avatar
    Nice bit of logic there! It's different to how i set up most of my logic but urs does look a lot more thermo friendly!

    Thanks, Richard.
  11. rtm223's Avatar
    Logic thermofficiency is going to be priority #1 to begin with and I've got enough tricks up my sleeve that hopefully there will be at least something for everyone in the next few weeks.

    I could also do with general critisisms beyond the proof reading (which is always helpful too of course) - it's been a good few years since I tried to run any tutorials like this...

    Thanks to everyone one reading and commenting on this.
  12. Hibbsi's Avatar
    Cool stuff. I may start replacing the ANDs in my calculator with these winch variations, and reduce the amount of moving objects by about 50 or so!
    One question, though. The material of the moving piece doesn't change anything other than the thermometer, right? I mean I assume that lighter materials are less likely to have problems when moving quickly, but other than that, is there any difference that you can tell?
    Also, I have a full-adder design you may be interested in, if you haven't already come up with the same design, that is. It's surprisingly simple.
    Updated 12-05-2009 at 02:36 AM by Hibbsi91
  13. rtm223's Avatar
    The connectors are atached directly to dark matter so even a moving strength of +/5 should happily shift metal etc. I tend to use polystyrene for the moving parts, but that is simply a personal thing.

    The adder serves far more purpose than being a low thermo adder. More a demo of simple optimisation techniques that can be applied to anything - compher's already made a lower thermo adder than mine But you can show me if I can ever connect to you!!
  14. Luos_83's Avatar
    I am doubting myself because I understood everything.
    Are my brains working? at 2 am?
    they.. understand.. logic..?
    wow..

    nontheless, I understand what you are saying and thank you for these switches.
  15. thefrozenpenquin's Avatar
    Ouch Ouch Ouch Ouch, I don't like messing up my grammer but, muh head asploded lol.
    Dude, awesome with a capital awe. Soon as I fire up LBP I am jumping all over this.
    A lot of your logic makes more sense now. Well, sorta.
  16. rtm223's Avatar
    Well, it's certainly a bonus that people are understanding this. Good to know it's not reaching the masses as the rantings and ravings of a crazyman
  17. thefrozenpenquin's Avatar
    So helpful, many thanks. I went back into all my levels on my moon and revised all my logic. Needless to say that I saved a lot of thermo.
    Can't wait for future installments.
  18. LittleBigDave's Avatar
    Very well presented, thanks!
  19. ShiftyDog's Avatar
    sounds complex, but fun to learn. and i understood well

    EDIT: IT EASY TO MAKE!!
    Updated 04-26-2010 at 08:21 PM by ShiftyDog
  20. I3EN's Avatar
    wow thanx great info my level has 10,000 plays all thanx to you great job
Page 1 of 2 1 2 LastLast