+ All Categories
Home > Documents > Notes on Computer

Notes on Computer

Date post: 04-Apr-2018
Category:
Upload: 2nabls
View: 220 times
Download: 1 times
Share this document with a friend
46
B.TECH-II SEM/FCP/THEORI TICAL NOTES ON UNIT-I AND II BY PANKAJ CHAUDHARY Page 1 NOTES ON FUNDAMENTALS OF COMPUTER AND PROGRAMMING ON UNIT I AND UNIT II SYLLABUS AS PER UTTRAKHAND TECHNICAL UNIVERSITY UNIT-I Introduction to Computer Systems; Data representation: Number systems, character representation codes, Binary, hex, octal codes and their inter conversions. Binary arithmetic, Floating point arithmetic, signed and unsigned numbers IEEE standards, CPU organization, ALU, registers, memory, the idea of program execution at micro level. Concept of computing, contemporary Operating Systems such as DOS, Windows, UNIX etc. (only brief user level description). Introduction to organization and architecture of mainframe, mini and micro systems. UNIT-II Concept of flow chart and algorithm; Algorithms to programs: specification, top-down development and stepwise refinement ,Introduction to the design and implementation of correct, efficient and maintainable programs, structured Programming,,Use of high level programming language for the systematic development of programs, programmability and programming languages, Object codes, compilers. Introduction to the Editing tools such as vi or MS-VC editors. (Possible Theoritical Questions and Answers From Unit 1 & 2) Question No: (1) Define computers? Why computer is known as data processing system? What are the basic operations of Computer?  Answer: Computer: A computer is a programmable machine or device that performs pre-defined or programmed computations or controls operations that are expressible in numerical or logical terms at high speed and with great accuracy. Computer is a fast operating electronic device, which automatically accepts and store input data, processes them and produces results under the direction of step by step program. Any Process that uses a computer program will enter data and summarize, analyze or otherwise convert data into usable information. The process may be automated and run on a computer. It involves recording, analyzing, sorting, summarizing, calculating, disseminating and storing data. Thus Computer is known as data processing system. Its various operations are: 1) It accepts data or instructions by way of input. 2) It stores data. 3) It can process data as required by the user. 4) It gives results in the form of output.
Transcript
Page 1: Notes on Computer

7/29/2019 Notes on Computer

http://slidepdf.com/reader/full/notes-on-computer 1/46

B.TECH-II SEM/FCP/THEORITICAL NOTES ON UNIT-I AND II BY PANKAJ CHAUDHARY Page 1

NOTES ON FUNDAMENTALS OF COMPUTER AND PROGRAMMING ON UNIT I AND UNIT II

SYLLABUS AS PER UTTRAKHAND TECHNICAL UNIVERSITY

UNIT-IIntroduction to Computer Systems; Data representation: Number systems, character representationcodes, Binary, hex, octal codes and their inter conversions. Binary arithmetic, Floating point arithmetic,signed and unsigned numbers IEEE standards, CPU organization, ALU, registers, memory, the idea of program execution at micro level. Concept of computing, contemporary Operating Systems such as DOS,Windows, UNIX etc. (only brief user level description). Introduction to organization and architecture of mainframe, mini and micro systems.

UNIT-IIConcept of flow chart and algorithm; Algorithms to programs: specification, top-down development andstepwise refinement ,Introduction to the design and implementation of correct, efficient andmaintainable programs, structured Programming,,Use of high level programming language for thesystematic development of programs, programmability and programming languages, Object codes,compilers. Introduction to the Editing tools such as vi or MS-VC editors.

(Possible Theoritical Questions and Answers From Unit 1 & 2)

Question No: (1) Define computers? Why computer is known as data processing system? What are the basic operations of Computer?

Answer : Computer: A computer is a programmable machine or device that performs pre-defined

or programmed computations or controls operations that are expressible in numerical or logicalterms at high speed and with great accuracy.

Computer is a fast operating electronic device, which automatically accepts and store input data,processes them and produces results under the direction of step by step program.

Any Process that uses a computer program will enter data and summarize, analyze or otherwiseconvert data into usable information. The process may be automated and run on a computer.It involves recording, analyzing, sorting, summarizing, calculating, disseminating and storing data. ThusComputer is known as data processing system.

Its various operations are:1) It accepts data or instructions by way of input.2) It stores data.3) It can process data as required by the user.4) It gives results in the form of output.

Page 2: Notes on Computer

7/29/2019 Notes on Computer

http://slidepdf.com/reader/full/notes-on-computer 2/46

B.TECH-II SEM/FCP/THEORITICAL NOTES ON UNIT-I AND II BY PANKAJ CHAUDHARY Page 2

5) It controls all operations inside a computer.Question No: (2) . What is Data and Information? Give the applications of computer? What arethe characteristics of computers?

Answer: Data -Data is the fact or raw material for the information processing.

Information – The processed data is called information.

Applications of computer · Word Processing· Internet· Desktop publishing· Digital video or audio composition· Mathematical Calculations· Robotics· Weather analysis

Characteristics of computers

· Speed· Accuracy.· Automation.· Endurance.· Versatility.· Storage.· Cost Reduction.

Question No: (3) . How will you classify computer systems?Answer: Based on physical size, performance and application areas, we can generally divide computersinto four major categories:1. Micro computer2. Mini Computer3. Mainframe computer and4. Super Computer

Personal computers/Micro computers: A small, relatively inexpensive computer designed for anindividual user. In price, personal computers range anywhere from a few hundred dollars to thousandsof dollars. All are based on the microprocessor technology that enables manufacturers to put anentire CPU on one chip.

Example:

Page 3: Notes on Computer

7/29/2019 Notes on Computer

http://slidepdf.com/reader/full/notes-on-computer 3/46

B.TECH-II SEM/FCP/THEORITICAL NOTES ON UNIT-I AND II BY PANKAJ CHAUDHARY Page 3

· Businesses use personal computers forward processing, accounting, desktop publishing, and forrunning spreadsheet and database management applications. At home, the most popular use forpersonal computers is for playing games.

Mainframe computer

Mainframes arecomputers used mainly by large organizations for critical applications, typicallybulk data processing such as census, industry and consumer statistics, enterprise resource planning,and financial processing.The term probably had originated from the early mainframes, as they were housed in enormous,room-sized metal boxes or frames.

Mini computers:A mini computer is a multi-user or time-sharing system. It is used for medium scale data processing suchas Bank account processing, Payroll processing etc., Mini computer process greater storage capacity andlarger memories as compared to micro computer.Super computerThe fastest type ofcomputer. Supercomputers are very expensive and are employed forspecializedapplications that require immense amounts of mathematical calculations.For example, weather forecasting requires a supercomputer. Other uses of supercomputersinclude animated graphics, fluid dynamic calculations, nuclear energy research, and petroleumexploration.Question No: (4). Explain the fundamental units of a computer with a block diagram? Explainthe basic computer organization in detail?

Answer: A computer can process data, pictures, sound and graphics. They can solve highly

Page 4: Notes on Computer

7/29/2019 Notes on Computer

http://slidepdf.com/reader/full/notes-on-computer 4/46

B.TECH-II SEM/FCP/THEORITICAL NOTES ON UNIT-I AND II BY PANKAJ CHAUDHARY Page 4

Complicated problems quickly andaccurately.

Input Unit:Computers need to receive data and instruction in order to solve any problem. Therefore we need toinput the data and instructions into the computers. The input unit consists of one or more inputdevices. Keyboard is the one of the most commonly used input device. Other commonly usedinput devices are the mouse, floppy disk drive, magnetic tape, etc. All the input devices performthe following functions.· Accept the data and instructions from the outside world.· Convert it to a form that the computer can understand.· Supply the converted data to the computer system for further processing.e.g. Keyboard, Scanner, Mouse, Joystick, Mike etc

Storage Unit:The storage unit of the computer holds data and instructions that are entered through theinput unit, before they are processed. It preserves the intermediate and final results before theseare sent to the output devices. It also saves the data for the later use.

Types of Storage Devices:(A) Primary Storage:1. Stores and provides very fast.

Page 5: Notes on Computer

7/29/2019 Notes on Computer

http://slidepdf.com/reader/full/notes-on-computer 5/46

B.TECH-II SEM/FCP/THEORITICAL NOTES ON UNIT-I AND II BY PANKAJ CHAUDHARY Page 5

2. This memory is generally used to hold the program being currently executed in the computer,the data being received from the input unit, the intermediate and final results of the program.3. The primary memory is temporary in nature. The data is lost, when the computer is switchedoff.4. In order to store the data permanently, the data has to be transferred to the secondary

memory. The cost of the primary storage is more compared to the secondary storage.e.g. RAM, ROM etc

(B) Secondary Storage:1. It stores several programs, documents, data bases etc.2. The programs that run on the computer are first transferred to the primary memorybefore it is actually run.3. Whenever the results are saved, again they get stored in the secondary memory.4. The secondary memory is slower and cheaper than the primary memory. Some of thecommonly used secondary memory devices are Hard disk, CD, etc.,e.g. CD-ROM, HDD, FLOPPY DRIVE etc

Memory Size:All digital computers use the binary system, i.e. 0’s and 1’s. Each character or a numberis represented by an 8 bit code. The set of 8 bits is called a byte. A Character occupies 1byte space. A numeric occupies 2 byte space. Byte is the space occupied in the memory. Thesize of the primary storage is specified in KB (Kilobytes) or MB (Megabyte). One KB isequal to 1024 bytes and one MB is equal to 1000KB. The size of the primary storage in a typical PCusually starts at 16MB. PCs having 32 MB, 48MB, 128 MB, 256MB memory are quite common.

Output Unit:The output unit of a computer provides the information and results of a computation to outside world.Printers, Visual Display Unit (VDU) are the commonly used output devices. Other commonly used outputdevices are floppy disk drive, hard disk drive, and magnetic tape drive.

Arithmetic Logical Unit:All calculations are performed in the Arithmetic Logic Unit (ALU) of the computer. It also doescomparison and takes decision. The ALU can perform basic operations such as addition,subtraction, multiplication, division, etc and does logic operations viz, >, <, =, ‘etc. Whenevercalculations are required, the control unit transfers the data from storage unit to ALU once thecomputations are done, the results are transferred to the storage unit by the control unit and then it issend to the output unit for displaying results.

