2. How Computers Works
Category
ЁЯУЪ
LearningTranscript
00:00For understanding how computers works, first of all, let us look at a block diagram.
00:05This is a very basic thing.
00:07Let us study it.
00:08See, this is a block diagram of a computer.
00:12Let us see the components first of all.
00:13See, this is the CPU.
00:15It is having two parts, ALU, that is, arithmetic and logical unit, and control unit, CU.
00:21I'll explain their working.
00:23The next is main memory, and this is the hard disk drive, which contains the data in the
00:28form of files, and this is input device, like keyboard, mouse, or stylus, tablet, anything.
00:37Then this is the output device, like your monitor or printer, and speakers.
00:43Now let us understand their working.
00:45See the heart of the computer is the CPU, that is, central processing unit, or microprocessor,
00:53or present day processor, if you see, that is, i3, i5, i7, these processors.
00:59Now this processor will have two parts, that is, arithmetic and logical unit, and control
01:05unit.
01:06So what is that?
01:07Arithmetic and logical unit can perform arithmetical and logical operations, basic operations.
01:13So a computer can perform basic operations, like arithmetic operations, like addition,
01:20subtraction, multiplication, or division, or modulus.
01:25Then under logical operations, it can compare two numbers, so it can compare less than,
01:30greater than, or equal to, and also it can perform logical operations AND, OR, these
01:38are the operations, like it is written in caps, so AND and OR, as well as NOT.
01:45So these are the logical operations, basically.
01:48So it can perform just these basic operations, right?
01:53Then second is CU, control unit.
01:56See there are other things connected like hard disk drive and the main memory input
02:00device and output device for controlling all these things.
02:03Controlling means utilizing them.
02:06So for that, it is having a separate portion that is called as control unit.
02:10So its job is to utilize other resources.
02:15This is about processor.
02:18Now next thing, let us start from here.
02:20This is hard disk.
02:21Hard disk will contain files and those files may be two types, either program files or
02:30data files.
02:32Like if you take an example, a notepad on your PC is a program file.
02:39When you open notepad, it is a program.
02:40So there is a file available.
02:42Basically we click on some icon and the program will start.
02:45But if you look into my computers and folders and somewhere you will find a program for
02:51notepad and its name, file name will be notepad.exe.
02:58If you search for it, you can find this file.
03:00This is a program file.
03:02Now inside notepad, if you type something and save, then it will be saving it as a text
03:08file.
03:09So you may be saving it as my.txt file, right?
03:13So this is a program file and this is a data file.
03:18This data file is used by notepad or generated by notepad.
03:22So finally, hard disk contains two type of files, program files and data files.
03:28If you have audio files or music files or video files, all those comes under data files.
03:36And if you have a music player or like VLC player or media player, those comes under
03:41program file.
03:42So we store our program kept inside hard disk and this is permanent storage.
03:47This will be larger in size.
03:50The next is suppose we want to run any program then that program should be present inside
03:56the main memory so that CPU can execute it.
04:00So the program is brought from the hard disk to the main memory.
04:07So this is a working memory or primary memory or workspace, right?
04:14So program should be brought here.
04:16Then CPU can execute the program by taking instructions line by line.
04:22So whatever the programs we run, they are brought here inside the main memory, right?
04:28Then if a program needs some data from keyboard or it has to display something on the monitor,
04:34then it can utilize this input devices or output devices.
04:38So the program may be taking something from keyboard or it may be taking something from
04:42internet or it may be reading something from the file.
04:45So if program needs some data, it may be getting it from here.
04:49Whatever the results generated by the program or interactivity provided by a program that
04:54you can find it on the output device like monitor or if any output.
04:58So it is printed on the printer.
05:01And these input and output devices are connected to the system and they have their own memory
05:06like I'll show it like this.
05:07This is the memory belongs to input device and this is the memory belongs to the output
05:12device.
05:13So this I will call it as input buffer.
05:16This is a buffer.
05:17This is the memory and similarly that is output buffer.
05:21This is output buffer.
05:24So if a program has to read something from the keyboard, so it will go to this memory
05:29area and get the data from there.
05:31And if it has to print something on the monitor, then whatever it has to print, it will put
05:35it in its memory area called as buffer, output buffer.
05:39It's not that program will directly go and print something on the monitor.
05:43It will dump everything inside the frame that is the frame buffer or output buffer and that
05:49will appear on the screen.
05:51Now same way whatever type is from the keyboard that will go and fall inside the buffer.
05:56It directly doesn't enter into the program.
05:58It will go and fall into the buffer and the program can read the contents from the buffer.
06:04So this is the communication point for the device and the program running inside the
06:08main memory.
06:11Now so that's it one of the important thing we have understood how they work all together.
06:16So once again I repeat quickly the programs are here they have to be brought into the
06:19main memory for execution and CPU will execute them by executing instructions line by line
06:25and if program requires to interact with the user it uses input and output devices.
06:31Now we will learn how that CPU works, how it understand, what does it mean by instruction,
06:38how it can understand instruction.
06:40So for this let us start from the basics.
06:43See computer works on a binary number system.
06:47What is binary system?
06:48Why it works on binary system?
06:50See it's an electronic device.
06:52So it works on current or voltages.
06:55So voltages are trickily or logically used as binary.
07:00How?
07:01A low level voltage, low voltage is taken as zero and high voltage is treated as one.
07:09So it is just like if suppose you have a bulb, this is a bulb.
07:15This bulb can be off or a bulb can be either on.
07:21If it is on then we treat it as one, if it is off we treat it as zero, that's all.
07:29Now if you have seen electronic circuitry like ICs I will draw it here.
07:35If you look at an electronic circuitry like this an IC right integrated circuit this is
07:41it is also called as a chip you can see the photograph also.
07:45Now here I have taken the same example.
07:48Now this is an integrated circuit it is having pins here.
07:50These are pins.
07:53This is electronic right.
07:55Now through these pins we can pass some voltages right some voltage.
08:00So in this one particular pin we can pass either low voltage or we can pass high voltage.
08:05Low voltage means zero and high voltage is one.
08:09Now this it may be taking in and storing it or it may be sending it out through this other
08:14pin the other end.
08:15So how it works and all we don't have to go in detail just we have to focus on binary
08:20form right.
08:21So this one pin can be either zero or one right.
08:26So only two possibilities are there.
08:28So that's how this is binary.
08:30So we say this is a binary number system and we call this as one bit we call it as one
08:36bit.
08:37So this is bit then if we count 1 2 3 4 5 6 7 8 8 bits are there.
08:44So this together 8 bits we call it as one byte.
08:49So 8 binary bits.
08:51Now all these bits are zeros means with a low voltage.
08:54So this is 0 0 0 0 this is 0 or all those 8 bits are 0 but only the last bit is 1.
09:03So this may be like this or some are zeros and some are ones right.
09:08So there can be many combinations.
09:10Now 8 bits together these are forming this pattern they can form various patterns.
09:18Now each pattern of bits we can take it as an instruction.
09:24Pattern of bits that is in binary form we can take it as an instruction.
09:28How it is treated as instruction I'll explain you.
09:31I'll remove this and explain you.
09:33See if there is one bulb then that bulb can be either on or off.
09:39Now if you look at traffic signals and if you consider only one bulb there usually will
09:43have three different lights.
09:44Let us assume there is only one bulb that bulb is for only two things.
09:49It can be used only for two things.
09:51If it is off means you should stop if it is on means you can go or other way if you say
09:57no no if it is on means you should stop off means you should whatever it is whatever you
10:02like you can set it.
10:04So we can set the rule and we can communicate with the people that this will be the code
10:08that will be followed now there will be only one bulb and if it is on means you can go
10:14if it is off means you should stop.
10:17Like this we can use this type of codes at many places like suppose a officer is there
10:23in his office so bulb is on he's there.
10:26If it is off means he is not there right or if a shop is there a bulb is on means shop
10:32is open if bulb is off means shop is closed.
10:35So like this this gives a message this gives a course so same thing electronic circuitry
10:41is having voltages 0 or 1 means on and off using these voltages we can make some communication.
10:49So one bulb can give you two messages right go or stop shop is open or closed like that.
10:56If you increase the bulbs so let us take two bulbs if you have two bulbs then what are
11:01the combinations possible with the two bulbs both the bulbs are off right or this bulb
11:08is on or this bulb is on or both are on.
11:12So it means this is giving four different messages four different messages two bulbs
11:18can give you together four different messages.
11:20So if you have to communicate four things with the people then you can have two bulbs
11:25and you can set them on and off and you should already educate the people and say that this
11:29means this this means this so and so.
11:31Like example in an examination if it's a multiple choice question paper now students want to
11:37copy them then if one of the person knows the answer he can communicate to others for
11:41that they already set the codes like if I scratch here it means option A if I do it
11:47like this rub my eyes then it is option B like that they can set the codes beforehand
11:53and they can understand it in the examination hall so same thing.
11:57Now similarly we can use two bulbs for giving more messages so if there are three bulbs
12:04then what if there are three bulbs but just I am scribbling so 0 0 0 total how many possibilities
12:11are there so this is 2 power 3.
12:14Eight possibilities are there right so it means what about four bulbs if you have four
12:20bulbs then this is 2 power 4 16 and what if we have eight bulbs so eight bulbs will
12:28be 2 power 8 that is 256 so we can have different 256 different commands 256 different messages
12:39messages so that's it so the computer system works on binary number system
12:44these bulbs are nothing but pins and if suppose there are eight pins like this an IC
12:51so it is just eight pins now each pin you assume that it's a bulb and that can be on and off
12:56total eight pins can have different commands like 256 different commands so messages or
13:02commands so in the same way this CPU is also built upon messages that are in the form of
13:10binary that is low voltage or high voltage that is on and off we'll see more on this one I'll
13:16remove this and discuss further so now we can say that the language of computers is binary they
13:22understand binary language that is in the form of zeros and ones that is low voltage or high voltage
13:26so all the instructions and the data everything should be in the form of binary so the language
13:32of the CPU is binary so how it perform arithmetic and logical operation it performs operation on
13:38binary number system right so now I can say that the language of machine or the computer is binary
13:45but we understand decimal number system we are not comfortable with binary number system
13:51we prefer working in the decimal number system so in comparison with the decimal number system how
13:56it is equal to binary form let us look at it a little bit see in decimal number system we have
14:01the digits from 0 1 2 3 so on to 9 we use these digits to form a number then in binary number
14:09system there are only two numbers that is zeros and ones so anything we want we want to understand
14:15in the form of decimal so in decimal form if it is 0 then it is binary also 0 if it is 1
14:20then it is also 1 then in decimal it is 2 and binary it is 1 0 and 3 is 1 1 4 is 1 0 0 5 is
14:311 0 1 and so on so this is the binary form of these decimal numbers now based on decimal number
14:39system we understand that this CPU or the arithmetic and logical unit perform operations
14:47so it knows the instructions it knows commands like 0 means add suppose like assume that
14:590 means add two numbers 1 means subtract two numbers 2 means multiply them like this they
15:08are forming instructions so there are some predefined instructions that are there inside
15:13that circuitry electronic circuitry and that is logically designed to work commands so the
15:18commands that we already know we have seen that it can perform arithmetic and logical operations
15:23those operations are given in the form of codes and it already knows that which command means
15:29what i have to do and we write the programs in the form of binary so the programs must be present
15:35inside the main memory in the form of binary so each line of program that is an instruction it
15:40will CPU will take an instruction and execute it because it already knows what it has to do for
15:45which code so like these becomes the codes as instructions for performing specific instruction
15:52so if you study some machine language or low level language of computer system you can understand
15:58that its instructions are in the form of binary right so that's all we end here the conclusion
16:05of this talk is how computer works computer works on binary number system right and why they work
16:11on binary system because they are based on electronic and in electronic signals are either
16:16zero or one that is low or high so that's how everything is built upon binary but we don't
16:22understand binary number system so to know how it is related to decimal number system
16:27we should understand some number systems in the next video we will discuss about number systems