You don’t have to be great to start, but you have to start to be great.
--Your friends at LectureNotes

Computer Programming and Utilization

by Patel Harsh
Type: NoteInstitute: Gujarat Technological University Specialization: Computer Science EngineeringOffline Downloads: 45Views: 1117Uploaded: 8 months agoAdd to Favourite

Touch here to read

Computer Programming and Utilization by Patel Harsh

Patel Harsh
Patel Harsh

/ 64

Share it with your friends

Suggested Materials

Leave your Comments


Patel Harsh
Patel Harsh
Darshan Insttitute of En ngineering & Technology Syllabus S for 1st midsem exa am Computer Programmiing and Utiliization (CPU U) – 110003 3 A) Co omputer Fun ndamentals 1 Draw th he block diag gram of com mputer architecture and d explain ea ach block. Computerr is made up of o mainly fourr components,, 1) C Central proces ssing unit (CPU U) 2) Input section 3) O Output section n 4) S Storage device es Centtral Processiing Unit ALU + CU U INP PUT SECTIO ON OUTPUT SE ECTION (Mouse e, Keyboard, ettc...) ( (Monitor, Printe er, etc…) PR RIMARY MEM MORY ( (RAM, ROM, ettc…) SEC CONDARY MEMORY (Hard d disk, Pen driv ve, etc…) 1) Central C Proce essing Unit (CPU):( • Central processing unit is a main parrt of the comp puter system. • It contains s electronics circuitry c that p processes the data based on instructions s. • It also con ntrols the flow w of data in the e system. • It is also known k as brain of the comp puter. • CPU consis sts of, 1 1.1) Arithm metic Logic Un nit (ALU) 9 Itt performs all arithmetic callculations and takes logical decision. 9 Itt can perform add, subtractt, multiply, compare, count,, shift and oth her logical activities. 9 Itt calculates ve ery fast. 9 Itt takes data from memory y unit and re eturns data to t memory unit, u generally y primary memory. m 1 1.2) 1 1.3) Contro ol Unit (CU) 9 Itt controls all other o units in the t computer system. 9 Itt manages all operations 9 Itt reads instruc ction and data a from memorry. Primary Memory:9 Itt is also known n as main memory. 9 Th he processor or o the CPU dirrectly stores and a retrieves iinformation frrom it. 1
Darshan Insttitute of En ngineering & Technology Syllabus S for 1st midsem exa am 9 Thiis memory is accessed a by C CPU, in random m fashion 9 Generally curren ntly executing programs and data are sto ored in primarry memory 9 Its storage capacity is very sm mall compared d to secondary y storage. 9 It is very fast in an operation compared to secondary sto orage 9 RAM is Random Access Memo ory and it is vo olatile in naturre. 9 RO OM is Read Only Memory an nd it can hold data permane ently. 9 PRO OM is Program mmable Read Only Memory y and it can h hold data perm manently. Pro ogrammer can n store inform mation only once. Modificatio on is not allow wed. 9 EPR ROM is Erasa able Program mmable Read Only Memorry. It can ho old data perm manently. Pro ogrammer can n delete and w write on it again and again. 2) Input I Section n:• The device es used to entter data in to computer sys stem are called d input device es. • It converts s human unde erstandable in nput to compu uter controllab ble data. • CPU accep pts information n from user th hrough input devices. d • Examples:: Mouse, Keyb board, Touch s screen, Joystick etc… 3) Output O Sectio on:• The device es used to send the inform mation to the outside world from the com mputer is called output devices. • It converts s data stored in 1s and 0s iin computer to human unde erstandable in nformation • Examples:: Monitor, Prin nter, Plotter, Speakers S etc… … 4) Storage S devic ces (Secondary memory y):- 2 • Secondary y memory is also a called Aux xiliary memory y or External memory. • User can store s data perrmanently. • It can be modified m easily. • It can storre large data compared c to primary p memo ory. Now days s, it is availab ble in Terabyte es. • Examples:: Hard disk, Floppy disk, CD D, DVD, Pen drive, d etc… Describe e advantage es and limita ations of co omputer. Or Explain cha aracteristics s of compute er. Advantages • S Speed: It can calculate millions of expre essions within a fraction of second. The micro m second and nano s second units are a used to measure m the sp peed of computers. There are a some problems which cannot c be s solved within specified s time limit without computer. • S Storage: It ca an store data in large quan ntity using varrious storage devices. Millio ons of paper file’s data c can be stored in single sma all pen drive. M Moreover, it reproduces r da ata whenever we need and whatever fo ormat we nee ed. Now a day ys, Gigabytes a and Terabytes s are units of data storage devises. • A Accuracy: Co omputer perfforms the computations at a very high speed witho out any mista akes. For e example, multtiplication of two very larrge number takes more time for huma an and there are high p probabilities of mistakes. Computer C does it in parts of o the second d with accurac cy level we want. w Very h high level of accuracy a is must in financia al transaction, medical surrgery, nuclearr plant, etc… which w can b satisfied by be y computer on nly. • R Reliability: Itt is very relia able device. T The informatio on stored in c computer is available a afterr years in 2
Darshan Insttitute of En ngineering & Technology Syllabus S for 1st midsem exa am s same form. It works 24 hou urs without an ny problem as it does not fe eel tiredness. • A Automation: Once the one task is crea ated in a com mputer, it can n be repeatedly performed again by s single click wh henever we want. For exam mple, once the e software forr banking application is insttalled in a c computer, it co omputes the interest i by sending one com mmand. Limitatio ons • L Lake of intellligence: It ca annot think wh hile doing worrk. It does nott have natural intelligence. It cannot think about prroperness or effect e of work k it is doing. It I can only ex xecute the ins structions but it cannot think about the correctness of these instrructions. • U Unable to Co orrect Mistak kes: It cannott correct the mistakes by itself. So if we e have provid ded wrong o incorrect da or ata then it pro oduces wrong results or perrforms wrong calculations. 3 Describe e various ty ypes of comp puter langua ages and mention its advantages and a disadva antages. Computerr languages may m be classified in three ca ategories, 1) Machine lev vel language e or Low leve el language:-• Computer directly und derstands this language. It is a language e of 0’s and 1’s 1 (binary). Every E CPU has its ow wn machine la anguage. • • ADVANTA AGES: 1. It is very v fast in ex xecution 2. It does not require e any extra sy ystem or softw ware to run the program. 3. Trans slation is not required. 4. Suita able for low vo olume applicattions. DISADVA ANTAGES: 1. Progrrams are long g and difficult to write and understand u for human. 2. Debu ugging is very difficult task.. 3. It is not portable. 4. Progrrammer requires detailed k knowledge of architecture a o microproces of ssor. 2) Assembly la anguage:• Every ma achine langua age instruction n is assigned to English word w MNEMON NIC such that it should describe function of ins struction. • System cannot c unders stand this language directly y so we requiire translator that convert assembly language e to machine la anguage. This s translator is called assembler. • Example : 8086 Instru uction Set • ADVANTA AGES: • 1. Progrrams are easy y to understan nd compared to t machine level language. 2. Progrrams are sma aller in size compared to ma achine level la anguage. 3. Progrrams can be entered e quicklly using alpha anumeric keyb board. DISADVA ANTAGES: 1. It is not portable. 2. Progrrammer shoulld know structture of assem mbly language of microproce essor. 3. It req quires assemb bler as a trans slator. 3) Higher levell language:• We can write w programs in English lik ke manner an nd it is more convenient to use. • Programm mer can perfo orm complex ttask by using high level languages with le ess efforts. 3
Darshan Insttitute of En ngineering & Technology • It is simillar to natural language and d mathematica al notation. • Example:: C, C++, Java, etc… • ADVANTA AGES: • 4 1) Easie er to learn. 2) Requ uires less time e to write. 3) Proviides better do ocumentation. 4) Easie er to maintain. 5) It is portable. Syllabus S for 1st midsem exa am DISADVA ANTAGES: 1) It req quires compile er or interpretter to convert higher level language to machine m language. 2) Progrrammers need d to learn stru ucture of high level languag ge. 3) It is bit slow comp pared to low le evel and medium level language. Why C is s called mid ddle level lan nguage? C is called d middle levell language bec cause • S Syntax and ke eywords of C are a just like hiigher level lan nguage (Englis sh). • It gives advantages of highe er level language through function, f modular programm ming and brea akup. • It gives access s to the low le evel memory tthrough Pointe ers. • M Moreover it do oes support th he Low Level p programming i.e., Assembly y Language. • W can develop application specific pro We ograms in C and at the s same time we can use fe eatures of a assembly level language to give more speed and efficiency • 5 It is not hardw ware or system m dependent. Hence portab ble programs c can be written n with C comp piler. Write a short note on o types of software. A set of instruction i in a logical orde er to perform m a meaningfu ul task is calle ed program and a set of program is called sofftware. System Software S System software is des signed to operrate the comp puter hardwarre efficiently. IIt provides an nd maintains a platform for runnin ng application n software. Siince system s software runs at the most basic level off computer, itt is called "low-level" software. b classified in nto three categ gories System software can be 1) O Operating systtem: It contro ols hardware as well as interacts with us sers, and prov vides different services to user. It is a bridge betwe een computer hardware and d user. Ex: Wiindows XP, Lin nux, UNIX, etc… 2) S System suppo ort software: It I makes worrking of hardw ware more effficiently. For example e drive ers of the I//O devices or routine for so ocket program mming, etc… 3) S System develo opment softw ware: It provid des programm ming developm ment environm ment to programmers. E Editor, pre Ex: e-processor, compiler, interrpreter, loaderr, etc….. Application software e Applicatio on software is designed to help h the user to perform ge eneral tasks (word processiing, web brow wser …) or some spe ecific task (ac ccounting, tick ket booking …). … Example: Enterprise so oftware, Accou unting softwa are, Office suites, Grraphics softwa are and media a players. Applicatio on software is classified into o two categories. 1) G General purpo ose software:: It is used widely by many m people ffor some com mmon task, like word p processing, we eb browser, ex xcel, etc… It is designed on n vast conceptt so many peo ople can use itt. 4

Lecture Notes