Control Unit:

Page 6: Notes on Computer

7/29/2019 Notes on Computer

http://slidepdf.com/reader/full/notes-on-computer 6/46

B.TECH-II SEM/FCP/THEORITICAL NOTES ON UNIT-I AND II BY PANKAJ CHAUDHARY Page 6

It controls all other units in the computer. The control unit instructs the input unit, where to store thedata after receiving it from the user. It controls the flow of data and instructions from the storage unit toALU. It also controls the flow of results from the ALU to the storage unit. The control unit is generallyreferred as the central nervous system of the computer that control and synchronizes its working.

Central Processing Unit:The control unit and ALU of the computer are together known as the Central Processing Unit (CPU). TheCPU is like brain performs the following functions:• It performs all calculations.• It takes all decisions.• It controls all units of the computer.

A PC may have CPU-IC such as Intel 8088, 80286, 80386, 80486, Celeron, Pentium, Pentium Pro, PentiumII, Pentium III, Pentium IV, Dual Core, and AMD etc.

Question No: (5). With suitable examples, explain about Number systems?

Answer: A number system is a set of rules and symbols used to represent a number. There areseveral different number systems. Some examples of number systems are as follows:· Binary (base 2)· Octal (base 8)· Decimal (base 10)· Hexadecimal (base 16)Decimal and Hexadecimal numbers can each be represented using binary values. This enables

decimal, hexadecimal, and other number systems to be represented on a computer which is basedaround binary (0 or 1 / off or on). The base (or radix) of a number system is the number of units that isequivalent to a single unit in the next higher counting space. In the decimal number system, thesymbols 0-9 are used in combination to represent a number of any sizes.

For example, the number 423 can be viewed as the following string of calculations:(4 x 100) + (2 x 10) + (3 x 1) = 400 + 20 + 3 = 423

Question No: (6). Explain various generations of computers with features?

Answer: Generation of Computers:Each phase of computer development is known as a separate generation of computers. Thecomputer can be classified into four generations according to their type of electronic circuits suchas vacuum tube, transistor, IC etc.

(a) The First Generation Computers (1949-55)

Page 7: Notes on Computer

7/29/2019 Notes on Computer

http://slidepdf.com/reader/full/notes-on-computer 7/46

B.TECH-II SEM/FCP/THEORITICAL NOTES ON UNIT-I AND II BY PANKAJ CHAUDHARY Page 7

Main Features :1) The computers of this generation used vacuum tubes.2) These computers used machine language for giving instructions.3) They used the concept of stored program.4) These computers were 5000 times faster than the MARK-I.

5) The first generation computers were welcomed by Government and Universities.

Limitations:1)These computers were very big in size. The ENIAC machine was 30 x 50 feet in size and30 tons in weight. So, these machines required very large space for their workings.2)Their power consumption was very high.3)These computers had slow operating speed and small computing capacity.4)These computers had a very small memory.

(b) The Second Generation Computers (1956-65)Main Features:1) The computers of this generation replaced vacuum tubes with transistors.2) Magnetic cores were invented for storage.3) Different magnetic storage devices were developed in this generation.4) Commercial applications were developed during this period. Eighty percent of these computerswere used in business and industries.

(c) Third Generation Computers (1966-75)Main Features:

· The third generation computers replaced transistors with’ Integrated Circuits’. These IntegratedCircuits are also known as chips.· The size of main memory was increased and reached about 4 megabytes.· Magnetic disk technology had been improved and drive having capacity upto 100MBPS came into existence.· The CPU becomes more powerful with the capacity of carrying out 1 million instructions persecond.· This generation computers were relatively inexpensive and faster.· The application area also increased in this generation. The computers were used in other areas likeeducation, small businesses survey, analysis along with their previous usage areas.

(d) The Fourth Generation Computers (1976-Present)Main Features:i.The fourth generation computers replaced small scale integrated circuits and medium scaleintegrated circuits with the microprocessors chip.ii. Semiconductor memories replaced magnetic core memories.

Page 8: Notes on Computer

7/29/2019 Notes on Computer

http://slidepdf.com/reader/full/notes-on-computer 8/46

B.TECH-II SEM/FCP/THEORITICAL NOTES ON UNIT-I AND II BY PANKAJ CHAUDHARY Page 8

iii. The hard-disks are available of the sizes upto 200 GB. The RAID technology (Redundant Arrayof Inexpensive Disks) gives storage upto thousands of GB.iv. Computer cost came down rapidly in this generation.v. Application of computers is increased in various areas like visualization, parallel computing,multimedia etc.

(e) The Fifth Generation ComputersMankind along with the advancement in science and technology is working hard to bring the VthGeneration of computer. These computers will have the capability of thinking on their own likean man with the help of Artificial Intelligence (AI). the 21st century will be better, faster, smallerand smarter computers.

Question No: (6). Explain the classification of computers?

Answer: CLASSIFICATION OF COMPUTERSPersonal Computers:A personal computer (PC) is a self-contained computer capable of input, processing, output, andstorage. A personal computer is designed to be a single-user computer and must have at least one inputdevice, one output device, a processor, and memory. The three major groups of PCs are desktopcomputers, portable computers, and handheld computers. Desktop Computers: A desktop computer isa PC designed to allow the system unit, input devices, output devices, and other connecteddevices to fit on top of, beside, or under a user’s desk or table. This type of computer may be used in thehome, a home office, a library, or a corporate setting.

Portable Computers:A portable computer is a PC small enough to be moved around easily. As the name suggests, a laptopcomputer fits comfortably on the lap. As laptop computers have decreased in size, this type of computer is now more commonly referred to as a notebook computer. Manufacturers recentlybegan introducing a new type of computer called the tablet PC, which has a liquid crystal display(LCD) screen on which the user can write using a special-purpose pen, or stylus. Tablet PCs rely ondigital ink technology that allows the user to write on the screen. Another type of portablecomputer, called a wearable computer, is worn somewhere on the body, thereby providing a user withaccess to mobile computing capabilities and information via the Internet.

Handheld Computers:An even smaller type of personal computer that can fit into the hand is known as a handheld computer(also called simply handheld, pocket PC, or Palmtop). In recent years, a type of handheldcomputer called a personal digital assistant (PDA) has become widely used for performingcalculations, keeping track of schedules, making appointments, and writing memos. Some

Page 9: Notes on Computer

7/29/2019 Notes on Computer

http://slidepdf.com/reader/full/notes-on-computer 9/46

B.TECH-II SEM/FCP/THEORITICAL NOTES ON UNIT-I AND II BY PANKAJ CHAUDHARY Page 9

handheld computers are Internet-enabled, meaning they can access the Internet without wireconnections. For example, a smart phone is a cell phone that connects to the Internet to allowusers to transmit and receive e-mail messages, send text messages and pictures, and browse throughWeb sites on the phone display screen.

Workstations:A workstation is a high-performance single-user computer with advanced input, output, and storagecomponents that can be networked with other workstations and larger computers. Workstationsare typically used for complex applications that require considerable computing power and high-quality graphics resolution, such as computer-aided design (CAD), computer-assisted manufacturing(CAM), desktop publishing, and software development.

Midrange Servers/Minicomputers:Linked computers and terminals are typically connected to a larger and more powerful computercalled a network server, sometimes referred to as a host computer. Although the size andcapacity of network servers vary considerably, most are midrange rather than large mainframecomputers.

(i) Midrange server – formerly known as a minicomputer, a midrange server is a powerfulcomputer capable of accommodating hundreds of client computers or terminals (users) at thesame time.

(ii) Terminal – a device consisting of only a monitor and keyboard, with no processingcapability of its own.

Mainframe Computers:Larger, more powerful, and more expensive than midrange servers, a mainframe computer is capable of accommodating hundreds of network users performing different computing tasks. These computersare useful for dealing with large, ever-changing collections of data that can be accessed by many userssimultaneously. Government agencies, banks, universities, and insurance companies use mainframes tohandle millions of transactions each day.

Supercomputers:A supercomputer is the fastest, most powerful, and most expensive of all computers. Many arecapable of performing trillions of calculations in a single second. Primary applications includeweather forecasting, comparing DNA sequences, creating artificially intelligent robots, andperforming financial analyses.

Question No: (7). Explain Second Memory in detail?

Page 10: Notes on Computer

7/29/2019 Notes on Computer

http://slidepdf.com/reader/full/notes-on-computer 10/46

B.TECH-II SEM/FCP/THEORITICAL NOTES ON UNIT-I AND II BY PANKAJ CHAUDHARY Page 10

Answer: Secondary storage devices, as indicated by the name, save data after it has been saved by theprimary storage device, usually referred to as RAM (Random Access Memory). From the momentwe start typing a letter in Microsoft Word, for example, and until we click on "Save," your entirework is stored in RAM. However, once you power off your machine, that work is completelyerased, and the only copy remaining is on the secondary storage device where we saved it, such

as internal or external hard disk drive, optical drives for CDs or DVDs, or USB flash drive.

Internal Hard Disk DriveThe internal hard disk drive is the main secondary storage device that stores all of your datamagnetically, including operating system files and folders, documents, music and video. Thehard disk drive is a stack of disks mounted one on top of the other and placed in a sturdy case. They arespinning at high speeds to provide easy and fast access to stored data anywhere on a disk.

External Hard Disk DriveExternal hard disk drives are used when the internal drive does not have any free space and you need tostore more data. In addition, it is recommended to always back up all of our data and an external harddrive can be very useful, as they can safely store large amounts of information. They can be connectedby either USB connection to a computer and can even be connected with each other in case you needseveral additional hard drives at the same time.

Optical DriveAn optical drive uses lasers to store and read data on CDs and DVDs. It basically burns a seriesof bumps and dips on a disc, which are associated with ones and zeros. Then, this same drivecan interpret the series of ones and zeros into data that can be displayed on your monitors. There are afew different types of both CD and DVD disks, but the main two types include R and RW, which stand forRecordable (but you can write information on it just once) and Rewritable (meaning you can record dataon it over and over again).

USB Flash DriveUSB flash memory storage device is also portable and can be carried around on a key chain. This type of a secondary storage device has become incredibly popular due to the very small size of device comparedto the amount of data it can store (in most cases, more than CDs or DVDs). Data can be easily read usingthe USB (Universal Serial Bus) interface that now comes standardwith most of the computers.

Question No: (8). Explain about memory in Computer System?(or) Write short notes onmemory of a computer?

Answer: The Role of Memory: The term "memory" applies to any electronic component capable of temporarily storing data.

Page 11: Notes on Computer

7/29/2019 Notes on Computer

http://slidepdf.com/reader/full/notes-on-computer 11/46

B.TECH-II SEM/FCP/THEORITICAL NOTES ON UNIT-I AND II BY PANKAJ CHAUDHARY Page 11

There are two main categories of memories:Internal memory that temporarily memorizes data while programs are running. Internal memory usesmicro conductors, i.e. fast specialized electronic circuits. Internal memory corresponds to what wecall random access memory (RAM).

Auxiliary memory (also called physical memory or external memory) that stores information overthe long term, including after the computer is turned off. Auxiliary memory corresponds to magneticstorage devices such as the hard drive, optical storage devices such as CD-ROMs and DVD-ROMs, as wellas read-only memories.

Technical Characteristics(a) Capacity, representing the global volume of information (in bits) that the memory canstore(b) Access time, corresponding to the time interval between the read/write request and theavailability of the data(c) Cycle time, representing the minimum time interval between two successive accesses(d) Throughput, which defines the volume of information exchanged per unit of time,expressed in bits per second(e) Non-volatility, which characterizes the ability of a memory to store data when it is notbeing supplied with electricity

The ideal memory has a large capacity with restricted access time and cycle time, a highthroughput and is non-volatile. However, fast memories are also the most expensive. This is whymemories that use different technologies are used in a computer, interfaced with each other andorganized hierarchically. The fastest memories are located in small numbers close to theprocessor. Auxiliary memories, which are not as fast, are used to store information permanently.Types of Memories

Random Access MemoryRandom access memory, generally called RAM is the system's main memory, i.e. it is a spacethat allows you to temporarily store data when a program is running. Unlike data storage on anauxiliary memory such as a hard drive, RAM is volatile, meaning that it only stores data as longas it supplied with electricity. Thus, each time the computer is turned off, all the data in the memoryare irremediably erased.Read-Only MemoryRead-only memory, called ROM, is a type of memory that allows you to keep the informationcontained on it even when the memory is no longer receiving electricity. Basically, this type of memory only has read-only access. However, it is possible to save information in some types of ROM memory.

Page 12: Notes on Computer

7/29/2019 Notes on Computer

http://slidepdf.com/reader/full/notes-on-computer 12/46

B.TECH-II SEM/FCP/THEORITICAL NOTES ON UNIT-I AND II BY PANKAJ CHAUDHARY Page 12

Flash MemoryFlash memory is a compromise between RAM-type memories and ROM memories. Flash memorypossesses the non-volatility of ROM memories while providing both read and writes access However,the access times of flash memories are longer than the access times of RAM.

Question No: (9). Elaborate the various Peripheral (Input and Output) Devices?

Answer: Input/Output devices are required for users to communicate with the computer. In simpleterms, input devices bring information INTO the computer and output devices bring informationOUT of a computer system. These input/output devices are also known as peripherals since theysurround the CPU and memory of a computer system. Some commonly used Input/Output devices arelisted in table below.

(a)Keyboard

It is a text base input device that allows the user to input alphabets, numbers and other characters. Itconsists of a set of keys mounted on a board.

Alphanumeric Keypad: It consists of keys for English alphabets, 0 to 9 numbers, and special characterslike + − / * ( ) etc.

Function Keys: There are twelve function keys labeled F1, F2, F3… F12. The functions assigned to thesekeys differ from one software package to another. These keys are also user programmable keys.

Special-function Keys

These keys have special functions assigned to them and can be used only for those specific purposes.Functions of some of the important keys are defined below.

Enter -It is similar to the ‘return’ key of the typewriter and is used to execute a command or program.Spacebar -It is used to enter a space at the current cursor location.Backspace -This key is used to move the cursor one position to the left and also delete thecharacter in that position.Delete- It is used to delete the character at the cursor position.Insert -Insert key is used to toggle between insert and overwrite mode during data entry.Shift -This key is used to type capital letters when pressed along with an alphabet key. Also used to type

the special characters located on the upper-side of a key that has two characters defined on thesame key. Caps Lock-Cap Lock is used to toggle between the capital lock features. When ‘on’, it locks thealphanumeric keypad for capital letters input only.Tab- Tab is used to move the cursor to the next tab position defined in the document. Also,it is used toinsert indentation into a document.

Page 13: Notes on Computer

7/29/2019 Notes on Computer

http://slidepdf.com/reader/full/notes-on-computer 13/46

B.TECH-II SEM/FCP/THEORITICAL NOTES ON UNIT-I AND II BY PANKAJ CHAUDHARY Page 13

Ctrl-Control key is used in conjunction with other keys to provide additional functionality on thekeyboard.Alt-Also like the control key, Alt key is always used in combination with other keys to performspecific tasks.Esc-This key is usually used to negate a command. Also used to cancel or abort executing programs.

Numeric KeypadNumeric keypad is located on the right side of the keyboard and consists of keys havingnumbers (0 to 9) and mathematical operators (+ − * /) dened on them. This keypad is providedto support quick entry for numeric data.Cursor Movement KeysThese are arrow keys and are used to move the cursor in the direction indicated by the arrow (up, down,left, right).

(b) MouseThe mouse is a small device used to point to a particular place on the screen and select in orderto perform one or more actions. It can be used to select menu commands, size windows, start programsetc. The most conventional kind of mouse has two buttons on top: the left one being used mostfrequently.Mouse Actions

Left Click :Used to select an item.Double Click : Used to start a program or open a file.Right Click : Usually used to display a set of commands.Drag and Drop : It allows you to select and move an item from one location to another. To achieve thisplace the cursor over an item on the screen, click the leftmouse button and while holding the button down move the cursor to where you want toplace the item, and then release it.

(c) JoystickThe joystick is a vertical stick which moves the graphic cursor in a direction the stick is moved. Ittypically has a button on top that is used to select the option pointed by the cursor. Joystick is used asan input device primarily used with video games, training simulators and controlling robots

(d)ScannerScanner is an input device used for direct data entry from the source document into the computersystem. It converts the document image into digital form so that it can be fed into the computer.Capturing information like this reduces the possibility of errors typically experienced during largedata entry. Hand-held scanners are commonly seen in big stores to scan codes and price information foreach of the items. They are also termed the bar code readers.

Page 14: Notes on Computer

7/29/2019 Notes on Computer

http://slidepdf.com/reader/full/notes-on-computer 14/46

B.TECH-II SEM/FCP/THEORITICAL NOTES ON UNIT-I AND II BY PANKAJ CHAUDHARY Page 14

(e) Bar code Reader: A bar code is a set of lines of different thicknesses that represent anumber. Bar Code Readers are used to input data from bar codes. Most products in shops havebar codes on them. Bar code readers work by shining a beam of light on the lines that make up the barcode and detecting the amount of light that is reflected back

(f) Light Pen: It is a pen shaped device used to select objects on a display screen. It is quite like themouse (in its functionality) but uses a light pen to move the pointer and select any object on the screenby pointing to the object. Users of Computer Aided Design (CAD) applications commonly use thelight pens to directly draw on screen.

(g) Touch Screen: It allows the user to operate/make selections by simply touching the display screen.Common examples of touch screen include information kiosks, and bank ATMs.

(h)Digital camera: A digital camera can store many more pictures than an ordinary camera. Picturestaken using a digital camera are stored inside its memory and can be transferred to a computerby connecting the camera to it. A digital camera takes pictures by converting the light passingthrough the lens at the front into a digital image.

(i) The Speech Input DeviceThe “Microphones - Speech Recognition” is a speech Input device. To operate it we require using amicrophone to talk to the computer. Also we need to add a sound card to the computer. The Soundcard digitizes audio input into 0/1s .A speech recognition program can process the input andconvert it into machine-recognized commands or input.

Output Devices(a) MonitorMonitor is an output device that resembles the television screen and uses a Cathode Ray Tube (CRT) todisplay information. The monitor is associated with a keyboard for manual input of characters anddisplays the information as it is keyed in. It also displays the program or application output. Like thetelevision, monitors are also available in different sizes.

(b) Liquid Crystal Display (LCD)LCD was introduced in the 1970s and is now applied to display terminals also. Its advantages likelow energy consumption, smaller and lighter have paved its way for usage in portable computers(laptops).

(c) PrinterPrinters are used to produce paper (commonly known as hardcopy) output. Based on the technologyused, they can be classified as Impact or Non-impact printers. Impact printers use the typewritingprinting mechanism wherein a hammer strikes the paper through a ribbon in order to produce

Page 15: Notes on Computer

7/29/2019 Notes on Computer

http://slidepdf.com/reader/full/notes-on-computer 15/46

B.TECH-II SEM/FCP/THEORITICAL NOTES ON UNIT-I AND II BY PANKAJ CHAUDHARY Page 15

output. Dot-matrix and Character printers fall under this category. Non-impact printers do not touchthe paper while printing. They use chemical, heat or electrical signals to etch the symbols on paper.Inkjet, Deskjet, Laser, Thermal printers fall under this category of printers. When we talk about printerswe refer to two basic qualities associated with printers: resolution, and speed. Print resolution ismeasured in terms of number of dots per inch (dpi). Print speed is measured in terms of number of

characters printed in a unit of time and is represented as characters-per-second (cps), lines-per-minute (lpm), or pages-per-minute (ppm).

(d) PlotterPlotters are used to print graphical output on paper. It interprets computer commands andmakes line drawings on paper using multicolored automated pens. It is capable of producinggraphs, drawings, charts, maps etc. Computer Aided Engineering (CAE) applications like CAD(Computer Aided Design) and CAM (Computer Aided Manufacturing) are typical usage areas forplotters.

(e) Audio Output: Sound Cards and Speakers:The Audio output is the ability of the computer to output sound. Two components are needed:Sound card – Plays contents of digitized recordings, Speakers – Attached to sound card.

Question No(10):Define Software & Hardware? What is an instruction? What are registers ?

Answer: (10): Software:- Computer instructions or data, anything that can be stored electronically issoftware. Computer software or just software is a general term used to describe the role thatcomputer programs, procedures and documentation in a computer system.

