Binary
You might be wondering how are computers get these ones and zeros?
It's a pretty question. Imagine we have a light bulb and a switch that turns the state of the light on or off.
If we turn the light on, we can denote that state is one, if the light bulb is off, we can represent the state as zero.
Now imagine eight light bulbs and switches that represents eight bits with a state of zero or one.
Let's backtrack to the punch cards that were used in Jacquard's loom.
Remember that the loom use cards with holes in them.
When the loom would reach a hole, it would hook to thread underneath, meaning that the loom was on.
If there wasn't a hole, it would not hook the thread, so it was off.
This is a foundational binary concept. By utilizing the two states of on or off, Jacquard was able to weave
intricate patterns into fabric with his looms.
Then the industry started refining the punch-cards a little more.
Where there was a whole, the computer would read one, if there wasn't a hole, it would read zero.
Then by just translating the combination of zeros and ones, a computer could calculate any possible amount of numbers.
Binary in today's computer isn't done by reading holes.
It uses electricity via transistors allowing electrical signals to pass through.
If there's an electric voltage, we would denote it as one, if there isn't, we would denote it by zero.
But just having transistors isn't enough for our computer to be able to do complex tasks.
Imagine if you had two light switches opposite ends of a room, each controlling of light in the room.
What if when you went to turn on the light with one switch, the other switch wouldn't turn off?
That'll be a very poorly designed room.
Both switches should either turn the light on or off, depending on the state of the light.
Fortunately, we have something known as logic gates.
Logic gates allow our transistors to do more complex tasks like decide where to send electrical signals
depending on logical conditions.
There are lots of different types of logic gates, but we won't discuss them in detail here.
If you're curious about the role that transistors and logic gates play in modern circuitry, you can read more about it in the supplementary reading.
Now we know how our computer gets it's ones and zeros to calculate into meaningful instructions.
Later in this course, we're going to be able to talk about how we're able to turn human-readable instructions into zeros
and ones that our computer understands through compilers.
That's one of the very basic building blocks of programming that's led to the creation of our favorite social media sites, video games, and just about everything else.
No Comments