Transcript for:
Introduction to Computer and Programming Notes

Hello everyone, I am Ritesh Sohan working as an assistant professor in computer engineering department at Mahatma Gandhi Institute of Technical Education and Research Center, Nausari. So I am taking the subject programming for problem solving subject code 3110003. So total there are 10 unit in this subject and the best reference book for programming for problem solving is this first one. Programming in ANSYS C by Bala Gurusamy which covers all the units that is 1 to 10 in single book. So let's proceed with the unit number 1 that is Introduction to Computer and Programming. So the topic which are covered in this video are Introduction to Computer and Programming Language. then basic block diagram and functions of various components of computer then concept of hardware and software we also see here the difference between hardware and software then types of software and at last compiler and interpreter so what is computer a computer is a machine that accepts the data as input processes that data using programs and outputs the process data as a information. Many computer can store and retrieve the information using hard drives. Computer can be connected together to form a networks which allows the connected computer to communicate with each other. So a computer is a machine or device that performs processes calculations and operations based on instructions provided by a software or hardware It has the ability to accept the data, process it and then produces the output. Computer can also stores the data for later uses in appropriate storage device and retrieve whenever it is necessary. So the modern computers are electronic device used for a variety of purpose ranging from browsing the web, writing documents, editing videos, creating applications, playing video games etc. They are designed to execute applications and provide a variety of solutions by combining integrated hardware and software component. What is programming language? A programming language is a formal language comprising a set of instructions that produce a various kinds of output. Programming languages are used in computer programming to implement algorithms, Most programming languages consist of instructions for the computer. So the programming languages are the tools we use to write instructions for computer to follow. Computer thinks in binaries, strings of 1s and 0s. Computer language allows us to translate the 1s and 0s into something that human can understand and write. A programming language is made up of a series of symbols. that serves as a bridge that allows the human to translate our thoughts into instructions computer that which computers can understand so the man who invented the computer charles babbage was an english polymath philosopher inventor and mechanical engineer so in recognition of high error rate in the calculation of mathematical tables Babbage wanted to find a method by which they could be calculated mechanically by removing the human source of error. This is what he thought and invent a mechanical computer. So now we proceed with the first topic of unit number 1 that is basic block diagram of computer. This is very most important for your GTO examinations. So the computer is made up of mainly four components. First one is CPU that is Central Processing Unit which consists of ALU that is Arithmetic Logic Unit, CU that is Control Unit and the Primary Memory. The second component is Input Section from where we fed the input to the third one is output section where the information comes from the computer and the fourth one is secondary memory which is often called storage devices like hard disk pen drive etc let's see each of the component one by one so first we see the component central processing unit which consists of alu cu and primary memory So first we see the first component of computer that is central processing unit which consists of ALU, CU and primary memory. So central processing unit is a main part of the computer system. It contains electronic circuitry that processes the data based on instructions. It also controls the flow of data in the system. It is also known as brain of the computer. so cpu consists of first one is ALU that is arithmetic logic unit so it performs all arithmetic calculations and takes logical decisions it can perform addition subtraction multiplication comparison count shift and other logical activities it calculate very fast it takes data from the memory unit returns data to memory unit generally from primary memory so the addition subtraction multiplication All these operations are performed by ALU that is Arithmetic Logic Unit Second one is Control Unit It controls all other units in the computer systems It manages all the operations It reads the instructions and data from the memory Third one is Primary Memory It is also known as Main Memory The processor of CPU directly stores and retrieve the information from it. So generally, currently executing programs and data are stored in primary memory. Its storage capacity is very small compared to secondary storage, but it is very fast in operation compared to secondary storage. So you can say RAM is an primary memory source of primary memory also rom p rom and ep room so ram is known as random access memory and it is volatile in nature so why we say that ram is a volatile in nature volatile memory is used to store computer program and data that cpu needs in real time and is erased once computer is switched off so ram and cache memory are volatile memory okay so while we switch off our computer then all the data are lost but in secondary memory if we switch off the computer then also the data will remain as it is in the secondary memory but not in primary memory that is in ram okay if the power is switched off if the computer is switched off then all the data in the ram will be erased so that is known as volatile So RAM is a volatile memory. ROM is known as read only memory and it can be hold data permanently. While it will be switch off or switch on, the data will remain permanently in ROM. Next PROM. PROM is programmable read only memory and it can be hold data permanently. Programmer can store information only once. In PROM modification is not done. okay it is not allowed in PROM that is programmable read only memory next one is ePROM that is erasable programmable read only memory it can hold data permanently it also this ePROM is also hold the data permanently but programmer can delete and write on it again and again so in PROM data will the memory holds the data permanently but modification is not allowed but in ep room that is erasable programmable read only memory the data can be hold permanently but programmer can delete and write on it again and again okay so this all are this all are the source of primary memory so the next component of computer is input so the device used to enter the data into the computer system are called input devices it converts human understandable input to computer controllable data cpu accepts the information from the user through input devices for example from mouse keyboard touchscreen joystick even we can say mic is also an input device scanner is also an input device so with the help of mouse keyboard touchscreen joystick etc we can enter the data into the computer system so these all are known as in input devices this all are comes under the input section next one is output section so the device is used to send the information to outside the world from the computer is called output devices it converts data stored in one zero one and zeros in computer to human understandable information so computer only understands uh one and zeros in the form of the data in the form of one and zeros okay so it converts the data which are stored in one and zeros in computer to human understandable information through the output devices which are the output devices monitor printer plotter speakers this all are the output devices with the help of this the computer sends the information outside the world so the last component of computer is secondary memory okay it is also known as storage devices so the secondary memory is also called auxiliary memory or external memory user can store the data permanently so we can say the secondary memory is a non-volatile memory ram is a volatile memory if our computer was switched off the data was erased from the ram but in secondary memory which is also known as auxiliary memory if our computer switch offs then also the data will remains as it is in that memory okay so the secondary memory is known as non-volatile memory so it can be modified easily it can store large data compared to primary memory nowadays it is available in the terabyte also okay so the examples of second uh secondary memory is hard disk floppy disk cd dvd pen drives etc. So next is the advantages and limitations of the computer. First we see the advantages of the computer. So the first one is speed. So the computer can calculate millions of expressions within a fraction of seconds. The microseconds and nanoseconds units are used to measure the speed of the computers. So computer works with very higher speed and accuracy compared to human while performing a mathematical calculations computer can process millions of instructions per second the time taken by the computer for their operation is microseconds and nanoseconds so the computer have the ability to perform routine tasks at greater speed than human beings second advantages of computer is storage so it can store data in a large quantity using various storage devices like secondary storage or primary storage millions of papers paper files data can be stored in a single small pen drive which is our secondary storage moreover it reproduces the data whenever we need and whatever forward format we have and we need at that time nowadays gigabytes and terabytes are the units of the data storage devices so the computer can store large amount of information any data or instructions stored in the in the memory can be retrieved by the computer at greater speed so the next advantage is accuracy so computer performs the computation at very high speed without any mistakes for example multiplication of very large numbers takes more time for human and there are highly probable probabilities of mistakes but the computer does it in a part of seconds with accuracy level we want very high level of accuracy is most in financial transactions medical surgeries nuclear plants etc which can be satisfied by the computer only so the computer performs all jobs with 100 accuracy provided that correct input and instructions given by the user errors in the machinery can occur but the same is due to human which can gives wrong input or wrong instructions so error may be occur when human gives the wrong input or the wrong instructions otherwise computer gives 100 accuracy in this in any application next one it is very reliable device the information stored in the computer is available after years in same form it works 24 hours without any problem as it does not feel tiredness so human can feel tiredness it cannot work 24 into 7 but the computer will the next advantages is automation once The one task is created in a computer, it can be repeatedly performed again by single click whenever we want. For example, once the software of banking application is installed in a computer, it computes the instruction by sending only one command. Similarly, if you install the browser on your computer, so in a single click you can connect with the world wide web if you have the internet. So it is all about the advantages of the computer. Next we see the limitations of the computer. So there are some limitations of the computer. First one is lack of intelligence. So it cannot think while doing the work. It does not have natural intelligence. Computer cannot think about properness or effect of work it is doing. It can only execute the instruction. but it cannot think about the correctness of this those instructions so computer does not have intelligence for its own to complete the task they give wrong output if the input given by the human are wrong it works according to the instruction given to its given to it by the user the next limitation is unable to correct the mistake so it cannot correct the mistake by itself so if we have provided wrong or incorrect data then it produce wrong result or perform wrong calculations so the computer cannot correct the mistake done by the human if we if we get the wrong output if we give the wrong input so computer cannot take any decision of its own it does only it does only those tasks which are already instructed to do So the next topic is concept of hardware and software. So first we see what is software. So a set of instruction to perform a meaningful task is called a program and a set of program is called a software. So basically there are two types of software. First one is system software and second one is application software. Let's see one by one. so the system software is a is designed to operate the computer hardware efficiently it provides and maintain a platform of running application software okay so system software is designed to operate the computer hardware so we can say windows 7 linux this all operating system is comes under the system software in which the application software can be run so that windows 7 and linux are providing the platform to run the application software. So system software can be classified into three categories. First one is operating system. It controls hardware as well as interact with the user and provides different services to the user. It is a bridge between computer hardware and user. For example, Windows 7, Linux, these all operating systems. So an operating system is an interface between a computer user and computer hardware. An operating system is a software which performs all basic tasks like file management, memory management, process management, handling of input and output and controlling the peripheral devices such as disk drives and printers. Next category is system support software. So it makes working of hardware more efficiently. for example drivers of the input devices or routine for socket programming etc so when we insert a new pen drive in our computer then automatically the that software which are already there in the pen drive that is a driver of that pen drive is automatically installed in our computer okay it is with the help of system support software so that is an example so next category is system development software it provides the programming development environment to the programmer for example editor pre-processor compiler interpreter loader etc okay for example if we take uh if we if this compiler is in system development software what it do it it translates the source code into the machine code so the system development software is the process of defining designing testing and implementing a new software application or a programs okay so these three are the categories of system software first one is operating system second one is system support software and third one is system development software so the next type of software is application software so application software is designed to help the user to perform general tasks which includes word processing web browser or some specific tasks like accounting or ticket booking so the examples of application softwares are enterprise software accounting software office suits graphic software and media players so application software is a software that performs specific tasks for the end If the user is interacting directly with a piece of software, it is known as application software. For example, Microsoft Word or Excel or we are using the web browsers that are all the examples of application software. So application software is also classified into two categories. First one is general purpose software. It is used widely by many people for some common tasks like word processing, web browsing. excel excel etc it is designed on vast concept so many people can use it so there are several good reasons for using general purpose office it is relatively cheap it is easily available from the most of the computer shops there will be lots of user support like books user guides online help so general purpose software includes the browsers and the most commonly used softwares like powerpoint excel word this all are comes under the general purpose of next one is spatial purpose software it is used by limited people for some specific tasks like accounting software test text calculation software ticket booking software banking software etc it is designed as per the user special requirement okay so we can say this uh flight booking bus booking hotel booking these types of uh applications softwares are known as special purpose software which are designed as per the user special requirement okay not most of the people are commonly use this type of software special purpose software but general purpose software most of the common people are using day by day. So the next topic is what is hardware? So the physical part of a computer is known as hardware. User can see and touch the hardware components. So the computer hardware includes the physical parts of a computer such as the central processing unit, monitor, mouse, keyboard, computer, computer data storage, traffic card, Sound card, speaker and motherboard. So hardware is typically directed by the software to execute any command or instructions. A combination of hardware and software forms a usable computing system. So next topic is what is the difference between hardware and software? So the first point is software is set of instructions that tells a computer exactly what to do. But hardware is a physical part of computer that cause processing of data. okay with the help of hardware the software can instruct the computer to do what exactly computer have to do second point software cannot be executed without hardware and hardware cannot perform any task without software software cannot be touched hardware can be seen and touched we can touch the hardware but we cannot touch the software that's why this point is written Fourth point is software is debugged in the case of problem. If there is any problem in the software, the programmer can rebuild that software again and it can be installed once again. But hardware, in the case of hardware, hardware is repaired in the case of problem. It can be repaired or it can be only replaced. Only two opportunities are there in the hardware. Hardware can be repaired or it can be replaced. Next is Software is reinstalled if there is any problem or if problem is not solved. But hardware is replaced if the problem is not solved. That I already tell you in point number 4. So this is the difference between hardware and software which is also frequently asked in GTO examination. So the next topic is what is compiler and interpreter? So first we see what is compiler. A compiler translates the program of high level language to machine language. It converts whole program at a time. So what is higher level language? A high level language is a programming language such as C which can understandable by the user, by the human beings which cannot understand by the computer. Why? Because it is a high level language. Computer understand only machine language. in the form of zeros and one that's why it is a translator computer is a compiler is a translator which translate the high level language into machine level language so that comp this computer can understand so it converts whole program at a time for example suppose there is a there is a block of c code it translate this c code this compiler translate this whole code at a time into target code in the form of 0 1 which computer can understand if there is any error in this program then it will detect and represent to the user so next one is what is interpreter so interpreter translates a program of high level language to machine level language so it is also translator like compiler Compiler also translates high level language to machine level language. But interpreter converts the program line by line. This is the difference between compiler and interpreter. In the case of compiler, it translates the whole program at a time. But in interpreter, it translates the program line by line. For example, suppose there is a code void when it translates first line, then second line. If there is any error, it can be reported to the user. then it translates second line next line next line next line okay so there is a simple difference between compiler and interpreter compiler takes whole program at a time and translate it into the machine code if there is any error it can be report to the user but in interpreter it translate the whole it does not translate the whole program at a time instead it translate line by line. It translates the high level language into machine level language line by line. So this is a major difference between interpreter and compiler. So next one is what is the difference between compiler and interpreter. So compiler takes as we see in the previous to previous slide that compiler takes the entire program as an input and compiles but interpreter takes single instruction as an input and compile. Okay. Compiler does not allow program to run until it is completely error free. Whenever we compile the whole program, if there is any error in that program, we cannot be we cannot able to run that particular program. So compiler does not allow the program to run until it is completely error free. Interpreter runs the program from the first line and stop execution only if it finds an error at particular statement. okay it converts the program line by line if any of the line contains error it can stop there okay it can stop the execution there and it reports the error to the user So compiler require memory requirement of compiler is more why because it compiles whole program at a time and in interpreter memory requirement is less because it compiles the program line by line. So error is displayed in compiler after entire program is checked. But in interpreter error is displayed for every instruction it will interpreted. So the example of compiler is C compiler. and the example of interpreter is basic and java interpreter hope you understand the introduction of computer and programming language basic block diagrams and functions of various components of computer then concepts of hardware and softwares types of softwares and compiler and interpreter if you have any query in any topic please contact me and in next video of unit number one we are what is the concept of machine level language, assembly level language, high level programming language and flowcharts and algorithm. This all are covered in next part of the unit number one. Thank you.