Hardware - (computer science) the mechanical, magnetic, electronic, and electrical componentsmaking up a computer systemhardware. Hardware includes not only the computer proper but also thecables, connectors, power supply units, and peripheral devices such as the keyboard, mouse, audiospeakers, and printers.

Instruction: An instruction is a basiccommand. The term instruction is often used to describe themost rudimentaryprogramming commands. For example, a computer'sinstruction set is thelist of all the basic commands in the computer's machine language.

Register: A special, high-speed storage area within the CPU. All data must be represented in aregister before it can be processed. For example, if two numbers are to be multiplied, bothnumbers must be in registers, and the result is also placed in a register.

Question No:- (9): Give the categories of Software with example?

Page 16: Notes on Computer

7/29/2019 Notes on Computer

http://slidepdf.com/reader/full/notes-on-computer 16/46

B.TECH-II SEM/FCP/THEORITICAL NOTES ON UNIT-I AND II BY PANKAJ CHAUDHARY Page 16

Answer: SOFTWARE TYPES(A).Application Software :Application Software is a set of programs for a specific application. Application software is useful forword processing, accounting, and producing statistical report, Graphics, Excel and Data Base.Programming languages COBOL, FORTRAN, C++,VB, VC, Java

Types of Application SoftwareApplication software enables users to perform the activities and work that computers were designedfor. The specific type of application used depends on the intended purpose, and there are applicationprograms for almost every need.

(a) Individual application software refers to programs individuals use at work or at home. Examplesinclude word processing, spreadsheet, database management, and desktop publishing programs.(b) Collaboration software (also called groupware) enables people at separate PC workstations towork together on a single document or project, such as designing a new automobile engine.(c) Vertical application software is a complete package of programs that work together to perform corebusiness functions for a large organization. For example, a bank might have a mainframe computer atits corporate headquarters connected to conventional terminals in branch offices, where they areused by managers, tellers, loan officers, and other employees. All financial transactions are fed to thecentral computer for processing. The system then generates managers’ reports, account statements,and other essential documents.

Other Application Software Models

Shareware: Shareware is software developed by an individual or software publisher who retainsownership of the product and makes it available for a small “contribution” fee. The voluntary feenormally entitles users to receive online or written product documentation and technical help.

Freeware: Freeware is software that is provided free of charge to anyone wanting to use it. Hundredsof freeware programs are available, many written by college students and professors who createprograms as class projects or as part of their research.

Open Source Software: An open source software program is software whose programming code isowned by the original developer but made available free to the general public, who is encouraged toexperiment with the software, make improvements, and share the improvements with the usercommunity

Question No (10): What do you understand by the compiler? What are various phases of compiler?

Page 17: Notes on Computer

7/29/2019 Notes on Computer

http://slidepdf.com/reader/full/notes-on-computer 17/46

B.TECH-II SEM/FCP/THEORITICAL NOTES ON UNIT-I AND II BY PANKAJ CHAUDHARY Page 17

Answer: Compiler: A compiler is a computer program (or set of programs) that transforms sourcecode written in a programming language (the source language) into another computer language (thetarget language, often having a binary form known as object code).

Various Phases of Compiler: Following are various phases of Compiler:

A common division into phases is described below. In some compilers, the ordering of phases may differslightly, some phases may be combined or split into several phases or some extra phases may beinserted between those mentioned below.

Lexical analysis This is the initial part of reading and analysing the program text: The text is read anddivided into tokens, each of which corresponds to a symbol in the programming language, e.g., avariable name, keyword or number.

Syntax analysis This phase takes the list of tokens produced by the lexical analysis and arranges these ina tree-structure (called the syntax tree) that reects the structure of the program. This phase is oftencalled parsing.

Type checking This phase analyses the syntax tree to determine if the program violates certainconsistency requirements, e.g., if a variable is used but not declared or if it is used in a context that doesnot make sense given the type of the variable, such as trying to use a boolean value as a functionpointer.

Intermediate code generation The program is translated to a simple machine independent intermediatelanguage.

Register allocation The symbolic variable names used in the intermediate code are translated tonumbers, each of which corresponds to a register in the target machine code.

Machine code generation The intermediate language is translated to assembly language (a textualrepresentation of machine code) for a specic machine architecture.

Assembly and linking- The assembly-language code is translated into binary representation andaddresses of variables, functions, etc., are determined.

The rst three phases are collectively called the frontend of the compiler and the last three phases arecollectively called the backend. The middle part of the compiler is in this context only the intermediatecode generation, but this often includes various optimizations and transformations on the intermediatecode.

Each phase, through checking and transformation, establishes stronger invariants on the things it passeson to the next, so that writing each subsequent phase is easier than if these have to take all thepreceding into account. For example, the type checker can assume absence of syntax errors and thecode generation can assume absence of type errors. Assembly and linking are typically done byprograms supplied by the machine or operating system vendor,Question No (11): Explain working of Loader, Linker, Interpreter and Assembler?

Page 18: Notes on Computer

7/29/2019 Notes on Computer

http://slidepdf.com/reader/full/notes-on-computer 18/46

B.TECH-II SEM/FCP/THEORITICAL NOTES ON UNIT-I AND II BY PANKAJ CHAUDHARY Page 18

