Tuesday, April 19, 2011

Bombs and Boolean Logic

So it has been FOREVER since my first post. Sorry bout that.

First, a quick recap about what has been going since that fateful day:
  • I moved out of my old place and in with my mother. Hey, rent there is cheap.
  • I ended one semester and am now nearing the end of another. 
  • Egypt is (hopefully) on it's way to a democracy!
  • Libya is in a state of civil war. The U.S. took leadership of a bombing campaign there, then handed it off to to NATO. We don't really know who the opposition is, but I guess our thought is, "hey, they can't be worse than Gaddafi!" 
    • Obama promised that he wouldn't send footsoldiers to help the Libyan opposition, but I'm hearing rumors otherwise...
  • Lots and lots of other stuff.

    Hey! Ever wonder how computers work? No? Oh.

    Well, I'm going to start explaining this randomly in my once-a-semester escapades. First let's start with Boolean logic, which is the foundation of all computing science. Basically, Boolean logic deals with situations in which you have exactly two possible outcomes. You can call these "hi and lo," "off and on," "1 and 0," "true and false" or "cheese and crackers." The idea is that these are the only two possibilities for inputs and outputs.

    So, there are some interesting things you can do when you have established that there are only two possible inputs or outputs. For instance, without knowing beforehand what the input is, you could make something that simply outputs the opposite of whatever it's input is. So, if someone input a "1," the gate would output a "0," and vice-versa. In Boolean logic, this is called a "NOT" gate. Get it? The output is NOT whatever it's input was. Here's what's called a "truth table" for NOT, which basically just shows all of the possible outputs for each possible input:

    There are actually quite a few of these primitive gates in Boolean logic. There's the AND gate, which has two inputs. It only outputs "1" when both of it's inputs are also "1."


    There is also the OR gate. The OR gate takes two inputs. As long as one of it's inputs are "1," it's output is a "1."



    There are quite a few other gates too, but they are all based off of these gates. For instance, there is the XOR gate. XOR is short for "Exclusive-OR," which basically means that the output is "1" if it's inputs are different from each other.


    There is also the NAND gate, which is just the NOT of an AND gate. That is, it's output is always "1" unless both of it's inputs are "1."


    These last two gates are important, because both XOR gates and NAND gates have real-world counterparts. In other words, you can make a NAND gate out of real materials. I believe that it has something to do with the placement of transistors or something like that, but don't hold me to it. The point is that these gates can be realized in real life, and that the NAND gate in particular can be realized at a pretty low cost. Another important property about these gates is that you can make every other logic gate with them. For example, By NANDing an input with itself, you will always produce the NOT of that input. Similarly, you can combine NAND gates to produce every other logic gate. This means that, using NAND gates, you can create every other basic logic gate. 

    The importance of this being that a computer scientist can create large, complex systems out of these logic gates, then hand off those designs to an electrical engineer, who can take those abstractions and create a real-world circuit that has the same exact properties. In this way, a computer scientist can design an entire computer processor without ever having to know the low-level physics behind how it works.

    Whenever I get around to writing my next post, I'm going to show a couple of different designs people use these logic circuits for, specifically the half-adder, full-adder, and a form of computer memory. Without going into detail now, you can use these Boolean logic circuits to add two numbers together, and, as pretty much all mathematics goes back to addition, this is pretty significant.

    If you actually read all that, chances are you would be interested in the book Fundamentals of Computing Systems, which is available on Amazon for pretty cheap. It guides you in designing an entire computer system, from the logic gates to the processor to a computer language to an entire Operating System. It's pretty neat!

    And now, a lion hunting a gazelle:


    Saturday, December 18, 2010

    ATTACK OF THE RANDOM!!!!!!

    How to introduce a blog:
    • Get right in there. Show 'em what you're all about.
    • Don't waste time and space making formal introductions. Your page should speak for itself.
    • Be Awesome.
    And now, a great scene from the F.W. Murnau silent, Sunrise: a Song of Two Humans:



    F.W. Murnau is amazing. With classics like Nosferatu and Faust, his expressionist-like form helped push film from a novelty into an artform. If you haven't watched much of him, a nice Murnau movie night is a grand idea.

    To go with German Expressionist stuff, another great silent to take a look at if you can is The Cabinet of Doctor Calagari. The set looks like a Tim Burton film, it's all about long lines, shadows, and eerie angles. I would show you a clip from YouTube but everybody thinks it's awesome to ruin silent films by adding modern music as the soundtrack. I disagree.

    Watching silent films really gets the creative juices flowing. On a related note, "creative juices" is not an appetizing combination of words.  In fact, I would go so far as to say that adding anything besides fruit before the word "juices" is just plain gross.

    Examples:
    • Man Juices
    • Shoe Juices
    • Hair Juices
    • Literally any noun before the word "juices"
    • Underwear Juices
    That's all for today folks! I leave you with this: