1
00:00:06,100 --> 00:00:07,240
Everybody what's going on.

2
00:00:07,240 --> 00:00:14,260
This is Caleb with Dev slopes dot com and in this video we're going to be discussing how computers work.

3
00:00:14,290 --> 00:00:18,550
Now if you've ever asked that question of somebody you know how does a computer work.

4
00:00:18,550 --> 00:00:24,310
You may have heard you know one two three different things but I think most of all what you hear is

5
00:00:24,310 --> 00:00:26,770
people will just say binary.

6
00:00:26,770 --> 00:00:28,650
They'll just say it's binary runs on binary.

7
00:00:28,660 --> 00:00:30,610
That's the only thing a computer can understand.

8
00:00:30,790 --> 00:00:34,780
Well great but that doesn't actually tell us how computer works.

9
00:00:34,780 --> 00:00:38,890
How does my input into the computer turn into binary.

10
00:00:38,980 --> 00:00:42,010
And that's exactly what we're going to talk about in this video.

11
00:00:42,010 --> 00:00:48,000
Now from the beginning we're going to just use a simple example of a keyboard pushing a key on a keyboard.

12
00:00:48,070 --> 00:00:49,630
How does that key press.

13
00:00:49,630 --> 00:00:56,170
How does that physical action from me the user translate into binary data that's then displayed on my

14
00:00:56,170 --> 00:01:01,030
computer screen as whatever letter I pushed or whatever keystroke I pressed.

15
00:01:01,210 --> 00:01:07,170
So for example we have our keyboard maybe it's plugged into our computer via US B.

16
00:01:07,330 --> 00:01:12,240
Maybe it is Bluetooth or even in the past if you're on an old school machine you're using what's called

17
00:01:12,280 --> 00:01:12,990
P.S. 2.

18
00:01:13,000 --> 00:01:16,650
That's a type of connector for a keyboard and also a mouse.

19
00:01:16,690 --> 00:01:23,260
But anyway we have our keyboard and what's going to happen is when we push a key on our keyboard that's

20
00:01:23,260 --> 00:01:30,190
going to get sent into the computer through the USP port or over Bluetooth or two and it goes into the

21
00:01:30,190 --> 00:01:34,840
motherboard of our computer and it runs into something called the BIOS.

22
00:01:34,840 --> 00:01:35,310
OK.

23
00:01:35,470 --> 00:01:42,090
Now BIOS that's an acronym and it stands for basic input output system.

24
00:01:42,100 --> 00:01:42,880
All right.

25
00:01:42,880 --> 00:01:49,840
Now just like it sounds it handles the input and output of data and information into the C.P. you which

26
00:01:49,840 --> 00:01:52,410
is the central processing unit.

27
00:01:52,420 --> 00:02:01,570
Now if you are around technology a lot you probably know these words you know BIOS CPQ GPU ram you probably

28
00:02:01,570 --> 00:02:06,160
know all these words so I'm not going to overly explain them and if you want to look up these individual

29
00:02:06,160 --> 00:02:11,100
components you are more than welcome to go google them look them up yourself.

30
00:02:11,290 --> 00:02:17,290
But what you need to know CPQ is the central processing unit that's the brain of our computer that handles

31
00:02:17,950 --> 00:02:21,370
processing and doing all the different calculations that it needs to do.

32
00:02:21,370 --> 00:02:28,150
So what happens is my keystroke goes into my USP port and it meets the BIOS.

33
00:02:28,150 --> 00:02:31,720
Now the BIOS acts like a bouncer outside of a club.

34
00:02:31,810 --> 00:02:36,940
You know they're standing there in front of the door all cool probably with their sunglasses and people

35
00:02:36,940 --> 00:02:41,520
who are on the list people who are good to go they get to go directly into the club.

36
00:02:41,890 --> 00:02:47,290
But people who are not on the list either have to wait or they don't get into the computer.

37
00:02:47,290 --> 00:02:53,910
Now that's what the BIOS does is it handles the input and output of information into the CPQ.

38
00:02:54,190 --> 00:03:01,660
Now what it's going to do is it's going to go ahead and intercept all input like keyboard data mouse

39
00:03:01,660 --> 00:03:08,050
data Wi-Fi even if you have a wife card Internet access anything that goes into the computer is going

40
00:03:08,050 --> 00:03:09,710
to get handled through the BIOS.

41
00:03:09,710 --> 00:03:11,230
It's like a gatekeeper.

42
00:03:11,320 --> 00:03:16,900
Now what's going to happen is when I push a key on my keyboard the BIOS says yep you're good.

43
00:03:16,900 --> 00:03:18,070
This is important.

44
00:03:18,070 --> 00:03:25,120
So the BIOS allows that keystroke information to go through into the you and the CPP you is going to

45
00:03:25,120 --> 00:03:31,120
then fetch instructions from memory card that are stored on the computer on how to use these devices

46
00:03:31,120 --> 00:03:32,880
like the keyboard like the mouse.

47
00:03:33,010 --> 00:03:39,280
And then what it's going to do is it's going to execute those instructions billions of times every second.

48
00:03:39,440 --> 00:03:45,880
OK there are billions of calculations and operations that your Sipah is doing every single second now.

49
00:03:45,880 --> 00:03:52,210
Immediate tasks like mouse clicks and keystrokes things like that get sent in right away they get handled

50
00:03:52,210 --> 00:03:53,050
right away.

51
00:03:53,050 --> 00:03:57,640
But other things that are not as urgent can be prioritized and rearrange.

52
00:03:57,640 --> 00:04:02,620
That's the amazing utility of the BIOS in the C.P. working together.

53
00:04:02,720 --> 00:04:11,320
Now each task on your computer has for lack of a better term a program stored in OK so your mouse there

54
00:04:11,320 --> 00:04:19,960
is a set of code files that explain how the Sipa you should handle mouse input if a mouse input comes

55
00:04:19,960 --> 00:04:26,830
in the BIOS sends it to this EPU then finds the mouse program and says OK I got this input from this

56
00:04:26,830 --> 00:04:27,490
device.

57
00:04:27,520 --> 00:04:28,610
What do I do with it.

58
00:04:28,810 --> 00:04:35,800
And that is where we get our input that's how input is handled now of course this is a very simple overview

59
00:04:35,800 --> 00:04:40,840
it's not an extremely scientific overview but we're going to go ahead and dive in a little deeper so

60
00:04:40,990 --> 00:04:46,810
it's not only physical devices in our computer although sometimes it is like our keyboard our mouse

61
00:04:47,230 --> 00:04:55,180
maybe our audio card our Internet or our Wi-Fi chip whatever it is each little device and task has a

62
00:04:55,180 --> 00:04:55,960
program.

63
00:04:56,110 --> 00:05:02,560
Even things like the clock or connecting to the Internet or managing user accounts everything has a

64
00:05:02,560 --> 00:05:06,800
little program and has some code that tells it what it should do and how it should work.

65
00:05:06,800 --> 00:05:11,670
Now these were originally written in human programming languages of course if you're dealing with a

66
00:05:11,670 --> 00:05:17,460
computer like Mac OS Windows or Linux Those were all built by humans in human programming languages

67
00:05:18,120 --> 00:05:20,210
but they tend to be quite large.

68
00:05:20,210 --> 00:05:23,810
They tend to contain things that a computer doesn't always need.

69
00:05:23,820 --> 00:05:29,910
Right but when they are compiled when they're actually built they get converted into what's called assembly

70
00:05:29,910 --> 00:05:36,540
language and assembly language actually has to do with moving bits and pieces of information around

71
00:05:36,600 --> 00:05:41,580
in different registers in your CPQ in a register is basically just a space that's going to hold some

72
00:05:41,580 --> 00:05:46,650
information but a computer can't actually understand assembly language.

73
00:05:46,650 --> 00:05:53,370
That's a kind of an intermediary between a computer language and a human understandable programming

74
00:05:53,370 --> 00:05:54,160
language.

75
00:05:54,450 --> 00:05:59,790
So after it gets converted into assembly language it gets converted into something called machine language

76
00:06:00,300 --> 00:06:05,730
which basically is an intermediary between assembly and binary.

77
00:06:05,730 --> 00:06:12,810
Then after it gets converted into machine language it gets converted down into binary binary is really

78
00:06:12,810 --> 00:06:15,780
the only thing a computer can understand.

79
00:06:15,780 --> 00:06:22,590
Now in our keyboard example when a key on the keyboard is pressed a signal is passed in from the keyboard.

80
00:06:22,620 --> 00:06:25,610
The BIOS allows the input through like we said.

81
00:06:26,370 --> 00:06:32,820
And then the request for the keyboard program is accepted and then it requests that that keyboard program

82
00:06:32,820 --> 00:06:33,840
gets run.

