Wednesday, September 4, 2013

Computers.

Dear, Mind Readers

Computers are awesome.
We use them all the time because of this. As we thought about earlier computers think in 1 space AKA the first dimension. Now in this world of numbers as you most likely already know there are two that stand out. These two numbers are what computers use to understand the rest of them, as well as what to display on the screen and so forth. These to values are inseparable, they are a pair. With out one the other could not do anything, and so, we find our self's staring again at the numbers 0 and 1. Ah, the wonderful numbers of Boole.
0 and 1, true and false, on or off. On and off are actually the most realistic ways to view the two values because they are what's really happening.

When you brake computers down to the core you get to binary code, but when you brake it down to a science you get to logic gates. These gates are off plenty, and of power. These so called "gates" are actually physically transistors, but here's the thing. They are created of two kinds of materiel known as P and S. Now as much as I want to go into detail about the actual science of the two materiel and the electricity flowing through them I will just say this. There are 3 wires entering into the logic gate:
         lets just call this a:              POD
                                        -------------------
                                    |    s    |   p   |   s      |
                  wire 2 >  ---  |         |        |          | ---- < and wire 3
                                        --------------------
                                      wire 1 >   |

Now these logic gates are only logical because of this: Electricity can only pass through if there is energy coming from wire 1 and 2 going through 3. Now the logic used with this is called Boolean logic. Which is: it's either this or this. (1 or 0, on or off, true or false etc...) Energy will always be passing through wire 2 but the question remains is the wire 1 impulsing energy or not? If so then it is 1, on, true, if not the it is false, off, 0. You get it? Now using this science logic gates are created:
Now these are the just the symbols but what's actually going on is something else.

The AND gate is two pods:


So here's the thing.
In order for the circuit ti work, both A AND B must have electricity running through P (blue) to connect the in coming wire(red) to the out going wire(yellow).
So the energy travels through into A and what do you know A is on. Since A is on (1, true etc...) Now we can keep going on to B if B is on then that would mean that both A AND B are on, and the circuit works, but if B is off then it does not work.

The OR gate has A and B not connected so if A is on then it works, if B is on then it works, and if both are on then it works. The only way for it to not work is if neither A OR B are on. Get it?

The NOT gate just reverses it. If A is on then it turns A                                                                                 off.

The rest of the gates which you can see above are just made up of AND, OR, and NOT gates.
This Boole logic is used to make decisions. However there is a problem, all of the numbers in existence so far are just 1s and 0s. So what do we do with that?
Well that's where binary code comes in. Because we only have on and off we need to turn numbers on and off.
 So:

 Binary is a graph of numbers.
As you can see to the left 0001 = 1
this is because you turned the 1 box on.
Then you found out that 0010 = 2 because you turned on the 2 box, but now we get to 3. Well there is no 3 box so what do you do? You add. 1 box + 2 box = 3. That's why the numbers are 1,2,4,8,16,32 etc... They double because when every box is filled in with a 1 the next number is the last number doubled.
For instance: one you fill up box 1 and 2 and you have 3 how do you get to 4? make another box and fill that one only to get that number. Notice that 4 is 2 doubled, and 8 is 4 doubled, etc...


So if you understand that you should understand this:

You got it? Good. 
So far we went from science to number code. Things seem to jump each step we go.
So then what's next? Coding!
This is a code that you can understand. It uses values and variables to construct things on the screen. You see it would be too hard to do every thing with logic gates, so they made binary, but you can't just make everything on the screen with binary it's still to hard. So using binary using logic gates together they made what's called a computer language. There are many today including objective C, C#, C, C++, Java, Java script, HTML, Python etc... The thing is though, they all have the basic principles and operations that can't be over written. Every language uses the fallowing: If, Then, Else, Do, While, For, When, Repeat, Switch, Continue, Brake, Return, Exit and With. 
For instance: 
If  <expression>
Then <statement>
Else <statement>

You can also mix things up:
If <expression>
Then <statement>
Else If <expression> Then  Repeat Do <statement> While <statement> Return true

I personally love coding, Binary code, and logic gates.
What do you like?
Well, thanks for reading my thoughts!
Catch ya next time!

No comments:

Post a Comment