Answer: Loader: In a computer operating system, a loader is a component that locates a given program(which can be an application or, in some cases, part of the operating system itself) in offline storage(such as a hard disk), loads it into main storage (in a personal computer, it's called random accessmemory), and gives that program control of the computer (allows it to execute its instruction s).

A program that is loaded may itself contain components that are not initially loaded into main storage,but can be loaded if and when their logic is needed. In a multitasking operating system, a program thatis sometimes called a dispatcher juggles the computer processor's time among different tasks andcalls the loader when a program associated with a task is not already in main storage.

Linker: Also called link editor and binder, a linker is a program tha t combines object modules to forman executable program. Many programming languages allow you to write different pieces of code,called modules, separately. This simplifies the programming task because you can break a large programinto small, more manageable pieces. Eventually, though, you need to put all the modules together. Thisis the job of the linker. In addition to combining modules, a linker also replaces symbolic addresses withreal addresses. Therefore, you may need to link a program even if it contains only one module.The linkage editor accepts two major types of input:• Primary input, consisting of object decks and linkage editor control statements.• Additional user-specified input, which can contain both object decks and controlstatements, or load modules. This input is either specified by you as input, or is incorporatedautomatically by the linkage editor from a call library.

Output of the linkage editor is of two types:• A load module placed in a library (a partitioned data set) as a named member• Diagnostic output produced as a sequential data set.• The loader prepares the executable program in storage and passes control to it directly.

Interpreter: An interpreter normally means a computer program that executes, i.e. performs,instructions written in a programming language. An interpreter may be a program that either

• executes the source code directly• translates source code into some efficient intermediate representation (code) and

immediately executes this• explicitly executes stored precompiled code made by a compiler which is part of the

interpreter system

Assembler: An assembler translates an assembly language source program into machine codes.Though the assembly language is the symbolic representation of machine codes, a computercannot understand it. After translating the assembly language program into machine codes by theassembler, the program becomes ready for the execution.

Page 19: Notes on Computer

7/29/2019 Notes on Computer

http://slidepdf.com/reader/full/notes-on-computer 19/46

B.TECH-II SEM/FCP/THEORITICAL NOTES ON UNIT-I AND II BY PANKAJ CHAUDHARY Page 19

Question No (12): Explain in detail the steps involved in Software Development Process?Answer: Software development life cycle model is also called as waterfall model which is followed bymajority of systems.This software development life cycle process has the following seven stages in it namely1. System Requirements Analysis2. Feasibility study3. Systems Analysis and Design4. Code Generation5. Testing6. Maintenance7. Implementation

1. System Requirements Analysis:The first essential or vital thing required for any software development is system. Also the systemrequirement may vary based on the software product that is going to get developed. So a carefulanalysis has to be made about the system requirement needed for the development of the product.After the analysis and design of the system requirement phase the system required for the developmentwould be complete and the concentration can be on the software development process.

2. Feasibility study:After making an analysis in the system requirement the next step is to make analysis of thesoftware requirement. In other words feasibility study is also called as software requirement analysis.In this phase development team has to make communication with customers and make analysis of their requirement and analyze the system. By making analysis this way it would be possible tomake a report of identified area of problem. By making a detailed analysis on this area adetailed document or report is prepared in this phase which has details like project plan or schedule of the project, the cost estimated for developing and executing the system, target dates for each phase of delivery of system developed and so on. This phase is the base of software development processsince further steps taken in software development life cycle would be based on the analysismade on this phase and so careful analysis has to be made in this phase.

3. Systems Analysis and Design:This is an important phase in system development .Here analysis is made on the design of the systemthat is going to be developed. In other words database design, the design of the architecture chosen,functional specification design, low level design documents, high level design documents and so ontakes place. Care must be taken to prepare these design documents because the next phasesnamely the development phase is based on these design documents. If a well structured and analyzeddesign document is prepared it would reduce the time taken in the coming steps namelydevelopment and testing phases of the software development life cycle.

Page 20: Notes on Computer

7/29/2019 Notes on Computer

http://slidepdf.com/reader/full/notes-on-computer 20/46

B.TECH-II SEM/FCP/THEORITICAL NOTES ON UNIT-I AND II BY PANKAJ CHAUDHARY Page 20

4. Code Generation:This is the phase where actual development of the system takes place. That is based on the designdocuments prepared in the earlier phase code is written in the programming technology chosen. After

the code is developed generation of code also takes place in this phase. In other words the code isconverted into executables in this phase after code generation.

5. Testing:A software or system which is not tested would be of poor quality. This is because this is thephase where system developed would be tested and reports are prepared about bugs or errors insystem. To do this testing phase there are different levels and methods of testing like unit testing,system test and so on. Based on the need the testing methods are chosen and reports are preparedabout bugs. After this process the system again goes to development phase for correction of errors andagain tested. This process continues until the system is found to be error free. To ease the testingprocess debuggers or testing tools are also available.

To develop reliable and good quality Program/Software we need to follow thefollowing 5 steps :1. Requirement Specification.2. Analysis.3. Design.4. Implementation.5. Verification and testing.

Question No (13): Explain the steps involved in developing a program? (or) Brief about planning the computer program?

Answer: The Programming Process – Purpose 1. Understand the problem

• Read the problem statement• Question users• Inputs required• Outputs required

• Special formulas• Talk to users

2. Plan the logic(a) Visual Design Tools

• Input record chart

Page 21: Notes on Computer

7/29/2019 Notes on Computer

http://slidepdf.com/reader/full/notes-on-computer 21/46

B.TECH-II SEM/FCP/THEORITICAL NOTES ON UNIT-I AND II BY PANKAJ CHAUDHARY Page 21

• Printer spacing chart• Hierarchy chart• Flowchart

(b) Verbal Design Tools• Narrative Description• Pseudocode

3. Code the program• Select an appropriate programming language• Convert flowchart and/or Pseudocode instructions into programming language statements

4. Test the program1. Syntax errors2. Runtime errors3. Logic errors4. Test Data Set

5. Implement the program• Buy hardware• Publish software• Train users

6. Maintain the program• Maintenance programmers

• Legacy systems• Up to 85% of IT department budget

Question No (14): Explain flowchart in detail?Answer: A flowchart is a schematic representation of an algorithm or a stepwise process, showing thesteps as boxes of various kinds, and their order by connecting these with arrows. Flowcharts are used indesigning or documenting a process or program.

A flow chart, or flow diagram, is a graphical representation of a process or system that details thesequencing of steps required to create output. A flowchart is a picture of the separate steps of a process

in sequential order.

The benefits of flowcharts are as follows:a. Communication: Flowcharts are better way of communicating the logic of a system to all concerned.b. Effective analysis: With the help of flowchart, problem can be analyzed in more effective way.

Page 22: Notes on Computer

7/29/2019 Notes on Computer

http://slidepdf.com/reader/full/notes-on-computer 22/46

B.TECH-II SEM/FCP/THEORITICAL NOTES ON UNIT-I AND II BY PANKAJ CHAUDHARY Page 22

c. Proper documentation: Program flowcharts serve as a good program documentation, which isneeded for various purposes.d. Efficient Coding: The flowcharts act as a guide or blueprint during the systems analysis and programdevelopment phase.e. Proper Debugging: The flowchart helps in debugging process.

f. Efficient Program Maintenance: The maintenance of operating program becomes easy with the helpof flowchart. It helps the programmer to put efforts more efficiently on that part.

Advantages• Logic Flowcharts are easy to understand. They provide a graphical representation of actions to betaken.• Logic Flowcharts are well suited for representing logic where there is intermingling among manyactions.

Disadvantages• Logic Flowcharts may encourage the use of GoTo statements leading to software design that isunstructured with logic that is difficult to decipher.• Without an automated tool, it is time-consuming to maintain Logic Flowcharts.• Logic Flowcharts may be used during detailed logic design to specify a module.• However, the presence of decision boxes may encourage the use of GoTo statements, resulting insoftware that is not structured. For this reason, Logic Flowcharts may be better used during StructuralDesign.

LIMITATIONS OF USING FLOWCHARTSComplex logic: Sometimes, the program logic is quite complicated. In that case, flowchart becomescomplex and clumsy.

Alterations and Modifications:If alterations are required the flowchart may require re-drawingcompletely.Reproduction:As the flowchart symbols cannot be typed, reproduction of flowchart becomes aproblem.The essentials of what is done can easily be lost in the technical details of how it is done.

GUIDELINES FOR DRAWING A FLOWCHARTa. In drawing a proper flowchart, all necessary requirements should be listed out in logical order.b. The flowchart should be clear, neat and easy to follow. There should not be any room for ambiguity inunderstanding the flowchart.c. The usual direction of the flow of a procedure or system is from left to right or top tobottom.d. Only one flow line should come out from a process symbol.

Page 23: Notes on Computer

7/29/2019 Notes on Computer

http://slidepdf.com/reader/full/notes-on-computer 23/46

B.TECH-II SEM/FCP/THEORITICAL NOTES ON UNIT-I AND II BY PANKAJ CHAUDHARY Page 23

e. Only one flow line should enter a decision symbol, but two or three flow lines, one foreach possible answer, should leave the decision symbol.f. Only one flow line is used in conjunction with terminal symbol.g. Write within standard symbols briefly. As necessary, you can use the annotation symbol todescribe data or computational steps more clearly.

h. If the flowchart becomes complex, it is better to use connector symbols to reduce thenumber of flow lines. Avoid the intersection of flow lines if you want to make it moreeffective and better way of communication.i. Ensure that the flowchart has a logical start and finish. j. It is useful to test the validity of the flowchart by passing through it with a simple test data.

Question No (15): Describe in detail about algorithm? Give exampleAnswer: An algorithm is a description of a procedure which terminates with a result. Simple algorithmscan be implemented within a function.

Properties of an algorithm• No ambiguity• There should not be any uncertainty about which instruction to execute next.• The algorithm should conclude after a finite number of steps.• The algorithm should be general.

Example:• Biggest among two numbers• Addition of N numbers• Finding Factorial of a number• Finding Fibonacci series.

Guidelines• Statements should be in simple English• Must produce a solution for the specified problem• It should be concise• Each instruction should be written in separate line and express one action.• Capitalize keywords such as READ, PRINT and so on.• Instruction should be written from top to bottom, with one entry and one exit.• Should allow easy transition from design to coding in programming language.

Benefits:• Language Independent.• Easy to develop a program from pseudo code than flowchart.• Easy to translate into programming language.

Page 24: Notes on Computer

7/29/2019 Notes on Computer

http://slidepdf.com/reader/full/notes-on-computer 24/46

B.TECH-II SEM/FCP/THEORITICAL NOTES ON UNIT-I AND II BY PANKAJ CHAUDHARY Page 24

• It is compact.

Limitations:• No visual representation of program logic• No accepted standards for writing pseudo codes.

• Cannot be compiled or executed.• No real form or syntax rules.Examples:• Finding a number is prime or notQuestion No(16): Define Operating System? What are functions and typesof operating System? Answer: OPERATING SYSTEM: Operating System is a software that can be defined as:

• An interface between users and hardware - an environment "architecture”• Allows convenient usage; hides the tedious stuff • Allows efficient usage; parallel activity, avoids wasted cycles• Provides information protection• Gives each user a slice of the resources• Acts as a control program.

Functions of operating System: • An operting system manages hardware, runs applications, provides an interface for users, and

stores, retrieves, and manipulates files.• It manages the hardware and software resources of the system.

• It provides a stable, consistent way for applications to deal with the hardware without having toknow all the details of the hardware.

• System tool (programs) used to monitor computer performance,debug,problems, or maintainparts of the system.

• A set of libraries or functions which may use to perform specific tasks especially relating tointerfacing with computer system components.

• It avoids the situation of deadlock.• It is responsible for resource and performance optimization.• It manages process management and memory management

Page 25: Notes on Computer

7/29/2019 Notes on Computer

http://slidepdf.com/reader/full/notes-on-computer 25/46

B.TECH-II SEM/FCP/THEORITICAL NOTES ON UNIT-I AND II BY PANKAJ CHAUDHARY Page 25

Page 26: Notes on Computer

7/29/2019 Notes on Computer

http://slidepdf.com/reader/full/notes-on-computer 26/46

B.TECH-II SEM/FCP/THEORITICAL NOTES ON UNIT-I AND II BY PANKAJ CHAUDHARY Page 26

Page 27: Notes on Computer

7/29/2019 Notes on Computer

http://slidepdf.com/reader/full/notes-on-computer 27/46

B.TECH-II SEM/FCP/THEORITICAL NOTES ON UNIT-I AND II BY PANKAJ CHAUDHARY Page 27

Question No(17): What are various Internal and External DOS Commands?Answer: Internal Commands: The internal commands reside in COMMAND.COM, which loads intomemory when the computer system is started; these commands do not reside on disk. e.g.

(a) TIME-Displays current time and allows it to be changed.Syntax: TIME

(b)

DATE- Displays current date and allows it to be changed.Syntax: DATE

(c) CLS- Clears the screen.Syntax: CLS

Page 28: Notes on Computer

7/29/2019 Notes on Computer

http://slidepdf.com/reader/full/notes-on-computer 28/46

B.TECH-II SEM/FCP/THEORITICAL NOTES ON UNIT-I AND II BY PANKAJ CHAUDHARY Page 28

(d) DIR-Shows directory information of a diskette: name, size, and the date and time stamp of files.

Syntax: DIR [d:][path]Optional switches:/p Display dir info and pauses display when the screen is full/w Display names and extensions only in five columns

To display a file directory listing for D:\LET\ANNUALD:\LET\ANNUAL>DIR (from D:\LET\ANNUAL)D:\DATA>DIR \LET\ANNUAL (from D:\DATA)C:\WINDOWS>DIR D:\LET\ANNUAL (from C:\WINDOWS)

(e) COPY- Copies a file. Name of copy may be the same as original, or different.Syntax: COPY [d:][path][name.ext] [d:][path][name.ext]

Optional switches:/v Verify, copies the file and compares it with the original/b Binary file

To copy a file from D:\BATCH to the root of A: driveA:\>COPY D:\BATCH\CL.BAT (from A: drive)D:\BATCH>COPY CL.BAT A:\ (from D:\BATCH)

To copy a file from the root of C: to A: drive and change its nameA:\>COPY C:\MSDOS.SYS MSDOSSYS.BAK (from A:)C:\>COPY MSDOS.SYS A:\MSDOSSYS.BAK (from the root of C:)

To copy all of the files from the root of A: to D:\CCV\ENGCOMP

A:\>COPY *.* D:\CCV\ENGCOMP (from A:)D:\CCV\ENGCOMP>COPY *.* A:\ (from D:\CCV\ENGCOMP)

(f) TYPE-Displays the contents of a file.Syntax: TYPE [d:][path][name.ext]To display the contents of the file MY.LET to the screenA:\>TYPE MY.LET

(g) DEL-Deletes a file from disk.Syntax: DEL [d:][path][name.ext]To delete one file:

A:\>DEL A:\MY.LETTo del all files in current directoryA:\>DEL *.*

(h) REN- Renames a file.Syntax: REN [d:][path][name.ext] [d:][path][newname.ext]

To change the name of the file D:\LET\ANNUAL\99.DOC to 1999.DOC

Page 29: Notes on Computer

7/29/2019 Notes on Computer

http://slidepdf.com/reader/full/notes-on-computer 29/46

B.TECH-II SEM/FCP/THEORITICAL NOTES ON UNIT-I AND II BY PANKAJ CHAUDHARY Page 29

D:\LET>REN ANNUAL\99.DOC 1999.DOC (from D:\LET)D:\DATA>REN \LET\ANNUAL\99.DOC 1999.DOC (from D:\DATA)C:\WINDOWS>REN D:\LET\ANNUAL\99.DOC 1999.DOC (from C:\WINDOWS)

(i) MD- Makes (creates) a new directory.Syntax: MD [d:][path][dirname]To create a directory named HERMIT in the root of D: driveD:\>MD HERMIT (from D:\)C:\>MD D:\HERMIT (from C:\)

(j) RD- Removes an existing directory (directory must be empty).Syntax: RD [d:][path][dirname]To remove the HERMIT sub-directoryD:\>RD HERMIT (from D:\)C:\>RD D:\HERMIT (from C:\)

(k) CD-Changes the current directory.

Syntax: CD [path][dirname]To make D:\HERMIT the current directoryD:\>CD HERMIT (from D:\)D:\DATA>CD \HERMIT (from D:\DATA)D:\DATA\SOURCE>CD \HERMIT (from D:\DATA\SOURCE)D:\DATA\SOURCE>CD .. (from D:\DATA\SOURCE)

(l) PATH-The PATH command is used to help the command interpreter find external commandswhich are not in the current directory. The command interpretter looks into the DOSenvironment for "PATH=" and then searches the paths (each separated from the next by asemicolon) that follow.

Syntax: PATH=[path;path;...]To set the DOS PATH:PATH=C:\DOS;C:\PCW;\C:\BIN

To display the current path:PATH

(m) SET PROMPT-Used to specify the appearance of the DOS prompt.Syntax: SET PROMPT= (from the command line)PROMPT= (in a batch file)

To display current drive & current path followed by ">" as promptSET PROMPT=$P$G

To display the current date, time, and drive on separate linesSET PROMPT $D$_$T$_$N$G

To redefine F9 to CD\Windows\Start Menu\Programs\StartupSET PROMPT $e[0,67;"'CD\Windows\Start Menu\Programs\Startup'";13p

Page 30: Notes on Computer

7/29/2019 Notes on Computer

http://slidepdf.com/reader/full/notes-on-computer 30/46

B.TECH-II SEM/FCP/THEORITICAL NOTES ON UNIT-I AND II BY PANKAJ CHAUDHARY Page 30

External Commands:- The external commands are files that do reside on disk and have an extension of .COM, .EXE, or .BAT. Both command types are executed from the MS-DOS prompt. Instructions forexternal commands are disk-based. This means the file with the name of the command must be loadedinto RAM at the moment when the command is given. Application programs are external commandsand some DOS programs are external. The syntax for some of the more useful DOS external commands,

including their parameters and switches follow:

(a) FORMAT -Prepares a diskette for use by DOS.Syntax: FORMAT [d:]Parameters: [d:] = Drive which is to receive the format.Optional switches:

• /s Include all system files necessary to make disk "bootable"• /b Reserve space for system files on diskette. (Formats 320k instead of 360k).• /v Volume label of 11 characters

Some examples:

• To format a diskette in drive B: without system files: FORMAT B:• To format a diskette in drive A: with system files: FORMAT A: /s• To give the formatted diskette a volume name, include the /v switch: FORMAT A: /V

• Combine switches to format a boot diskette with a volume label:FORMAT A: /S /V

(b) CHKDSK-Analyzes disk or diskette (first and only parameter) and displays disk and memorystatus report.Syntax: CHKDSK [d:] [/f] [/v]Parameters: [d:] = Drive upon which to perform the checkdisk.

Optional switches:

• /f Fix. Writes lost clusters to a disk file and corrects file allocation table.• /v Verbose. Lists all files on a disk.

Example:

• To display statistics about the diskette in drive A: CHKSDK A:• To display statistics about the first hard disk and fix any lost clusters: CHKSDK A: /f

(c) DISKCOPY-Makes an exact copy of a diskette, including hidden system files if they are present.

Syntax: DISKCOPY [d1:] [d2:]Parameters:[d1:] = Drive for source diskette, [d2:] = Drive for target diskette.

Example: To make an exact copy of a diskette in drive A: to a diskette in B:DISKCOPY A: B:

• To make an exact copy of a diskette using only drive A: DISKCOPY A: A:

Page 31: Notes on Computer

7/29/2019 Notes on Computer

http://slidepdf.com/reader/full/notes-on-computer 31/46

B.TECH-II SEM/FCP/THEORITICAL NOTES ON UNIT-I AND II BY PANKAJ CHAUDHARY Page 31

DISKCOPY asks for a SOURCE diskette (the diskette being copied) and a TARGET diskette (the diskettebeing copied to). The TARGET diskette need not be formatted, DOS will format it while doing theDISKCOPY. If the SOURCE diskette is bootable, the system will be transferred to the TARGET as well. Thetwo disk drives must always use the same media.

Question No:(19): Explain Architecture of Unix? What are various Unix Commands?

Answer:- UNIXS is named after UNICS (UNiplexed Information and Computing Service). Its architecturecan be shown as below:

(1)UNIX Shell- Shell is an ordinary user program – needs the ability to read from and write to theterminal, and execute other programs, Commands may take arguments, which are passed to thecalled program as character strings

Page 32: Notes on Computer

7/29/2019 Notes on Computer

http://slidepdf.com/reader/full/notes-on-computer 32/46

B.TECH-II SEM/FCP/THEORITICAL NOTES ON UNIT-I AND II BY PANKAJ CHAUDHARY Page 32

Shell does not have to open terminal, but it has access automatically to a file ‘standard input’(for reading), file ‘standard output’ (for writing normal output), and file ‘standard error’ (forwriting error messages)

Shell can redirect standard input/output to files It can also use Pipe symbol

Example: grep ter *.t | sort >out Possible pipeline – sequence of pipe symbols

Single user can run several programs at once Shell syntax for running a program in the background – use & Example: wc –l <a >b &

Shell scripts refers to the files containing shell command

UNIX Utility Programs - refers to standard application available with UNIX.

Large number of utility programs Divided into six categories

File and directory manipulation commands Example: cp a b | ls *.*

Filters Example: grep (extracts lines containing patterns), cut, paste,

Program development tools such as editors/compilers Example: cc (C compiler), make (maintain large programs whose source code

consists of multiple files) Text processing

Example: vi System administration

Example: mount (mount file system)

Miscellaneous Example: kill 1325 (kill a process), chmod (change privileges of a file)

Page 33: Notes on Computer

7/29/2019 Notes on Computer

http://slidepdf.com/reader/full/notes-on-computer 33/46

B.TECH-II SEM/FCP/THEORITICAL NOTES ON UNIT-I AND II BY PANKAJ CHAUDHARY Page 33

UNIX Kernel- is the heart of the operating system with following structure:

All UNIX drivers are classified as either character device drivers (mouse, keyboard) or blockdevice drivers (disk)

Network device drivers (possible character devices, but handled very differently) Process dispatching – when interrupt happens, context switch happens between processes Editors such as vi/emacs need raw tty Shell is line oriented, hence uses cooked mode and line disciplines

Page 34: Notes on Computer

7/29/2019 Notes on Computer

http://slidepdf.com/reader/full/notes-on-computer 34/46

B.TECH-II SEM/FCP/THEORITICAL NOTES ON UNIT-I AND II BY PANKAJ CHAUDHARY Page 34

Networking software is layered with MAC/Routing/Transport layers and Socket interface On top of buffer cache sits file system

Most UNIX systems support multiple file systems Berkeley fast file system Log-structured file system

Various System V file systems On top of file system comes file naming, directory management, hard link and symbolic link

management, etc On top page cache sits virtual memory (VM)

All paging logic is here, such as replacement algorithm On top of VM is mapping files onto VM and high level page fault management code

Figure out what to do when a page fault occurs On top of process dispatching is process management

Process scheduler to choose which process to run next If threads are managed in the kernel, thread management is also here

Note in some UNIX systems, threads are managed in user space On top of scheduling we have signal processing and process creation and termination

Top layer has the system call interface All system calls are directed to one of the lower modules, depending on the nature of

the call Top layer also has entrance to interrupts and traps Entrance to signals, page faults,

processor exceptions of all kinds, I/O interruptsVarious Commands Of Unix:-

Directories: File and directory paths in UNIX use the forward slash "/"to separate directory names in a path.examples:/ "root" directory/usr directory usr (sub-directory of / "root" directory)/usr/STRIM100 STRIM100 is a subdirectory of /usr

Moving around the file system:

• pwd Show the "present working directory", or current directory.• cd Change current directory to your HOME directory.• cd .. Change current directory to the parent directory of the current directory.•

cd $STRMWORK: Change current directory to the directory defined by the environment variable'STRMWORK'.• cd ~bob:Change the current directory to the user bob's home directory (if you have permission).

Listing directory contents:

ls list a directory

Page 35: Notes on Computer

7/29/2019 Notes on Computer

http://slidepdf.com/reader/full/notes-on-computer 35/46

B.TECH-II SEM/FCP/THEORITICAL NOTES ON UNIT-I AND II BY PANKAJ CHAUDHARY Page 35

ls -l list a directory in long ( detailed ) format

for example:$ ls -ldrwxr-xr-x 4 cliff user 1024 Jun 18 09:40 WAITRON_EARNINGS-rw-r--r-- 1 cliff user 767392 Jun 6 14:28 scanlib.tar.gz^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^| | | | | | | | | | || | | | | owner group size date time name| | | | number of links to file or directory contents| | | permissions for world| | permissions for members of group| permissions for owner of file: r = read, w = write, x = execute -=no permissiontype of file: - = normal file, d=directory, l = symbolic link, and others...

ls -a List the current directory including hidden files. Hidden files startwith "."

ls -ld * List all the file and directory names in the current directory using long format. Without the "d"option, ls would list the contents of any sub-directory of the current. With the "d" option, ls just lists them like regular files.

Changing file permissions and attributes

chmod 755 file Changes the permissions of file to be rwx for the owner, and rx for the group and theworld. (7 = rwx = 111 binary. 5 = r-x = 101 binary)chgrp user file Makes file belong to the group user.chown cliff file Makes cliff the owner of file.

chown -R cliff dir Makes cliff the owner of dir and everything in its directory tree.

You must be the owner of the file/directory or be root before you can do any of these things.

Moving, renaming, and copying files:

cp file1 file2 copy a filemv file1 newname move or rename a filemv file1 ~/AAA/ move file1 into sub-directory AAA in your home directory.rm file1 [file2 ...] remove or delete a filerm -r dir1 [dir2...] recursively remove a directory and its contents BE CAREFUL!mkdir dir1 [dir2...] create directoriesmkdir -p dirpath create the directory dirpath, including all implied directories in the path.rmdir dir1 [dir2...] remove an empty directory

Viewing and editing files:

Page 36: Notes on Computer

7/29/2019 Notes on Computer

http://slidepdf.com/reader/full/notes-on-computer 36/46

B.TECH-II SEM/FCP/THEORITICAL NOTES ON UNIT-I AND II BY PANKAJ CHAUDHARY Page 36

cat filename Dump a file to the screen in ascii.more filename Progressively dump a file to the screen: ENTER = one line down

SPACEBAR = page down q=quitless filename Like more, but you can use Page-Up too. Not on all systems.vi filename Edit a file using the vi editor. All UNIX systems will havehead filename Show the first few lines of a file.head -n filename Show the first n lines of a file.tail filename Show the last few lines of a file.tail -n filename Show the last n lines of a file.

Shells : The behavior of the command line interface will differ slightly depending on the shell programthat is being used.Depending on the shell used, some extra behaviors can be quite nifty.You can find outwhat shell you are using by the command:

echo $SHELL

Of course you can create a file with a list of shell commands and execute it like a program to perform atask. This is called a shell script. This is in fact the primary purpose of most shells, not the interactivecommand line behavior.

Environment variables You can teach your shell to remember things for later using environment variables.For example underthe bash shell:

export CASROOT=/usr/local/CAS3.0 Defines the variable CASROOT with the value/usr/local/CAS3.0.

export LD_LIBRARY_PATH=$CASROOT/Linux/lib Defines the variable LD_LIBRARY_PATH with thevalue of CASROOT with /Linux/lib appended, or /usr/local/CAS3.0/Linux/lib

By prefixing $ to the variable name, you can evaluate it in any command:

cd $CASROOT Changes your present working directory to the value of CASROOT

echo $CASROOT Prints out the value of CASROOT, or /usr/local/CAS3.0printenv CASROOT Does the same thing in bash and some other shells.

Interactive History: A feature of bash and tcsh (and sometimes others) you can use the up-arrow keys toaccess your previous commands, editthem, and re-execute them.

Redirection:

Page 37: Notes on Computer

7/29/2019 Notes on Computer

http://slidepdf.com/reader/full/notes-on-computer 37/46

B.TECH-II SEM/FCP/THEORITICAL NOTES ON UNIT-I AND II BY PANKAJ CHAUDHARY Page 37

grep string filename > newfile Redirects the output of the above grepcommand to a file 'newfile'.

grep string filename >> existfile Appends the output of the grep command to the end of 'existfile'.

The redirection directives, > and >> can be used on the output of most commands to direct their outputto a file.

Pipes: The pipe symbol "|" is used to direct the output of one command to the inputof another.

For example:

ls -l | more This commands takes the output of the long format directory list command"ls -l" and pipes it through the more command (also known as a filter).In this case a very long list of files can be viewed a page at a time.

du -sc * | sort -n | tailThe command "du -sc" lists the sizes of all files and directories in thecurrent working directory. That is piped through "sort -n" which orders theoutput from smallest to largest size. Finally, that output is piped through "tail"which displays only the last few (which just happen to be the largest) results.

Command Substitution You can use the output of one command as an input to another command in another way calledcommand substitution. Command substitution is invoked when by enclosing the substituted commandin backwards single quotes. For example:

cat `find . -name aaa.txt`

which will cat ( dump to the screen ) all the files named aaa.txt that exist in the current directory or inany subdirectory tree.

Searching for strings in files: The grep command grep string filename prints all the lines in a file that contain the string

Searching for files : The find command find search_path -name filename

find . -name aaa.txt Finds all the files named aaa.txt in the current directory orany subdirectory tree.

find / -name vimrc Find all the files named 'vimrc' anywhere on the system.find /usr/local/games -name "*xpilot*"

Find all files whose names contain the string 'xpilot' whichexist within the '/usr/local/games' directory tree.

Page 38: Notes on Computer

7/29/2019 Notes on Computer

http://slidepdf.com/reader/full/notes-on-computer 38/46

B.TECH-II SEM/FCP/THEORITICAL NOTES ON UNIT-I AND II BY PANKAJ CHAUDHARY Page 38

Reading and writing tapes, backups, and archives: The tar commandThe tar command stands for "tape archive". It is the "standard" way to readand write archives (collections of files and whole directory trees).

Often you will find archives of stuff with names like stuff.tar, or stuff.tar.gz. Thisis stuff in a tar archive, and stuff in a tar archive which has been compressed using thegzip compression program respectivly.

Chances are that if someone gives you a tape written on a UNIX system, it will be in tar format,and you will use tar (and your tape drive) to read it.

Likewise, if you want to write a tape to give to someone else, you should probably usetar as well.

Tar examples:

tar xv Extracts (x) files from the default tape drive while listing (v = verbose)the file names to the screen.

tar tv Lists the files from the default tape device without extracting them.tar cv file1 file2

Write files 'file1' and 'file2' to the default tape device.tar cvf archive.tar file1 [file2...]

Create a tar archive as a file "archive.tar" containing file1,file2...etc.

tar xvf archive.tar extract from the archive filetar cvfz archive.tar.gz dname

Create a gzip compressed tar archive containing everything in the directory

'dname'. This does not work with all versions of tar.tar xvfz archive.tar.gzExtract a gzip compressed tar archive. Does not work with all versions of tar.

tar cvfI archive.tar.bz2 dnameCreate a bz2 compressed tar archive. Does not work with all versions of tar

File compression: compress , gzip , and bzip2 The standard UNIX compression commands are compress and uncompress. Compressed files havea suffix .Z added to their name. For example:

compress part.igs Creates a compressed file part.igs.Z

uncompress part.igs Uncompresseis part.igs from the compressed file part.igs.Z. Note the .Zis not required.

Another common compression utility is gzip (and gunzip). These are the GNU compress anduncompress utilities. gzip usually gives better compression than standard compress,

Page 39: Notes on Computer

7/29/2019 Notes on Computer

http://slidepdf.com/reader/full/notes-on-computer 39/46

B.TECH-II SEM/FCP/THEORITICAL NOTES ON UNIT-I AND II BY PANKAJ CHAUDHARY Page 39

but may not be installed on all systems. The suffix for gzipped files is .gz

gzip part.igs Creates a compressed file part.igs.gzgunzip part.igs Extracts the original file from part.igs.gz

The bzip2 utility has (in general) even better compression than gzip, but at the cost of longertimes to compress and uncompress the files. It is not as common a utility as gzip, but isbecoming more generally available.

bzip2 part.igs Create a compressed Iges file part.igs.bz2bunzip2 part.igs.bz2 Uncompress the compressed iges file.

Looking for help: The man and apropos commands Most of the commands have a manual page which give sometimes useful, often more or less detailed,sometimes cryptic and unfathomable discriptions of their usage. Some say they

are called man pages because they are only for real men.

Example:man ls Shows the manual page for the ls command

You can search through the man pages using apropos

Example:

apropos build Shows a list of all the man pages whose discriptions contain the word "build"

Do a man apropos for detailed help on apropos.

Basics of the vi editor

Opening a filevi filename

Creating textEdit modes: These keys enter editing modes and type in the textof your document.

i Insert before current cursor positionI Insert at beginning of current linea Insert (append) after current cursor position

Page 40: Notes on Computer

7/29/2019 Notes on Computer

http://slidepdf.com/reader/full/notes-on-computer 40/46

B.TECH-II SEM/FCP/THEORITICAL NOTES ON UNIT-I AND II BY PANKAJ CHAUDHARY Page 40

A Append to end of liner Replace 1 characterR Replace mode<ESC> Terminate insertion or overwrite mode

Deletion of text

x Delete single characterdd Delete current line and put in bufferndd Delete n lines (n is a number) and put them in bufferJ Attaches the next line to the end of the current line (deletes carriage return).

Oops

u Undo last command

cut and paste

yy Yank current line into buffernyy Yank n lines into bufferp Put the contents of the buffer after the current lineP Put the contents of the buffer before the current line

cursor positioning^d Page down^u Page up:n Position cursor at line n:$ Position cursor at end of file^g Display current line number

h,j,k,l Left,Down,Up, and Right respectivly. Your arrow keys should also work if if your keyboard mappings are anywhere near sane.

string substitution

:n1,n2:s/string1/string2/[g] Substitute string2 for string1 on linesn1 to n2. If g is included (meaning global),all instances of string1 on each lineare substituted. If g is not included,only the first instance per matching line issubstituted.

^ matches start of line. matches any single character$ matches end of line

These and other "special characters" (like the forward slash) can be "escaped" with \i.e to match the string "/usr/STRIM100/SOFT" say "\/usr\/STRIM100\/SOFT"

Page 41: Notes on Computer

7/29/2019 Notes on Computer

http://slidepdf.com/reader/full/notes-on-computer 41/46

B.TECH-II SEM/FCP/THEORITICAL NOTES ON UNIT-I AND II BY PANKAJ CHAUDHARY Page 41

Examples:

:1,$:s/dog/cat/g Substitute 'cat' for 'dog', every instancefor the entire file - lines 1 to $ (end of file)

:23,25:/frog/bird/ Substitute 'bird' for 'frog' on lines23 through 25. Only the first instanceon each line is substituted.

Saving and quitting and other "ex" commands

These commands are all prefixed by pressing colon (:) and then entered in the lowerleft corner of the window. They are called "ex" commands because they are commandsof the ex text editor - the precursor line editor to the screen editorvi. You cannot enter an "ex" command when you are in an edit mode (typing text onto the screen)

Press <ESC> to exit from an editing mode.

:w Write the current file.:w new.file Write the file to the name 'new.file'.:w! existing.file Overwrite an existing file with the file currently being edited.:wq Write the file and quit.:q Quit.:q! Quit with no changes.

:e filename Open the file 'filename' for editing.

:set number Turns on line numbering:set nonumber Turns off line numbering

Question No:(20) What are the characteristics of structure programming? Answer:-Structured programming (sometimes known as modular programming ) is a subset of procedural programming that enforces a logical structure on the program being written to make it moreefficient and easier to understand and modify.

Certain languages such as Ada, Pascal, and dBASE are designed with features that encourage or enforcea logical program structure.

Structured programming frequently employs a top-down design model , in which developers map outthe overall program structure into separate subsections. A defined function or set of similar functions iscoded in a separate module or submodule, which means that code can be loaded into memory

more efficiently and that modules can be reused in other programs. After a module has been testedindividually, it is then integrated with other modules into the overall program structure.

Page 42: Notes on Computer

7/29/2019 Notes on Computer

http://slidepdf.com/reader/full/notes-on-computer 42/46

B.TECH-II SEM/FCP/THEORITICAL NOTES ON UNIT-I AND II BY PANKAJ CHAUDHARY Page 42

Program flow follows a simple hierarchical model that employs looping constructs such as "for,""repeat," and "while." Use of the "Go To" statement is discouraged.

Structured programming was first suggested by Corrado Bohm and Guiseppe Jacopini. The twomathematicians demonstrated that any computer program can be written with just three structures:decisions, sequences, and loops.

Question No:(21) What is Top-Down and bottom up approach of programming?Answer:-Top-down and bottom-up are strategies of information processing and knowledge ordering,mostly involving software, but also other humanistic and scientific theories. In practice, they can be seenas a style of thinking and teaching. In many cases top-down is used as a synonym of analysis ordecomposition , and bottom-up of synthesis .

A top-down approach (also known as stepwise design) is essentially the breaking down of a system togain insight into its compositional sub-systems. In a top-down approach an overview of the system isformulated, specifying but not detailing any first-level subsystems. Each subsystem is then refined in yet

greater detail, sometimes in many additional subsystem levels, until the entire specification is reducedto base elements. A top-down model is often specified with the assistance of "black boxes", these makeit easier to manipulate. However, black boxes may fail to elucidate elementary mechanisms or bedetailed enough to realistically validate the model.

A bottom-up approach is the piecing together of systems to give rise to grander systems, thus makingthe original systems sub-systems of the emergent system. Bottom-up processing is a type of informationprocessing based on incoming data from the environment to form a perception. Information enters theeyes in one direction (input), and is then turned into an image by the brain that can be interpreted andrecognized as a perception (output). In a bottom-up approach the individual base elements of thesystem are first specified in great detail. These elements are then linked together to form larger

subsystems, which then in turn are linked, sometimes in many levels, until a complete top-level systemis formed. This strategy often resembles a "seed" model, whereby the beginnings are small buteventually grow in complexity and completeness. However, "organic strategies" may result in a tangle of elements and subsystems, developed in isolation and subject to local optimization as opposed tomeeting a global purpose.

Question No:(22) What is IEEE- floating point notation?

Answer:-The IEEE standard for floating point arithmetic: The IEEE (Institute of Electrical and ElectronicsEngineers) has produced a standard for floating point arithmetic. This standard specifies how singleprecision (32 bit) and double precision (64 bit) floating point numbers are to be represented, as well as

how arithmetic should be carried out on them.

The differences in the formats also affect the accuracy of floating point computations.

Page 43: Notes on Computer

7/29/2019 Notes on Computer

http://slidepdf.com/reader/full/notes-on-computer 43/46

B.TECH-II SEM/FCP/THEORITICAL NOTES ON UNIT-I AND II BY PANKAJ CHAUDHARY Page 43

Summary:

Single Precision:

The IEEE single precision floating point standard representation requires a 32 bit word, which may be

represented as numbered from 0 to 31, left to right. The first bit is the sign bit, S, the next eight bits arethe exponent bits, 'E', and the final 23 bits are the fraction 'F':

S EEEEEEEE FFFFFFFFFFFFFFFFFFFFFFF0 1 8 9 31

The value V represented by the word may be determined as follows:

• If E=255 and F is nonzero, then V=NaN ("Not a number")• If E=255 and F is zero and S is 1, then V=-Infinity• If E=255 and F is zero and S is 0, then V=Infinity• If 0<E<255 then V=(-1)**S * 2 ** (E-127) * (1.F) where "1.F" is intended to represent the binary

number created by prefixing F with an implicit leading 1 and a binary point.• If E=0 and F is nonzero, then V=(-1)**S * 2 ** (-126) * (0.F) These are "unnormalized" values.• If E=0 and F is zero and S is 1, then V=-0• If E=0 and F is zero and S is 0, then V=0

In particular,

0 00000000 00000000000000000000000 = 01 00000000 00000000000000000000000 = -0

0 11111111 00000000000000000000000 = Infinity1 11111111 00000000000000000000000 = -Infinity

0 11111111 00000100000000000000000 = NaN1 11111111 00100010001001010101010 = NaN

0 10000000 00000000000000000000000 = +1 * 2**(128-127) * 1.0 = 20 10000001 10100000000000000000000 = +1 * 2**(129-127) * 1.101 = 6.51 10000001 10100000000000000000000 = -1 * 2**(129-127) * 1.101 = -6.5

0 00000001 00000000000000000000000 = +1 * 2**(1-127) * 1.0 = 2**(-126)0 00000000 10000000000000000000000 = +1 * 2**(-126) * 0.1 = 2**(-127)

0 00000000 00000000000000000000001 = +1 * 2**(-126) *0.00000000000000000000001 =2**(-149) (Smallest positive value)

Page 44: Notes on Computer

7/29/2019 Notes on Computer

http://slidepdf.com/reader/full/notes-on-computer 44/46

B.TECH-II SEM/FCP/THEORITICAL NOTES ON UNIT-I AND II BY PANKAJ CHAUDHARY Page 44

Double Precision

The IEEE double precision floating point standard representation requires a 64 bit word, which may berepresented as numbered from 0 to 63, left to right. The first bit is the sign bit, S, the next eleven bitsare the exponent bits, 'E', and the final 52 bits are the fraction 'F':

S EEEEEEEEEEE FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0 1 11 12 63

The value V represented by the word may be determined as follows:

• If E=2047 and F is nonzero, then V=NaN ("Not a number")• If E=2047 and F is zero and S is 1, then V=-Infinity• If E=2047 and F is zero and S is 0, then V=Infinity• If 0<E<2047 then V=(-1)**S * 2 ** (E-1023) * (1.F) where "1.F" is intended to represent the

binary number created by prefixing F with an implicit leading 1 and a binary point.• If E=0 and F is nonzero, then V=(-1)**S * 2 ** (-1022) * (0.F) These are "unnormalized" values.• If E=0 and F is zero and S is 1, then V=-0• If E=0 and F is zero and S is 0, then V=0

Question No:(18): Explain working of MS-VC editor? How you may run C program in MSVC?Answer:-Microsoft Visual Studio C/C++ (MSVC) , which has an integrated, colour coded editor, in the IDE(Integrated Development Environment). This is editor-of-choice for generating C/C++ code ... since onecan make quick changes in the code, compile, and link the result, and quickly load it back into thedebugger for testing ... recently, it even allows code changes, while still in the debugger, and MSVC willre-compile the particular module, and re-link the application.

There are two methods to write and compile a C program in MSVC.

You can compile a C program using command line or you can compile a C program using the IntegratedDevelopment Environment (IDE) from Microsoft Visual C++.

Using Command Line to Compile C Program

1. Select [Start >> All Programs >> Microsoft Visual C++ 2010 Express Edition >> Visual Studio Tools >>Visual Studio 2010 Command Prompt]. Run with administrator privileges.

2. Once you are in the command line, you can use any editor such as edit to write a C program.

C:> edit myprogram.c

3. After written the program, to compile it, issue the command cl

Page 45: Notes on Computer

7/29/2019 Notes on Computer

http://slidepdf.com/reader/full/notes-on-computer 45/46

B.TECH-II SEM/FCP/THEORITICAL NOTES ON UNIT-I AND II BY PANKAJ CHAUDHARY Page 45

C:> cl myprogram.c

4. During the compilation and linking, myprogram.obj and myprogram.exe will be created.To run theprogram:

C:> myprogram

Using Visual C++ 2010 IDE

1. Create an empty project by select [File >> New >> Project]. Select [General >> Empty Project] and typein the project name. Alternatively, you can select [File >> New >> Project], follow by [Win32 >> Win32Console Application]. Type in the project name.

2. If you use Win32 Console Application, you can skip this step. Under [Solution Explorer], right click theproject name, and select [Properties]. Select [Configuration Properties >> Linker >> System]. Under[SubSystem], select [Console (/SUBSYSTEM:CONSOLE)].

3. Under [Solution Explorer, Source File], right-click and select [Add >> New Item].

4. Under Code, Select C++ File (.cpp), however, when you type in the name use a program name withextension .c, such as myprog.c and click [Add].

5. You can proceed to type your C program. Click [Save] icon to save your file.

6. To compile the program, under [Solution Explorer, Source File], right click the source file and select[Compile or (Ctrl+F7)].

7. Please note that you cannot run the program until you have build solution.

8. To build solution select [Debug >> Build Solution or (F7)]

9. To run the program without debugging, select [Debug >> Start without debugging or (Ctrl+F5)]. (Note:If you do not have this option, you need to add the command manually under Tools >> Customize. Youmay add a menu option or a button in the Debug toolbar.)

10. For any runtime error, you can debug the program as follows; Select [Debug >> Start debugging(F5)].

11. Please note that during debugging, the program will show and close the console display

immediately.

12. To see the console display, you must run without debugging.

Note:

Page 46: Notes on Computer

7/29/2019 Notes on Computer

http://slidepdf.com/reader/full/notes-on-computer 46/46

The problem using Visual Studio is that many files will be created even for a very simple program. Allfiles are created inside the project folder.

Under the project name of your program, the source code and object file is located at sub folder similarto your project name, the executable file is under sub folder <Debug>.

It is simpler to use the command line to compile and run a C program, however, you could use the IDEfor writing a properly formatted C program.

[In addition to above students must exhaustively practice on theExercises given in the classroom on Flow Charts, Algorithms and Number Conversions]

[Also practice first 2 questions from all FCP question papers of lastthree years of UTU]


Recommended