83
00:06:33,840 --> 00:06:37,810
Now how does the BIOS know what key was pressed.

84
00:06:38,090 --> 00:06:38,670
OK.

85
00:06:38,790 --> 00:06:43,920
On a traditional keyboard I can think of like in a mechanical clicky keyboard there is something called

86
00:06:44,100 --> 00:06:52,080
the key matrix where basically there are long stretches of a wire essentially and each letter each key

87
00:06:52,080 --> 00:06:54,480
on your keyboard has a contact point.

88
00:06:54,480 --> 00:07:02,100
Now when the key is up it's not making contact but when it pushes the metal contacts then the electricity

89
00:07:02,100 --> 00:07:05,200
of course that's coming in from the USP port.

90
00:07:05,220 --> 00:07:10,710
Essentially what that's doing is it's going in and whenever there's a contact made that contact gets

91
00:07:10,710 --> 00:07:13,420
sent to something called the keyboard's ROM.

92
00:07:13,420 --> 00:07:13,900
OK.

93
00:07:14,220 --> 00:07:18,270
And the ROM is basically a chip on the computer that stores a program.

94
00:07:18,300 --> 00:07:20,780
It can't be written to but it can be read from.

95
00:07:20,970 --> 00:07:29,460
So the ROM holds a program that essentially converts this key press maybe is key number 26 OK and when

96
00:07:29,460 --> 00:07:33,960
the electricity comes through when we make that contact it's going to run all the way over to the RAM

97
00:07:34,260 --> 00:07:38,600
or the RAM sorry and it's going to say OK key 26 that is an F..

98
00:07:38,730 --> 00:07:39,450
Right.

99
00:07:39,450 --> 00:07:40,400
That's pretty cool.

100
00:07:40,530 --> 00:07:45,150
And then the ROM is going to send that information into the computer through the BIOS.

101
00:07:45,150 --> 00:07:45,880
OK.

102
00:07:46,290 --> 00:07:50,020
In binary it gets written down into binary and it gets sent directly into the CPQ.

103
00:07:50,490 --> 00:07:53,730
Then of course the keyboard program gets brought up.

104
00:07:53,760 --> 00:08:00,450
And it says OK this binary code for the letter F needs to produce an F on the screen so then the keyboard

105
00:08:00,450 --> 00:08:06,810
program can pull up the screen program and display the key on the screen they work together it's very

106
00:08:06,810 --> 00:08:07,930
very cool.

107
00:08:07,940 --> 00:08:14,130
Now this is obviously a really simple example but you can see how various devices would work together

108
00:08:14,130 --> 00:08:19,140
to do this whether it's a printer over USP whether it's a mouse over Bluetooth.

109
00:08:19,290 --> 00:08:21,990
They all sort of work the same way.

110
00:08:21,990 --> 00:08:23,850
Input goes into the BIOS.

111
00:08:23,880 --> 00:08:30,150
The BIOS lets it into the C-p which polls open a particular program that particular program is run because

112
00:08:30,150 --> 00:08:35,550
it knows how to handle the input from a certain device and then those programs can work together to

113
00:08:35,550 --> 00:08:40,180
display information and make changes on your screen which is really cool.

114
00:08:40,180 --> 00:08:42,430
Now back to binary.

115
00:08:42,900 --> 00:08:43,860
Why use binary.

116
00:08:43,860 --> 00:08:48,380
Wouldn't it be easier to just use a human understandable programming language.

117
00:08:48,450 --> 00:08:48,900
No.

118
00:08:48,900 --> 00:08:52,970
Like I said a computer can only understand binary.

119
00:08:53,220 --> 00:08:54,110
But why is that.

120
00:08:54,120 --> 00:08:55,350
That's a great question.

121
00:08:55,380 --> 00:08:59,970
And when people say that our computer can only understand binary that's not helpful it doesn't tell

122
00:08:59,970 --> 00:09:00,830
you why.

123
00:09:00,950 --> 00:09:01,940
But I'm about to.

124
00:09:02,040 --> 00:09:08,200
So what you need to know for now is that binary is simply ones and zeros.

125
00:09:08,310 --> 00:09:15,900
You may have already known that but it's uses a system of numerical notation of base 2 instead of base

126
00:09:15,930 --> 00:09:19,860
10 like our decimal number system based to has two values.

127
00:09:19,860 --> 00:09:22,320
Like I said 1 and 0.

