BG1, PRELOAD BG2, PRELOAD

feloneouscat

Wobbly Logic

Rating: 3 votes, 5.00 average.
Some folks have been intrigued by my last blog using pistons for logic, but would rather use wobble bolts.

At first I dismissed the thought - after all I've been using pistons since day one, why change my habits now? But like any good engineer, I can't help but dabble in things that I probably shouldn't.

We won't go into my failed attempts to revive a dead relative (didn't go quite... as planned) - but let's skip that little item and move on.

A Way of doing Wobble Logic

Let's start off with the basis of all logic, the lowly OR gate. I'm assuming that folks have gone through the basic logic levels - there are at last count, about a billion of them - so, I won't bore you with the details.

If you WANT details, then go to the logic levels - frankly they show you how simple digital logic really is.

Later in this series I will go into the more horrible... er... FINER aspects of logic design.

But First, the OR Gate

Let's take this example as our OR gate:



The "propeller in a circle" like objects are wobble bolts set for 90 degrees. They are on a blue circle (I like blue glass) and bolted to a block of my favorite, red glass.

Notice that there is a bubble on the bottom wobble bolt - that means that it turns backwards. This is important to get it going the right direction.

Both switches are set to "<-/->" and the output of the magnetic key switch is set to "<-/->" for later logic.

Now if we flip either one of the switches we get a corresponding output:



The above image has both switches turned on, but trust me, it works like your standard OR gate. Build it yourself if you want to see it work!

Logic of Equivalent Exchange... Redux

Remember in my previous blog where I said all you had to do was invert the input and output and you get an AND gate out of an OR gate?

Well, it turns out this logic still holds (I was on pins and needles there for a moment).

To create an AND gate we reverse the motors and invert the output.

This is sooooo, easy, even I can do it!



To get this to work correctly we have to do three things:

  1. Make the top motor move backwards
  2. Make the bottom motor move forwards (i.e. NOT backwards)
  3. Invert the output of the magnetic key switch


If you forget to change the motors you end up with what is called a NAND gate (also a very useful device). However, we won't go into its uses today.

Okay, So Why Should I Care?

As an engineer, and yes, if you are building levels in LBP you are now an engineer, it always pays to have some tricks in your back pocket. You may not need it today, Maybe not even next week, but at some point you will go "darn, how do I do this and that with something other than a piston?"

I Like It. But Aren't there Too Many Parts?

Yes. Looking at this we can easily simplify it and turn it into an AND gate using ONE magnetic key and ONE magnetic switch with the following:



Wicked! That's approaching the simplicity of a piston AND gate. And without the annoying breakage.

But can we turn this into an OR gate? Yes. Logic is logic and it doesn't discriminate between pistons, wobble bolts or emitters (yep, you've seen emitters as logic devices). In fact it would follow the same rules as before:

  1. Make the top motor backwards
  2. Make the bottom motor forwards (i.e. NOT backwards)
  3. Invert the output of the key switch


And it would look a lot like this:



Are our brains about to explode? If they do it would be really messy and my mop, well, I broke it. I do that sort of thing.

I Dare You to Make an XOR Gate

I have to admit that this had me stumped for a few minutes. Then I recalled how it was done with pistons and you know what? It turns out to be trivial. In fact, the parts count is exactly the same!



Note the the wobble bolts are set to turn at 180 degrees instead of 90 degrees. This design also takes good advantage of Media Molecules free update to the sensors.

All in all this is a nice, elegant design.

How about More Than Two Inputs?

Who am I? Your go-to guy? Okay, I'll go to this drawing:



As indicated previously, it takes very little other than inverting the magnetic switch and changing the direction of the wobble bolts to turn this homely OR gate into a wickedly rugged AND gate...

Do you Have A Level That I can Copy?

Yup. Just search for @feloneouscat and it is one of the levels with a Tiger's Head. It is named logic blog - yes, rather boring isn't it?

Hasn't this Been Covered in Logic Levels

Yes. However, I want to go more in depth.

My next article will go into more depth with something useful. If you have something that you would like to see, feel free to leave a note or PM me.

Not everyone is a logic wizard - they would like to be able to use something a little more complex than AND's and OR's, but for them it just doesn't work.

What I want to show folks is there are steps you can do that actually make this process easier.

Updated 05-02-2009 at 04:26 AM by feloneouscat (Added Multiple Input Or Gate)

Categories
Uncategorized

Comments

  1. feloneouscat's Avatar
    BTW, I still maintain that I am NOT a planner but an agent of chaos...
  2. feloneouscat's Avatar
    Added XOR. If folks read the earlier edition it was because I hadn't designed it yet.
  3. Vanemiera's Avatar
    I also found the wobble bolt approach some weeks ago in a level. The big question is whether it takes more or less thermo than the pistons.
  4. feloneouscat's Avatar
    In terms of thermo, it probably uses slightly more, but I haven't spent time to do tests. I'll get to that eventually

    My next installment (today) will focus on the creation of a clean, elegant, RS Latch with wobble bolts. THEN we will move on to "How to Make A Complex Device Resettable"... It should be really good.
  5. feloneouscat's Avatar
    Okay, did some thermo tests and I could get 1000 wobble bolts on a level before it overheated. I'll do some tests (hopefully before Mrs. Cat gets home) on max number of pistons.
  6. feloneouscat's Avatar
    My test with pistons managed to get 791 before it overheated. It appears that pistons actually use more thermo than wobble bolts.

    In some sense I can see why - pistons can have a lot of action (i.e. interact with other objects) but for the most part wobble bolts do not.

    Interesting.
  7. Fjonan's Avatar
    HA! Alright then, wobble bolts it is for me. Would you mind explaining very basic things like "AND" "OR "XOR" and "NAND"? I do not know all the words from the top of my hat and I guess so do other people.

    As a mini-logic test would a counter be cool, that resets after 9 zu 0 and starts again.
  8. feloneouscat's Avatar
    Okay, I'll backtrack.

    I had hoped that all the levels about logic had been enough, but I guess not.

    I'll post two blogs this week -- one about one-shots (different than Media Molecules - in a sense). And one on basic logic.

    That should get folks over the hump. THEN I will move on to doing something USEFUL.
    Updated 05-04-2009 at 01:11 PM by feloneouscat
  9. mindphaser74's Avatar
    You should write textbooks for a living. I finally understand all of it! But I`d still like to know practicle uses and examples for these switches. I know a few but would love to hear some other examples. Thanks alot.
  10. feloneouscat's Avatar
    Like any other type of tool, sometimes you have to learn the basics. As we progress in this series, we will build more and more complex projects. This will eventually lead up to the UBER-Tutorial which will be the most complex yet.

    But I'm overjoyed that you understand it! This great! And this WASN'T a trivial post to understand! Pat yourself on the back!
  11. Raiden's Avatar
    wait so i turn a switch to activate a wobble bolt but doesnt it go back and forth? How do i make it turn 90 degrees and freeze <== Noob
  12. feloneouscat's Avatar
    Directional is the key...
  13. gamenerd-815's Avatar
    Wow thank you now I can make more logic in my level now. To bad all of are logic is going to be wasted for the new logic in LittleBigPlanet 2 but Still good job on the work.