Everybody what's going on.
This is Caleb with Dev slopes dot com and in this video we're going to be discussing how computers work.
Now if you've ever asked that question of somebody you know how does a computer work.
You may have heard you know one two three different things but I think most of all what you hear is
people will just say binary.
They'll just say it's binary runs on binary.
That's the only thing a computer can understand.
Well great but that doesn't actually tell us how computer works.
How does my input into the computer turn into binary.
And that's exactly what we're going to talk about in this video.
Now from the beginning we're going to just use a simple example of a keyboard pushing a key on a keyboard.
How does that key press.
How does that physical action from me the user translate into binary data that's then displayed on my
computer screen as whatever letter I pushed or whatever keystroke I pressed.
So for example we have our keyboard maybe it's plugged into our computer via US B.
Maybe it is Bluetooth or even in the past if you're on an old school machine you're using what's called
P.S. 2.
That's a type of connector for a keyboard and also a mouse.
But anyway we have our keyboard and what's going to happen is when we push a key on our keyboard that's
going to get sent into the computer through the USP port or over Bluetooth or two and it goes into the
motherboard of our computer and it runs into something called the BIOS.
OK.
Now BIOS that's an acronym and it stands for basic input output system.
All right.
Now just like it sounds it handles the input and output of data and information into the C.P. you which
is the central processing unit.
Now if you are around technology a lot you probably know these words you know BIOS CPQ GPU ram you probably
know all these words so I'm not going to overly explain them and if you want to look up these individual
components you are more than welcome to go google them look them up yourself.
But what you need to know CPQ is the central processing unit that's the brain of our computer that handles
processing and doing all the different calculations that it needs to do.
So what happens is my keystroke goes into my USP port and it meets the BIOS.
Now the BIOS acts like a bouncer outside of a club.
You know they're standing there in front of the door all cool probably with their sunglasses and people
who are on the list people who are good to go they get to go directly into the club.
But people who are not on the list either have to wait or they don't get into the computer.
Now that's what the BIOS does is it handles the input and output of information into the CPQ.
Now what it's going to do is it's going to go ahead and intercept all input like keyboard data mouse
data Wi-Fi even if you have a wife card Internet access anything that goes into the computer is going
to get handled through the BIOS.
It's like a gatekeeper.
Now what's going to happen is when I push a key on my keyboard the BIOS says yep you're good.
This is important.
So the BIOS allows that keystroke information to go through into the you and the CPP you is going to
then fetch instructions from memory card that are stored on the computer on how to use these devices
like the keyboard like the mouse.
And then what it's going to do is it's going to execute those instructions billions of times every second.
OK there are billions of calculations and operations that your Sipah is doing every single second now.
Immediate tasks like mouse clicks and keystrokes things like that get sent in right away they get handled
right away.
But other things that are not as urgent can be prioritized and rearrange.
That's the amazing utility of the BIOS in the C.P. working together.
Now each task on your computer has for lack of a better term a program stored in OK so your mouse there
is a set of code files that explain how the Sipa you should handle mouse input if a mouse input comes
in the BIOS sends it to this EPU then finds the mouse program and says OK I got this input from this
device.
What do I do with it.
And that is where we get our input that's how input is handled now of course this is a very simple overview
it's not an extremely scientific overview but we're going to go ahead and dive in a little deeper so
it's not only physical devices in our computer although sometimes it is like our keyboard our mouse
maybe our audio card our Internet or our Wi-Fi chip whatever it is each little device and task has a
program.
Even things like the clock or connecting to the Internet or managing user accounts everything has a
little program and has some code that tells it what it should do and how it should work.
Now these were originally written in human programming languages of course if you're dealing with a
computer like Mac OS Windows or Linux Those were all built by humans in human programming languages
but they tend to be quite large.
They tend to contain things that a computer doesn't always need.
Right but when they are compiled when they're actually built they get converted into what's called assembly
language and assembly language actually has to do with moving bits and pieces of information around
in different registers in your CPQ in a register is basically just a space that's going to hold some
information but a computer can't actually understand assembly language.
That's a kind of an intermediary between a computer language and a human understandable programming
language.
So after it gets converted into assembly language it gets converted into something called machine language
which basically is an intermediary between assembly and binary.
Then after it gets converted into machine language it gets converted down into binary binary is really
the only thing a computer can understand.
Now in our keyboard example when a key on the keyboard is pressed a signal is passed in from the keyboard.
The BIOS allows the input through like we said.
And then the request for the keyboard program is accepted and then it requests that that keyboard program
gets run.
Now how does the BIOS know what key was pressed.
OK.
On a traditional keyboard I can think of like in a mechanical clicky keyboard there is something called
the key matrix where basically there are long stretches of a wire essentially and each letter each key
on your keyboard has a contact point.
Now when the key is up it's not making contact but when it pushes the metal contacts then the electricity
of course that's coming in from the USP port.
Essentially what that's doing is it's going in and whenever there's a contact made that contact gets
sent to something called the keyboard's ROM.
OK.
And the ROM is basically a chip on the computer that stores a program.
It can't be written to but it can be read from.
So the ROM holds a program that essentially converts this key press maybe is key number 26 OK and when
the electricity comes through when we make that contact it's going to run all the way over to the RAM
or the RAM sorry and it's going to say OK key 26 that is an F..
Right.
That's pretty cool.
And then the ROM is going to send that information into the computer through the BIOS.
OK.
In binary it gets written down into binary and it gets sent directly into the CPQ.
Then of course the keyboard program gets brought up.
And it says OK this binary code for the letter F needs to produce an F on the screen so then the keyboard
program can pull up the screen program and display the key on the screen they work together it's very
very cool.
Now this is obviously a really simple example but you can see how various devices would work together
to do this whether it's a printer over USP whether it's a mouse over Bluetooth.
They all sort of work the same way.
Input goes into the BIOS.
The BIOS lets it into the C-p which polls open a particular program that particular program is run because
it knows how to handle the input from a certain device and then those programs can work together to
display information and make changes on your screen which is really cool.
Now back to binary.
Why use binary.
Wouldn't it be easier to just use a human understandable programming language.
No.
Like I said a computer can only understand binary.
But why is that.
That's a great question.
And when people say that our computer can only understand binary that's not helpful it doesn't tell
you why.
But I'm about to.
So what you need to know for now is that binary is simply ones and zeros.
You may have already known that but it's uses a system of numerical notation of base 2 instead of base
10 like our decimal number system based to has two values.
Like I said 1 and 0.
Now in the electronics world this is where it becomes very important for computers in the electronics
world.
There is a device a tiny tiny device called a transistor.
It changed the world as we knew it in 1947 at Bell Laboratories.
K that's the research arm for AT&T.
If you didn't know that.
Now basically a transistor has three pins sticking out of a little device.
And one pin is called the emitter one pin is called the base and one pin is called the collector K..
Now electricity can flow from the collector to the emitter but that's controlled by the base pin as
sort of like an electric switch.
If a small amount of current is placed on the base pen it allows a larger amount of current to flow
from collector to emitter which is very very cool.
Now of course in a computer if you think about that there's all these signals coming in and electricity
flowing in when it gets converted down to binary zero can represent off and one can represent on.
So if we want electricity to flow through a certain number of transistors we can apply a zero to the
base pin of one transistor so it's off.
We can apply one to the base pin of another transistor so it's on and then another one on and it will.
It allows for the current and electricity to flow from transistor to transistor.
And of course there are tons of different examples of ways to combine transistors in very complex ways.
But basically these transistors make up our CPQ.
So when the binary gets sent in we're turning off and turning on millions and millions of transistors
the average CPQ has more than one hundred million transistors inside of it.
Tiny little microscopic transistors which is fascinating because the original transistor was about this
big about two inches by two inches it was huge.
So the fact that we have microscopic transistors is incredible now because of the transistors simple
ON-OFF design.
It makes it perfect for working with binary because a one is on and a zero is off.
But why should we really care.
Well programming languages are human readable languages.
OK that eventually make their way down to binary in order to control certain behaviors and elements
of the devices that we use programming languages facilitate the turning on and turning off of hundreds
of millions of transistors billions of times every second.
It's amazing.
So this is kind of a brief overview here of how computers work information gets sent into the BIOS.
The BIOS allows information into the Sipa you which then request programs from memory to understand
how that binary data should be interacted with those programs of course turn on and off the transistors
in the you in just the right sequence to allow the information in to display information on the screen.
It's mind blowing mind numbing if you think about it too much so this is an overview of how computers
work.
It's absolutely fascinating.
So let's head over to the next video now where we're going to continue learning.
This is Caleb with Deb's slopes dot.com.