128
00:09:22,650 --> 00:09:28,410
Now in the electronics world this is where it becomes very important for computers in the electronics

129
00:09:28,410 --> 00:09:29,100
world.

130
00:09:29,100 --> 00:09:33,640
There is a device a tiny tiny device called a transistor.

131
00:09:33,660 --> 00:09:38,510
It changed the world as we knew it in 1947 at Bell Laboratories.

132
00:09:38,510 --> 00:09:41,830
K that's the research arm for AT&amp;T.

133
00:09:41,910 --> 00:09:42,990
If you didn't know that.

134
00:09:42,990 --> 00:09:48,190
Now basically a transistor has three pins sticking out of a little device.

135
00:09:48,510 --> 00:09:55,980
And one pin is called the emitter one pin is called the base and one pin is called the collector K..

136
00:09:56,070 --> 00:10:02,280
Now electricity can flow from the collector to the emitter but that's controlled by the base pin as

137
00:10:02,280 --> 00:10:04,220
sort of like an electric switch.

138
00:10:04,540 --> 00:10:10,510
If a small amount of current is placed on the base pen it allows a larger amount of current to flow

139
00:10:10,510 --> 00:10:14,080
from collector to emitter which is very very cool.

140
00:10:14,080 --> 00:10:18,640
Now of course in a computer if you think about that there's all these signals coming in and electricity

141
00:10:18,640 --> 00:10:26,940
flowing in when it gets converted down to binary zero can represent off and one can represent on.

142
00:10:26,950 --> 00:10:33,580
So if we want electricity to flow through a certain number of transistors we can apply a zero to the

143
00:10:33,580 --> 00:10:35,840
base pin of one transistor so it's off.

144
00:10:35,950 --> 00:10:41,430
We can apply one to the base pin of another transistor so it's on and then another one on and it will.

145
00:10:41,470 --> 00:10:46,720
It allows for the current and electricity to flow from transistor to transistor.

146
00:10:47,020 --> 00:10:53,350
And of course there are tons of different examples of ways to combine transistors in very complex ways.

147
00:10:53,350 --> 00:10:57,400
But basically these transistors make up our CPQ.

148
00:10:57,490 --> 00:11:03,730
So when the binary gets sent in we're turning off and turning on millions and millions of transistors

149
00:11:04,210 --> 00:11:08,940
the average CPQ has more than one hundred million transistors inside of it.

150
00:11:08,950 --> 00:11:14,560
Tiny little microscopic transistors which is fascinating because the original transistor was about this

151
00:11:14,560 --> 00:11:17,940
big about two inches by two inches it was huge.

152
00:11:17,950 --> 00:11:24,880
So the fact that we have microscopic transistors is incredible now because of the transistors simple

153
00:11:24,910 --> 00:11:26,120
ON-OFF design.

154
00:11:26,200 --> 00:11:31,660
It makes it perfect for working with binary because a one is on and a zero is off.

155
00:11:31,660 --> 00:11:33,600
But why should we really care.

156
00:11:33,910 --> 00:11:37,780
Well programming languages are human readable languages.

157
00:11:37,900 --> 00:11:43,900
OK that eventually make their way down to binary in order to control certain behaviors and elements

158
00:11:44,170 --> 00:11:50,560
of the devices that we use programming languages facilitate the turning on and turning off of hundreds

159
00:11:50,560 --> 00:11:55,460
of millions of transistors billions of times every second.

160
00:11:55,480 --> 00:11:56,270
It's amazing.

161
00:11:56,270 --> 00:12:02,970
So this is kind of a brief overview here of how computers work information gets sent into the BIOS.

162
00:12:02,980 --> 00:12:09,070
The BIOS allows information into the Sipa you which then request programs from memory to understand

163
00:12:09,280 --> 00:12:15,490
how that binary data should be interacted with those programs of course turn on and off the transistors

164
00:12:15,490 --> 00:12:21,650
in the you in just the right sequence to allow the information in to display information on the screen.

165
00:12:21,670 --> 00:12:27,640
It's mind blowing mind numbing if you think about it too much so this is an overview of how computers

166
00:12:27,640 --> 00:12:28,010
work.

167
00:12:28,000 --> 00:12:29,430
It's absolutely fascinating.

168
00:12:29,430 --> 00:12:32,550
So let's head over to the next video now where we're going to continue learning.

169
00:12:32,560 --> 00:12:34,570
This is Caleb with Deb's slopes dot.com.
