19.05.2013 Views

Question No: (1) Define computers? Why computer is known as data ...

Question No: (1) Define computers? Why computer is known as data ...

Question No: (1) Define computers? Why computer is known as data ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

NOTES ON FUNDAMENTALS OF COMPUTER AND PROGRAMMING ON UNIT I AND UNIT II<br />

SYLLABUS AS PER UTTRAKHAND TECHNICAL UNIVERSITY<br />

UNIT-I<br />

Introduction to Computer Systems; Data representation: Number systems, character representation<br />

codes, Binary, hex, octal codes and their inter conversions. Binary arithmetic, Floating point arithmetic,<br />

signed and unsigned numbers IEEE standards, CPU organization, ALU, reg<strong>is</strong>ters, memory, the idea of<br />

program execution at micro level. Concept of computing, contemporary Operating Systems such <strong>as</strong> DOS,<br />

Windows, UNIX etc. (only brief user level description). Introduction to organization and architecture of<br />

mainframe, mini and micro systems.<br />

UNIT-II<br />

Concept of flow chart and algorithm; Algorithms to programs: specification, top-down development and<br />

stepw<strong>is</strong>e refinement ,Introduction to the design and implementation of correct, efficient and<br />

maintainable programs, structured Programming,,Use of high level programming language for the<br />

systematic development of programs, programmability and programming languages, Object codes,<br />

compilers. Introduction to the Editing tools such <strong>as</strong> vi or MS-VC editors.<br />

(Possible Theoritical <strong>Question</strong>s and Answers From Unit 1 & 2)<br />

<strong>Question</strong> <strong>No</strong>: (1) <strong>Define</strong> <strong><strong>computer</strong>s</strong>? <strong>Why</strong> <strong>computer</strong> <strong>is</strong> <strong>known</strong> <strong>as</strong> <strong>data</strong> processing system?<br />

What are the b<strong>as</strong>ic operations of Computer?<br />

Answer: Computer: A <strong>computer</strong> <strong>is</strong> a programmable machine or device that performs pre-defined<br />

or programmed computations or controls operations that are expressible in numerical or logical<br />

terms at high speed and with great accuracy.<br />

Computer <strong>is</strong> a f<strong>as</strong>t operating electronic device, which automatically accepts and store input <strong>data</strong>,<br />

processes them and produces results under the direction of step by step program.<br />

Any Process that uses a <strong>computer</strong> program will enter <strong>data</strong> and summarize, analyze or otherw<strong>is</strong>e<br />

convert <strong>data</strong> into usable information. The process may be automated and run on a <strong>computer</strong>.<br />

It involves recording, analyzing, sorting, summarizing, calculating, d<strong>is</strong>seminating and storing <strong>data</strong>. Thus<br />

Computer <strong>is</strong> <strong>known</strong> <strong>as</strong> <strong>data</strong> processing system.<br />

Its various operations are:<br />

1) It accepts <strong>data</strong> or instructions by way of input.<br />

2) It stores <strong>data</strong>.<br />

3) It can process <strong>data</strong> <strong>as</strong> required by the user.<br />

4) It gives results in the form of output.<br />

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


5) It controls all operations inside a <strong>computer</strong>.<br />

<strong>Question</strong> <strong>No</strong>: (2). What <strong>is</strong> Data and Information? Give the applications of <strong>computer</strong>? What are<br />

the character<strong>is</strong>tics of <strong><strong>computer</strong>s</strong>?<br />

Answer: Data -Data <strong>is</strong> the fact or raw material for the information processing.<br />

Information – The processed <strong>data</strong> <strong>is</strong> called information.<br />

Applications of <strong>computer</strong><br />

· Word Processing<br />

· Internet<br />

· Desktop publ<strong>is</strong>hing<br />

· Digital video or audio composition<br />

· Mathematical Calculations<br />

· Robotics<br />

· Weather analys<strong>is</strong><br />

Character<strong>is</strong>tics of <strong><strong>computer</strong>s</strong><br />

· Speed<br />

· Accuracy.<br />

· Automation.<br />

· Endurance.<br />

· Versatility.<br />

· Storage.<br />

· Cost Reduction.<br />

<strong>Question</strong> <strong>No</strong>: (3). How will you cl<strong>as</strong>sify <strong>computer</strong> systems?<br />

Answer: B<strong>as</strong>ed on physical size, performance and application are<strong>as</strong>, we can generally divide <strong><strong>computer</strong>s</strong><br />

into four major categories:<br />

1. Micro <strong>computer</strong><br />

2. Mini Computer<br />

3. Mainframe <strong>computer</strong> and<br />

4. Super Computer<br />

Personal <strong><strong>computer</strong>s</strong>/Micro <strong><strong>computer</strong>s</strong>: A small, relatively inexpensive <strong>computer</strong> designed for an<br />

individual user. In price, personal <strong><strong>computer</strong>s</strong> range anywhere from a few hundred dollars to thousands<br />

of dollars. All are b<strong>as</strong>ed on the microprocessor technology that enables manufacturers to put an<br />

entire CPU on one chip.<br />

Example:<br />

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


· Businesses use personal <strong><strong>computer</strong>s</strong> forward processing, accounting, desktop publ<strong>is</strong>hing, and for<br />

running spreadsheet and <strong>data</strong>b<strong>as</strong>e management applications. At home, the most popular use for<br />

personal <strong><strong>computer</strong>s</strong> <strong>is</strong> for playing games.<br />

Mainframe <strong>computer</strong><br />

Mainframes are<strong><strong>computer</strong>s</strong> used mainly by large organizations for critical applications, typically<br />

bulk <strong>data</strong> processing such <strong>as</strong> census, industry and consumer stat<strong>is</strong>tics, enterpr<strong>is</strong>e resource planning,<br />

and financial processing.<br />

The term probably had originated from the early mainframes, <strong>as</strong> they were housed in enormous,<br />

room-sized metal boxes or frames.<br />

Mini <strong><strong>computer</strong>s</strong>:<br />

A mini <strong>computer</strong> <strong>is</strong> a multi-user or time-sharing system. It <strong>is</strong> used for medium scale <strong>data</strong> processing such<br />

<strong>as</strong> Bank account processing, Payroll processing etc., Mini <strong>computer</strong> process greater storage capacity and<br />

larger memories <strong>as</strong> compared to micro <strong>computer</strong>.<br />

Super <strong>computer</strong><br />

The f<strong>as</strong>test type of<strong>computer</strong>. Super<strong><strong>computer</strong>s</strong> are very expensive and are employed for<br />

specializedapplications that require immense amounts of mathematical calculations.<br />

For example, weather forec<strong>as</strong>ting requires a super<strong>computer</strong>. Other uses of super<strong><strong>computer</strong>s</strong><br />

include animated graphics, fluid dynamic calculations, nuclear energy research, and petroleum<br />

exploration.<br />

<strong>Question</strong> <strong>No</strong>: (4). Explain the fundamental units of a <strong>computer</strong> with a block diagram? Explain<br />

the b<strong>as</strong>ic <strong>computer</strong> organization in detail?<br />

Answer: A <strong>computer</strong> can process <strong>data</strong>, pictures, sound and graphics. They can solve highly<br />

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


Complicated problems quickly and<br />

accurately.<br />

Input Unit:<br />

Computers need to receive <strong>data</strong> and instruction in order to solve any problem. Therefore we need to<br />

input the <strong>data</strong> and instructions into the <strong><strong>computer</strong>s</strong>. The input unit cons<strong>is</strong>ts of one or more input<br />

devices. Keyboard <strong>is</strong> the one of the most commonly used input device. Other commonly used<br />

input devices are the mouse, floppy d<strong>is</strong>k drive, magnetic tape, etc. All the input devices perform<br />

the following functions.<br />

· Accept the <strong>data</strong> and instructions from the outside world.<br />

· Convert it to a form that the <strong>computer</strong> can understand.<br />

· Supply the converted <strong>data</strong> to the <strong>computer</strong> system for further processing.<br />

e.g. Keyboard, Scanner, Mouse, Joystick, Mike etc<br />

Storage Unit:<br />

The storage unit of the <strong>computer</strong> holds <strong>data</strong> and instructions that are entered through the<br />

input unit, before they are processed. It preserves the intermediate and final results before these<br />

are sent to the output devices. It also saves the <strong>data</strong> for the later use.<br />

Types of Storage Devices:<br />

(A) Primary Storage:<br />

1. Stores and provides very f<strong>as</strong>t.<br />

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


2. Th<strong>is</strong> memory <strong>is</strong> generally used to hold the program being currently executed in the <strong>computer</strong>,<br />

the <strong>data</strong> being received from the input unit, the intermediate and final results of the program.<br />

3. The primary memory <strong>is</strong> temporary in nature. The <strong>data</strong> <strong>is</strong> lost, when the <strong>computer</strong> <strong>is</strong> switched<br />

off.<br />

4. In order to store the <strong>data</strong> permanently, the <strong>data</strong> h<strong>as</strong> to be transferred to the secondary<br />

memory. The cost of the primary storage <strong>is</strong> more compared to the secondary storage.<br />

e.g. RAM, ROM etc<br />

(B) Secondary Storage:<br />

1. It stores several programs, documents, <strong>data</strong> b<strong>as</strong>es etc.<br />

2. The programs that run on the <strong>computer</strong> are first transferred to the primary memory<br />

before it <strong>is</strong> actually run.<br />

3. Whenever the results are saved, again they get stored in the secondary memory.<br />

4. The secondary memory <strong>is</strong> slower and cheaper than the primary memory. Some of the<br />

commonly used secondary memory devices are Hard d<strong>is</strong>k, CD, etc.,<br />

e.g. CD-ROM, HDD, FLOPPY DRIVE etc<br />

Memory Size:<br />

All digital <strong><strong>computer</strong>s</strong> use the binary system, i.e. 0’s and 1’s. Each character or a number<br />

<strong>is</strong> represented by an 8 bit code. The set of 8 bits <strong>is</strong> called a byte. A Character occupies 1<br />

byte space. A numeric occupies 2 byte space. Byte <strong>is</strong> the space occupied in the memory. The<br />

size of the primary storage <strong>is</strong> specified in KB (Kilobytes) or MB (Megabyte). One KB <strong>is</strong><br />

equal to 1024 bytes and one MB <strong>is</strong> equal to 1000KB. The size of the primary storage in a typical PC<br />

usually starts at 16MB. PCs having 32 MB, 48MB, 128 MB, 256MB memory are quite common.<br />

Output Unit:<br />

The output unit of a <strong>computer</strong> provides the information and results of a computation to outside world.<br />

Printers, V<strong>is</strong>ual D<strong>is</strong>play Unit (VDU) are the commonly used output devices. Other commonly used output<br />

devices are floppy d<strong>is</strong>k drive, hard d<strong>is</strong>k drive, and magnetic tape drive.<br />

Arithmetic Logical Unit:<br />

All calculations are performed in the Arithmetic Logic Unit (ALU) of the <strong>computer</strong>. It also does<br />

compar<strong>is</strong>on and takes dec<strong>is</strong>ion. The ALU can perform b<strong>as</strong>ic operations such <strong>as</strong> addition,<br />

subtraction, multiplication, div<strong>is</strong>ion, etc and does logic operations viz, >,


It controls all other units in the <strong>computer</strong>. The control unit instructs the input unit, where to store the<br />

<strong>data</strong> after receiving it from the user. It controls the flow of <strong>data</strong> and instructions from the storage unit to<br />

ALU. It also controls the flow of results from the ALU to the storage unit. The control unit <strong>is</strong> generally<br />

referred <strong>as</strong> the central nervous system of the <strong>computer</strong> that control and synchronizes its working.<br />

Central Processing Unit:<br />

The control unit and ALU of the <strong>computer</strong> are together <strong>known</strong> <strong>as</strong> the Central Processing Unit (CPU). The<br />

CPU <strong>is</strong> like brain performs the following functions:<br />

• It performs all calculations.<br />

• It takes all dec<strong>is</strong>ions.<br />

• It controls all units of the <strong>computer</strong>.<br />

A PC may have CPU-IC such <strong>as</strong> Intel 8088, 80286, 80386, 80486, Celeron, Pentium, Pentium Pro, Pentium<br />

II, Pentium III, Pentium IV, Dual Core, and AMD etc.<br />

<strong>Question</strong> <strong>No</strong>: (5). With suitable examples, explain about Number systems?<br />

Answer: A number system <strong>is</strong> a set of rules and symbols used to represent a number. There are<br />

several different number systems. Some examples of number systems are <strong>as</strong> follows:<br />

· Binary (b<strong>as</strong>e 2)<br />

· Octal (b<strong>as</strong>e 8)<br />

· Decimal (b<strong>as</strong>e 10)<br />

· Hexadecimal (b<strong>as</strong>e 16)<br />

Decimal and Hexadecimal numbers can each be represented using binary values. Th<strong>is</strong> enables<br />

decimal, hexadecimal, and other number systems to be represented on a <strong>computer</strong> which <strong>is</strong> b<strong>as</strong>ed<br />

around binary (0 or 1 / off or on). The b<strong>as</strong>e (or radix) of a number system <strong>is</strong> the number of units that <strong>is</strong><br />

equivalent to a single unit in the next higher counting space. In the decimal number system, the<br />

symbols 0-9 are used in combination to represent a number of any sizes.<br />

For example, the number 423 can be viewed <strong>as</strong> the following string of calculations:<br />

(4 x 100) + (2 x 10) + (3 x 1) = 400 + 20 + 3 = 423<br />

<strong>Question</strong> <strong>No</strong>: (6). Explain various generations of <strong><strong>computer</strong>s</strong> with features?<br />

Answer: Generation of Computers:<br />

Each ph<strong>as</strong>e of <strong>computer</strong> development <strong>is</strong> <strong>known</strong> <strong>as</strong> a separate generation of <strong><strong>computer</strong>s</strong>. The<br />

<strong>computer</strong> can be cl<strong>as</strong>sified into four generations according to their type of electronic circuits such<br />

<strong>as</strong> vacuum tube, trans<strong>is</strong>tor, IC etc.<br />

(a) The First Generation Computers (1949-55)<br />

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


Main Features:<br />

1) The <strong><strong>computer</strong>s</strong> of th<strong>is</strong> generation used vacuum tubes.<br />

2) These <strong><strong>computer</strong>s</strong> used machine language for giving instructions.<br />

3) They used the concept of stored program.<br />

4) These <strong><strong>computer</strong>s</strong> were 5000 times f<strong>as</strong>ter than the MARK-I.<br />

5) The first generation <strong><strong>computer</strong>s</strong> were welcomed by Government and Universities.<br />

Limitations:<br />

1)These <strong><strong>computer</strong>s</strong> were very big in size. The ENIAC machine w<strong>as</strong> 30 x 50 feet in size and<br />

30 tons in weight. So, these machines required very large space for their workings.<br />

2)Their power consumption w<strong>as</strong> very high.<br />

3)These <strong><strong>computer</strong>s</strong> had slow operating speed and small computing capacity.<br />

4)These <strong><strong>computer</strong>s</strong> had a very small memory.<br />

(b) The Second Generation Computers (1956-65)<br />

Main Features:<br />

1) The <strong><strong>computer</strong>s</strong> of th<strong>is</strong> generation replaced vacuum tubes with trans<strong>is</strong>tors.<br />

2) Magnetic cores were invented for storage.<br />

3) Different magnetic storage devices were developed in th<strong>is</strong> generation.<br />

4) Commercial applications were developed during th<strong>is</strong> period. Eighty percent of these <strong><strong>computer</strong>s</strong><br />

were used in business and industries.<br />

(c) Third Generation Computers (1966-75)<br />

Main Features:<br />

· The third generation <strong><strong>computer</strong>s</strong> replaced trans<strong>is</strong>tors with’ Integrated Circuits’. These Integrated<br />

Circuits are also <strong>known</strong> <strong>as</strong> chips.<br />

· The size of main memory w<strong>as</strong> incre<strong>as</strong>ed and reached about 4 megabytes.<br />

· Magnetic d<strong>is</strong>k technology had been improved and drive having capacity upto 100<br />

MBPS came into ex<strong>is</strong>tence.<br />

· The CPU becomes more powerful with the capacity of carrying out 1 million instructions per<br />

second.<br />

· Th<strong>is</strong> generation <strong><strong>computer</strong>s</strong> were relatively inexpensive and f<strong>as</strong>ter.<br />

· The application area also incre<strong>as</strong>ed in th<strong>is</strong> generation. The <strong><strong>computer</strong>s</strong> were used in other are<strong>as</strong> like<br />

education, small businesses survey, analys<strong>is</strong> along with their previous usage are<strong>as</strong>.<br />

(d) The Fourth Generation Computers (1976-Present)<br />

Main Features:<br />

i.The fourth generation <strong><strong>computer</strong>s</strong> replaced small scale integrated circuits and medium scale<br />

integrated circuits with the microprocessors chip.<br />

ii. Semiconductor memories replaced magnetic core memories.<br />

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


iii. The hard-d<strong>is</strong>ks are available of the sizes upto 200 GB. The RAID technology (Redundant Array<br />

of Inexpensive D<strong>is</strong>ks) gives storage upto thousands of GB.<br />

iv. Computer cost came down rapidly in th<strong>is</strong> generation.<br />

v. Application of <strong><strong>computer</strong>s</strong> <strong>is</strong> incre<strong>as</strong>ed in various are<strong>as</strong> like v<strong>is</strong>ualization, parallel computing,<br />

multimedia etc.<br />

(e) The Fifth Generation Computers<br />

Mankind along with the advancement in science and technology <strong>is</strong> working hard to bring the Vth<br />

Generation of <strong>computer</strong>. These <strong><strong>computer</strong>s</strong> will have the capability of thinking on their own like<br />

an man with the help of Artificial Intelligence (AI). the 21st century will be better, f<strong>as</strong>ter, smaller<br />

and smarter <strong><strong>computer</strong>s</strong>.<br />

<strong>Question</strong> <strong>No</strong>: (6). Explain the cl<strong>as</strong>sification of <strong><strong>computer</strong>s</strong>?<br />

Answer: CLASSIFICATION OF COMPUTERS<br />

Personal Computers:<br />

A personal <strong>computer</strong> (PC) <strong>is</strong> a self-contained <strong>computer</strong> capable of input, processing, output, and<br />

storage. A personal <strong>computer</strong> <strong>is</strong> designed to be a single-user <strong>computer</strong> and must have at le<strong>as</strong>t one input<br />

device, one output device, a processor, and memory. The three major groups of PCs are desktop<br />

<strong><strong>computer</strong>s</strong>, portable <strong><strong>computer</strong>s</strong>, and handheld <strong><strong>computer</strong>s</strong>. Desktop Computers: A desktop <strong>computer</strong> <strong>is</strong><br />

a PC designed to allow the system unit, input devices, output devices, and other connected<br />

devices to fit on top of, beside, or under a user’s desk or table. Th<strong>is</strong> type of <strong>computer</strong> may be used in the<br />

home, a home office, a library, or a corporate setting.<br />

Portable Computers:<br />

A portable <strong>computer</strong> <strong>is</strong> a PC small enough to be moved around e<strong>as</strong>ily. As the name suggests, a laptop<br />

<strong>computer</strong> fits comfortably on the lap. As laptop <strong><strong>computer</strong>s</strong> have decre<strong>as</strong>ed in size, th<strong>is</strong> type of<br />

<strong>computer</strong> <strong>is</strong> now more commonly referred to <strong>as</strong> a notebook <strong>computer</strong>. Manufacturers recently<br />

began introducing a new type of <strong>computer</strong> called the tablet PC, which h<strong>as</strong> a liquid crystal d<strong>is</strong>play<br />

(LCD) screen on which the user can write using a special-purpose pen, or stylus. Tablet PCs rely on<br />

digital ink technology that allows the user to write on the screen. Another type of portable<br />

<strong>computer</strong>, called a wearable <strong>computer</strong>, <strong>is</strong> worn somewhere on the body, thereby providing a user with<br />

access to mobile computing capabilities and information via the Internet.<br />

Handheld Computers:<br />

An even smaller type of personal <strong>computer</strong> that can fit into the hand <strong>is</strong> <strong>known</strong> <strong>as</strong> a handheld <strong>computer</strong><br />

(also called simply handheld, pocket PC, or Palmtop). In recent years, a type of handheld<br />

<strong>computer</strong> called a personal digital <strong>as</strong>s<strong>is</strong>tant (PDA) h<strong>as</strong> become widely used for performing<br />

calculations, keeping track of schedules, making appointments, and writing memos. Some<br />

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


handheld <strong><strong>computer</strong>s</strong> are Internet-enabled, meaning they can access the Internet without wire<br />

connections. For example, a smart phone <strong>is</strong> a cell phone that connects to the Internet to allow<br />

users to transmit and receive e-mail messages, send text messages and pictures, and browse through<br />

Web sites on the phone d<strong>is</strong>play screen.<br />

Workstations:<br />

A workstation <strong>is</strong> a high-performance single-user <strong>computer</strong> with advanced input, output, and storage<br />

components that can be networked with other workstations and larger <strong><strong>computer</strong>s</strong>. Workstations<br />

are typically used for complex applications that require considerable computing power and highquality<br />

graphics resolution, such <strong>as</strong> <strong>computer</strong>-aided design (CAD), <strong>computer</strong>-<strong>as</strong>s<strong>is</strong>ted manufacturing<br />

(CAM), desktop publ<strong>is</strong>hing, and software development.<br />

Midrange Servers/Mini<strong><strong>computer</strong>s</strong>:<br />

Linked <strong><strong>computer</strong>s</strong> and terminals are typically connected to a larger and more powerful <strong>computer</strong><br />

called a network server, sometimes referred to <strong>as</strong> a host <strong>computer</strong>. Although the size and<br />

capacity of network servers vary considerably, most are midrange rather than large mainframe<br />

<strong><strong>computer</strong>s</strong>.<br />

(i) Midrange server – formerly <strong>known</strong> <strong>as</strong> a mini<strong>computer</strong>, a midrange server <strong>is</strong> a powerful<br />

<strong>computer</strong> capable of accommodating hundreds of client <strong><strong>computer</strong>s</strong> or terminals (users) at the<br />

same time.<br />

(ii) Terminal – a device cons<strong>is</strong>ting of only a monitor and keyboard, with no processing<br />

capability of its own.<br />

Mainframe Computers:<br />

Larger, more powerful, and more expensive than midrange servers, a mainframe <strong>computer</strong> <strong>is</strong> capable of<br />

accommodating hundreds of network users performing different computing t<strong>as</strong>ks. These <strong><strong>computer</strong>s</strong><br />

are useful for dealing with large, ever-changing collections of <strong>data</strong> that can be accessed by many users<br />

simultaneously. Government agencies, banks, universities, and insurance companies use mainframes to<br />

handle millions of transactions each day.<br />

Super<strong><strong>computer</strong>s</strong>:<br />

A super<strong>computer</strong> <strong>is</strong> the f<strong>as</strong>test, most powerful, and most expensive of all <strong><strong>computer</strong>s</strong>. Many are<br />

capable of performing trillions of calculations in a single second. Primary applications include<br />

weather forec<strong>as</strong>ting, comparing DNA sequences, creating artificially intelligent robots, and<br />

performing financial analyses.<br />

<strong>Question</strong> <strong>No</strong>: (7). Explain Second Memory in detail?<br />

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


Answer: Secondary storage devices, <strong>as</strong> indicated by the name, save <strong>data</strong> after it h<strong>as</strong> been saved by the<br />

primary storage device, usually referred to <strong>as</strong> RAM (Random Access Memory). From the moment<br />

we start typing a letter in Microsoft Word, for example, and until we click on "Save," your entire<br />

work <strong>is</strong> stored in RAM. However, once you power off your machine, that work <strong>is</strong> completely<br />

er<strong>as</strong>ed, and the only copy remaining <strong>is</strong> on the secondary storage device where we saved it, such<br />

<strong>as</strong> internal or external hard d<strong>is</strong>k drive, optical drives for CDs or DVDs, or USB fl<strong>as</strong>h drive.<br />

Internal Hard D<strong>is</strong>k Drive<br />

The internal hard d<strong>is</strong>k drive <strong>is</strong> the main secondary storage device that stores all of your <strong>data</strong><br />

magnetically, including operating system files and folders, documents, music and video. The<br />

hard d<strong>is</strong>k drive <strong>is</strong> a stack of d<strong>is</strong>ks mounted one on top of the other and placed in a sturdy c<strong>as</strong>e. They are<br />

spinning at high speeds to provide e<strong>as</strong>y and f<strong>as</strong>t access to stored <strong>data</strong> anywhere on a d<strong>is</strong>k.<br />

External Hard D<strong>is</strong>k Drive<br />

External hard d<strong>is</strong>k drives are used when the internal drive does not have any free space and you need to<br />

store more <strong>data</strong>. In addition, it <strong>is</strong> recommended to always back up all of our <strong>data</strong> and an external hard<br />

drive can be very useful, <strong>as</strong> they can safely store large amounts of information. They can be connected<br />

by either USB connection to a <strong>computer</strong> and can even be connected with each other in c<strong>as</strong>e you need<br />

several additional hard drives at the same time.<br />

Optical Drive<br />

An optical drive uses l<strong>as</strong>ers to store and read <strong>data</strong> on CDs and DVDs. It b<strong>as</strong>ically burns a series<br />

of bumps and dips on a d<strong>is</strong>c, which are <strong>as</strong>sociated with ones and zeros. Then, th<strong>is</strong> same drive<br />

can interpret the series of ones and zeros into <strong>data</strong> that can be d<strong>is</strong>played on your monitors. There are a<br />

few different types of both CD and DVD d<strong>is</strong>ks, but the main two types include R and RW, which stand for<br />

Recordable (but you can write information on it just once) and Rewritable (meaning you can record <strong>data</strong><br />

on it over and over again).<br />

USB Fl<strong>as</strong>h Drive<br />

USB fl<strong>as</strong>h memory storage device <strong>is</strong> also portable and can be carried around on a key chain. Th<strong>is</strong> type of<br />

a secondary storage device h<strong>as</strong> become incredibly popular due to the very small size of device compared<br />

to the amount of <strong>data</strong> it can store (in most c<strong>as</strong>es, more than CDs or DVDs). Data can be e<strong>as</strong>ily read using<br />

the USB (Universal Serial Bus) interface that now comes standard<br />

with most of the <strong><strong>computer</strong>s</strong>.<br />

<strong>Question</strong> <strong>No</strong>: (8). Explain about memory in Computer System?(or) Write short notes on<br />

memory of a <strong>computer</strong>?<br />

Answer: The Role of Memory: The term "memory" applies to any electronic component capable of<br />

temporarily storing <strong>data</strong>.<br />

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


There are two main categories of memories:<br />

Internal memory that temporarily memorizes <strong>data</strong> while programs are running. Internal memory uses<br />

micro conductors, i.e. f<strong>as</strong>t specialized electronic circuits. Internal memory corresponds to what we<br />

call random access memory (RAM).<br />

Auxiliary memory (also called physical memory or external memory) that stores information over<br />

the long term, including after the <strong>computer</strong> <strong>is</strong> turned off. Auxiliary memory corresponds to magnetic<br />

storage devices such <strong>as</strong> the hard drive, optical storage devices such <strong>as</strong> CD-ROMs and DVD-ROMs, <strong>as</strong> well<br />

<strong>as</strong> read-only memories.<br />

Technical Character<strong>is</strong>tics<br />

(a) Capacity, representing the global volume of information (in bits) that the memory can<br />

store<br />

(b) Access time, corresponding to the time interval between the read/write request and the<br />

availability of the <strong>data</strong><br />

(c) Cycle time, representing the minimum time interval between two successive accesses<br />

(d) Throughput, which defines the volume of information exchanged per unit of time,<br />

expressed in bits per second<br />

(e) <strong>No</strong>n-volatility, which characterizes the ability of a memory to store <strong>data</strong> when it <strong>is</strong> not<br />

being supplied with electricity<br />

The ideal memory h<strong>as</strong> a large capacity with restricted access time and cycle time, a high<br />

throughput and <strong>is</strong> non-volatile. However, f<strong>as</strong>t memories are also the most expensive. Th<strong>is</strong> <strong>is</strong> why<br />

memories that use different technologies are used in a <strong>computer</strong>, interfaced with each other and<br />

organized hierarchically. The f<strong>as</strong>test memories are located in small numbers close to the<br />

processor. Auxiliary memories, which are not <strong>as</strong> f<strong>as</strong>t, are used to store information permanently.<br />

Types of Memories<br />

Random Access Memory<br />

Random access memory, generally called RAM <strong>is</strong> the system's main memory, i.e. it <strong>is</strong> a space<br />

that allows you to temporarily store <strong>data</strong> when a program <strong>is</strong> running. Unlike <strong>data</strong> storage on an<br />

auxiliary memory such <strong>as</strong> a hard drive, RAM <strong>is</strong> volatile, meaning that it only stores <strong>data</strong> <strong>as</strong> long<br />

<strong>as</strong> it supplied with electricity. Thus, each time the <strong>computer</strong> <strong>is</strong> turned off, all the <strong>data</strong> in the memory<br />

are irremediably er<strong>as</strong>ed.<br />

Read-Only Memory<br />

Read-only memory, called ROM, <strong>is</strong> a type of memory that allows you to keep the information<br />

contained on it even when the memory <strong>is</strong> no longer receiving electricity. B<strong>as</strong>ically, th<strong>is</strong> type of<br />

memory only h<strong>as</strong> read-only access. However, it <strong>is</strong> possible to save information in some types of<br />

ROM memory.<br />

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


Fl<strong>as</strong>h Memory<br />

Fl<strong>as</strong>h memory <strong>is</strong> a comprom<strong>is</strong>e between RAM-type memories and ROM memories. Fl<strong>as</strong>h memory<br />

possesses the non-volatility of ROM memories while providing both read and writes access However,<br />

the access times of fl<strong>as</strong>h memories are longer than the access times of RAM.<br />

<strong>Question</strong> <strong>No</strong>: (9). Elaborate the various Peripheral (Input and Output) Devices?<br />

Answer: Input/Output devices are required for users to communicate with the <strong>computer</strong>. In simple<br />

terms, input devices bring information INTO the <strong>computer</strong> and output devices bring information<br />

OUT of a <strong>computer</strong> system. These input/output devices are also <strong>known</strong> <strong>as</strong> peripherals since they<br />

surround the CPU and memory of a <strong>computer</strong> system. Some commonly used Input/Output devices are<br />

l<strong>is</strong>ted in table below.<br />

(a)Keyboard<br />

It <strong>is</strong> a text b<strong>as</strong>e input device that allows the user to input alphabets, numbers and other characters. It<br />

cons<strong>is</strong>ts of a set of keys mounted on a board.<br />

Alphanumeric Keypad: It cons<strong>is</strong>ts of keys for Engl<strong>is</strong>h alphabets, 0 to 9 numbers, and special characters<br />

like + − / * ( ) etc.<br />

Function Keys: There are twelve function keys labeled F1, F2, F3… F12. The functions <strong>as</strong>signed to these<br />

keys differ from one software package to another. These keys are also user programmable keys.<br />

Special-function Keys<br />

These keys have special functions <strong>as</strong>signed to them and can be used only for those specific purposes.<br />

Functions of some of the important keys are defined below.<br />

Enter-It <strong>is</strong> similar to the ‘return’ key of the typewriter and <strong>is</strong> used to execute a command or program.<br />

Spacebar-It <strong>is</strong> used to enter a space at the current cursor location.<br />

Backspace-Th<strong>is</strong> key <strong>is</strong> used to move the cursor one position to the left and also delete the<br />

character in that position.<br />

Delete-It <strong>is</strong> used to delete the character at the cursor position.<br />

Insert-Insert key <strong>is</strong> used to toggle between insert and overwrite mode during <strong>data</strong> entry.<br />

Shift-Th<strong>is</strong> key <strong>is</strong> used to type capital letters when pressed along with an alphabet key. Also used to type<br />

the special characters located on the upper-side of a key that h<strong>as</strong> two characters defined on the<br />

same key.<br />

Caps Lock-Cap Lock <strong>is</strong> used to toggle between the capital lock features. When ‘on’, it locks the<br />

alphanumeric keypad for capital letters input only.<br />

Tab-Tab <strong>is</strong> used to move the cursor to the next tab position defined in the document. Also,it <strong>is</strong> used to<br />

insert indentation into a document.<br />

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


Ctrl-Control key <strong>is</strong> used in conjunction with other keys to provide additional functionality on the<br />

keyboard.<br />

Alt-Also like the control key, Alt key <strong>is</strong> always used in combination with other keys to perform<br />

specific t<strong>as</strong>ks.<br />

Esc-Th<strong>is</strong> key <strong>is</strong> usually used to negate a command. Also used to cancel or abort executing programs.<br />

Numeric Keypad<br />

Numeric keypad <strong>is</strong> located on the right side of the keyboard and cons<strong>is</strong>ts of keys having<br />

numbers (0 to 9) and mathematical operators (+ − * /) defined on them. Th<strong>is</strong> keypad <strong>is</strong> provided<br />

to support quick entry for numeric <strong>data</strong>.<br />

Cursor Movement Keys<br />

These are arrow keys and are used to move the cursor in the direction indicated by the arrow (up, down,<br />

left, right).<br />

(b) Mouse<br />

The mouse <strong>is</strong> a small device used to point to a particular place on the screen and select in order<br />

to perform one or more actions. It can be used to select menu commands, size windows, start programs<br />

etc. The most conventional kind of mouse h<strong>as</strong> two buttons on top: the left one being used most<br />

frequently.<br />

Mouse Actions<br />

Left Click :Used to select an item.<br />

Double Click : Used to start a program or open a file.<br />

Right Click : Usually used to d<strong>is</strong>play a set of commands.<br />

Drag and Drop : It allows you to select and move an item from one location to another. To achieve th<strong>is</strong><br />

place the cursor over an item on the screen, click the left<br />

mouse button and while holding the button down move the cursor to where you want to<br />

place the item, and then rele<strong>as</strong>e it.<br />

(c) Joystick<br />

The joystick <strong>is</strong> a vertical stick which moves the graphic cursor in a direction the stick <strong>is</strong> moved. It<br />

typically h<strong>as</strong> a button on top that <strong>is</strong> used to select the option pointed by the cursor. Joystick <strong>is</strong> used <strong>as</strong><br />

an input device primarily used with video games, training simulators and controlling robots<br />

(d)Scanner<br />

Scanner <strong>is</strong> an input device used for direct <strong>data</strong> entry from the source document into the <strong>computer</strong><br />

system. It converts the document image into digital form so that it can be fed into the <strong>computer</strong>.<br />

Capturing information like th<strong>is</strong> reduces the possibility of errors typically experienced during large<br />

<strong>data</strong> entry. Hand-held scanners are commonly seen in big stores to scan codes and price information for<br />

each of the items. They are also termed the bar code readers.<br />

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


(e) Bar code Reader: A bar code <strong>is</strong> a set of lines of different thicknesses that represent a<br />

number. Bar Code Readers are used to input <strong>data</strong> from bar codes. Most products in shops have<br />

bar codes on them. Bar code readers work by shining a beam of light on the lines that make up the bar<br />

code and detecting the amount of light that <strong>is</strong> reflected back<br />

(f) Light Pen: It <strong>is</strong> a pen shaped device used to select objects on a d<strong>is</strong>play screen. It <strong>is</strong> quite like the<br />

mouse (in its functionality) but uses a light pen to move the pointer and select any object on the screen<br />

by pointing to the object. Users of Computer Aided Design (CAD) applications commonly use the<br />

light pens to directly draw on screen.<br />

(g) Touch Screen: It allows the user to operate/make selections by simply touching the d<strong>is</strong>play screen.<br />

Common examples of touch screen include information kiosks, and bank ATMs.<br />

(h)Digital camera: A digital camera can store many more pictures than an ordinary camera. Pictures<br />

taken using a digital camera are stored inside its memory and can be transferred to a <strong>computer</strong><br />

by connecting the camera to it. A digital camera takes pictures by converting the light p<strong>as</strong>sing<br />

through the lens at the front into a digital image.<br />

(i) The Speech Input Device<br />

The “Microphones - Speech Recognition” <strong>is</strong> a speech Input device. To operate it we require using a<br />

microphone to talk to the <strong>computer</strong>. Also we need to add a sound card to the <strong>computer</strong>. The Sound<br />

card digitizes audio input into 0/1s .A speech recognition program can process the input and<br />

convert it into machine-recognized commands or input.<br />

Output Devices<br />

(a) Monitor<br />

Monitor <strong>is</strong> an output device that resembles the telev<strong>is</strong>ion screen and uses a Cathode Ray Tube (CRT) to<br />

d<strong>is</strong>play information. The monitor <strong>is</strong> <strong>as</strong>sociated with a keyboard for manual input of characters and<br />

d<strong>is</strong>plays the information <strong>as</strong> it <strong>is</strong> keyed in. It also d<strong>is</strong>plays the program or application output. Like the<br />

telev<strong>is</strong>ion, monitors are also available in different sizes.<br />

(b) Liquid Crystal D<strong>is</strong>play (LCD)<br />

LCD w<strong>as</strong> introduced in the 1970s and <strong>is</strong> now applied to d<strong>is</strong>play terminals also. Its advantages like<br />

low energy consumption, smaller and lighter have paved its way for usage in portable <strong><strong>computer</strong>s</strong><br />

(laptops).<br />

(c) Printer<br />

Printers are used to produce paper (commonly <strong>known</strong> <strong>as</strong> hardcopy) output. B<strong>as</strong>ed on the technology<br />

used, they can be cl<strong>as</strong>sified <strong>as</strong> Impact or <strong>No</strong>n-impact printers. Impact printers use the typewriting<br />

printing mechan<strong>is</strong>m wherein a hammer strikes the paper through a ribbon in order to produce<br />

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


output. Dot-matrix and Character printers fall under th<strong>is</strong> category. <strong>No</strong>n-impact printers do not touch<br />

the paper while printing. They use chemical, heat or electrical signals to etch the symbols on paper.<br />

Inkjet, Deskjet, L<strong>as</strong>er, Thermal printers fall under th<strong>is</strong> category of printers. When we talk about printers<br />

we refer to two b<strong>as</strong>ic qualities <strong>as</strong>sociated with printers: resolution, and speed. Print resolution <strong>is</strong><br />

me<strong>as</strong>ured in terms of number of dots per inch (dpi). Print speed <strong>is</strong> me<strong>as</strong>ured in terms of number of<br />

characters printed in a unit of time and <strong>is</strong> represented <strong>as</strong> characters-per-second (cps), lines-perminute<br />

(lpm), or pages-per-minute (ppm).<br />

(d) Plotter<br />

Plotters are used to print graphical output on paper. It interprets <strong>computer</strong> commands and<br />

makes line drawings on paper using multicolored automated pens. It <strong>is</strong> capable of producing<br />

graphs, drawings, charts, maps etc. Computer Aided Engineering (CAE) applications like CAD<br />

(Computer Aided Design) and CAM (Computer Aided Manufacturing) are typical usage are<strong>as</strong> for<br />

plotters.<br />

(e) Audio Output: Sound Cards and Speakers:<br />

The Audio output <strong>is</strong> the ability of the <strong>computer</strong> to output sound. Two components are needed:<br />

Sound card – Plays contents of digitized recordings, Speakers – Attached to sound card.<br />

<strong>Question</strong> <strong>No</strong>(10):<strong>Define</strong> Software & Hardware? What <strong>is</strong> an instruction? What are reg<strong>is</strong>ters?<br />

Answer: (10): Software:- Computer instructions or <strong>data</strong>, anything that can be stored electronically <strong>is</strong><br />

software. Computer software or just software <strong>is</strong> a general term used to describe the role that<br />

<strong>computer</strong> programs, procedures and documentation in a <strong>computer</strong> system.<br />

Hardware - (<strong>computer</strong> science) the mechanical, magnetic, electronic, and electrical components<br />

making up a <strong>computer</strong> systemhardware. Hardware includes not only the <strong>computer</strong> proper but also the<br />

cables, connectors, power supply units, and peripheral devices such <strong>as</strong> the keyboard, mouse, audio<br />

speakers, and printers.<br />

Instruction: An instruction <strong>is</strong> a b<strong>as</strong>iccommand. The term instruction <strong>is</strong> often used to describe the<br />

most rudimentaryprogramming commands. For example, a <strong>computer</strong>'sinstruction set <strong>is</strong> the<br />

l<strong>is</strong>t of all the b<strong>as</strong>ic commands in the <strong>computer</strong>'s machine language.<br />

Reg<strong>is</strong>ter: A special, high-speed storage area within the CPU. All <strong>data</strong> must be represented in a<br />

reg<strong>is</strong>ter before it can be processed. For example, if two numbers are to be multiplied, both<br />

numbers must be in reg<strong>is</strong>ters, and the result <strong>is</strong> also placed in a reg<strong>is</strong>ter.<br />

<strong>Question</strong> <strong>No</strong>:- (9): Give the categories of Software with example?<br />

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


Answer: SOFTWARE TYPES<br />

(A).Application Software:<br />

Application Software <strong>is</strong> a set of programs for a specific application. Application software <strong>is</strong> useful for<br />

word processing, accounting, and producing stat<strong>is</strong>tical report, Graphics, Excel and Data B<strong>as</strong>e.<br />

Programming languages COBOL, FORTRAN, C++,VB, VC, Java<br />

Types of Application Software<br />

Application software enables users to perform the activities and work that <strong><strong>computer</strong>s</strong> were designed<br />

for. The specific type of application used depends on the intended purpose, and there are application<br />

programs for almost every need.<br />

(a) Individual application software refers to programs individuals use at work or at home. Examples<br />

include word processing, spreadsheet, <strong>data</strong>b<strong>as</strong>e management, and desktop publ<strong>is</strong>hing programs.<br />

(b) Collaboration software (also called groupware) enables people at separate PC workstations to<br />

work together on a single document or project, such <strong>as</strong> designing a new automobile engine.<br />

(c) Vertical application software <strong>is</strong> a complete package of programs that work together to perform core<br />

business functions for a large organization. For example, a bank might have a mainframe <strong>computer</strong> at<br />

its corporate headquarters connected to conventional terminals in branch offices, where they are<br />

used by managers, tellers, loan officers, and other employees. All financial transactions are fed to the<br />

central <strong>computer</strong> for processing. The system then generates managers’ reports, account statements,<br />

and other essential documents.<br />

Other Application Software Models<br />

Shareware: Shareware <strong>is</strong> software developed by an individual or software publ<strong>is</strong>her who retains<br />

ownership of the product and makes it available for a small “contribution” fee. The voluntary fee<br />

normally entitles users to receive online or written product documentation and technical help.<br />

Freeware: Freeware <strong>is</strong> software that <strong>is</strong> provided free of charge to anyone wanting to use it. Hundreds<br />

of freeware programs are available, many written by college students and professors who create<br />

programs <strong>as</strong> cl<strong>as</strong>s projects or <strong>as</strong> part of their research.<br />

Open Source Software: An open source software program <strong>is</strong> software whose programming code <strong>is</strong><br />

owned by the original developer but made available free to the general public, who <strong>is</strong> encouraged to<br />

experiment with the software, make improvements, and share the improvements with the user<br />

community<br />

<strong>Question</strong> <strong>No</strong> (10): What do you understand by the compiler? What are various ph<strong>as</strong>es of compiler?<br />

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


Answer: Compiler: A compiler <strong>is</strong> a <strong>computer</strong> program (or set of programs) that transforms source<br />

code written in a programming language (the source language) into another <strong>computer</strong> language (the<br />

target language, often having a binary form <strong>known</strong> <strong>as</strong> object code).<br />

Various Ph<strong>as</strong>es of Compiler: Following are various ph<strong>as</strong>es of Compiler:<br />

A common div<strong>is</strong>ion into ph<strong>as</strong>es <strong>is</strong> described below. In some compilers, the ordering of ph<strong>as</strong>es may differ<br />

slightly, some ph<strong>as</strong>es may be combined or split into several ph<strong>as</strong>es or some extra ph<strong>as</strong>es may be<br />

inserted between those mentioned below.<br />

Lexical analys<strong>is</strong> Th<strong>is</strong> <strong>is</strong> the initial part of reading and analysing the program text: The text <strong>is</strong> read and<br />

divided into tokens, each of which corresponds to a symbol in the programming language, e.g., a<br />

variable name, keyword or number.<br />

Syntax analys<strong>is</strong> Th<strong>is</strong> ph<strong>as</strong>e takes the l<strong>is</strong>t of tokens produced by the lexical analys<strong>is</strong> and arranges these in<br />

a tree-structure (called the syntax tree) that reflects the structure of the program. Th<strong>is</strong> ph<strong>as</strong>e <strong>is</strong> often<br />

called parsing.<br />

Type checking Th<strong>is</strong> ph<strong>as</strong>e analyses the syntax tree to determine if the program violates certain<br />

cons<strong>is</strong>tency requirements, e.g., if a variable <strong>is</strong> used but not declared or if it <strong>is</strong> used in a context that does<br />

not make sense given the type of the variable, such <strong>as</strong> trying to use a boolean value <strong>as</strong> a function<br />

pointer.<br />

Intermediate code generation The program <strong>is</strong> translated to a simple machine independent intermediate<br />

language.<br />

Reg<strong>is</strong>ter allocation The symbolic variable names used in the intermediate code are translated to<br />

numbers, each of which corresponds to a reg<strong>is</strong>ter in the target machine code.<br />

Machine code generation The intermediate language <strong>is</strong> translated to <strong>as</strong>sembly language (a textual<br />

representation of machine code) for a specific machine architecture.<br />

Assembly and linking- The <strong>as</strong>sembly-language code <strong>is</strong> translated into binary representation and<br />

addresses of variables, functions, etc., are determined.<br />

The first three ph<strong>as</strong>es are collectively called the frontend of the compiler and the l<strong>as</strong>t three ph<strong>as</strong>es are<br />

collectively called the backend. The middle part of the compiler <strong>is</strong> in th<strong>is</strong> context only the intermediate<br />

code generation, but th<strong>is</strong> often includes various optimizations and transformations on the intermediate<br />

code.<br />

Each ph<strong>as</strong>e, through checking and transformation, establ<strong>is</strong>hes stronger invariants on the things it p<strong>as</strong>ses<br />

on to the next, so that writing each subsequent ph<strong>as</strong>e <strong>is</strong> e<strong>as</strong>ier than if these have to take all the<br />

preceding into account. For example, the type checker can <strong>as</strong>sume absence of syntax errors and the<br />

code generation can <strong>as</strong>sume absence of type errors. Assembly and linking are typically done by<br />

programs supplied by the machine or operating system vendor,<br />

<strong>Question</strong> <strong>No</strong> (11): Explain working of Loader, Linker, Interpreter and Assembler?<br />

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


Answer: Loader: In a <strong>computer</strong> operating system, a loader <strong>is</strong> a component that locates a given program<br />

(which can be an application or, in some c<strong>as</strong>es, part of the operating system itself) in offline storage<br />

(such <strong>as</strong> a hard d<strong>is</strong>k), loads it into main storage (in a personal <strong>computer</strong>, it's called random access<br />

memory), and gives that program control of the <strong>computer</strong> (allows it to execute its instruction s).<br />

A program that <strong>is</strong> loaded may itself contain components that are not initially loaded into main storage,<br />

but can be loaded if and when their logic <strong>is</strong> needed. In a multit<strong>as</strong>king operating system, a program that<br />

<strong>is</strong> sometimes called a d<strong>is</strong>patcher juggles the <strong>computer</strong> processor's time among different t<strong>as</strong>ks and<br />

calls the loader when a program <strong>as</strong>sociated with a t<strong>as</strong>k <strong>is</strong> not already in main storage.<br />

Linker: Also called link editor and binder, a linker <strong>is</strong> a program tha t combines object modules to form<br />

an executable program. Many programming languages allow you to write different pieces of code,<br />

called modules, separately. Th<strong>is</strong> simplifies the programming t<strong>as</strong>k because you can break a large program<br />

into small, more manageable pieces. Eventually, though, you need to put all the modules together. Th<strong>is</strong><br />

<strong>is</strong> the job of the linker. In addition to combining modules, a linker also replaces symbolic addresses with<br />

real addresses. Therefore, you may need to link a program even if it contains only one module.<br />

The linkage editor accepts two major types of input:<br />

• Primary input, cons<strong>is</strong>ting of object decks and linkage editor control statements.<br />

• Additional user-specified input, which can contain both object decks and control<br />

statements, or load modules. Th<strong>is</strong> input <strong>is</strong> either specified by you <strong>as</strong> input, or <strong>is</strong> incorporated<br />

automatically by the linkage editor from a call library.<br />

Output of the linkage editor <strong>is</strong> of two types:<br />

• A load module placed in a library (a partitioned <strong>data</strong> set) <strong>as</strong> a named member<br />

• Diagnostic output produced <strong>as</strong> a sequential <strong>data</strong> set.<br />

• The loader prepares the executable program in storage and p<strong>as</strong>ses control to it directly.<br />

Interpreter: An interpreter normally means a <strong>computer</strong> program that executes, i.e. performs,<br />

instructions written in a programming language. An interpreter may be a program that either<br />

• executes the source code directly<br />

• translates source code into some efficient intermediate representation (code) and<br />

immediately executes th<strong>is</strong><br />

• explicitly executes stored precompiled code made by a compiler which <strong>is</strong> part of the<br />

interpreter system<br />

Assembler: An <strong>as</strong>sembler translates an <strong>as</strong>sembly language source program into machine codes.<br />

Though the <strong>as</strong>sembly language <strong>is</strong> the symbolic representation of machine codes, a <strong>computer</strong><br />

cannot understand it. After translating the <strong>as</strong>sembly language program into machine codes by the<br />

<strong>as</strong>sembler, the program becomes ready for the execution.<br />

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


<strong>Question</strong> <strong>No</strong> (12): Explain in detail the steps involved in Software Development Process?<br />

Answer: Software development life cycle model <strong>is</strong> also called <strong>as</strong> waterfall model which <strong>is</strong> followed by<br />

majority of systems.<br />

Th<strong>is</strong> software development life cycle process h<strong>as</strong> the following seven stages in it namely<br />

1. System Requirements Analys<strong>is</strong><br />

2. Fe<strong>as</strong>ibility study<br />

3. Systems Analys<strong>is</strong> and Design<br />

4. Code Generation<br />

5. Testing<br />

6. Maintenance<br />

7. Implementation<br />

1. System Requirements Analys<strong>is</strong>:<br />

The first essential or vital thing required for any software development <strong>is</strong> system. Also the system<br />

requirement may vary b<strong>as</strong>ed on the software product that <strong>is</strong> going to get developed. So a careful<br />

analys<strong>is</strong> h<strong>as</strong> to be made about the system requirement needed for the development of the product.<br />

After the analys<strong>is</strong> and design of the system requirement ph<strong>as</strong>e the system required for the development<br />

would be complete and the concentration can be on the software development process.<br />

2. Fe<strong>as</strong>ibility study:<br />

After making an analys<strong>is</strong> in the system requirement the next step <strong>is</strong> to make analys<strong>is</strong> of the<br />

software requirement. In other words fe<strong>as</strong>ibility study <strong>is</strong> also called <strong>as</strong> software requirement analys<strong>is</strong>.<br />

In th<strong>is</strong> ph<strong>as</strong>e development team h<strong>as</strong> to make communication with customers and make analys<strong>is</strong> of<br />

their requirement and analyze the system. By making analys<strong>is</strong> th<strong>is</strong> way it would be possible to<br />

make a report of identified area of problem. By making a detailed analys<strong>is</strong> on th<strong>is</strong> area a<br />

detailed document or report <strong>is</strong> prepared in th<strong>is</strong> ph<strong>as</strong>e which h<strong>as</strong> details like project plan or schedule of<br />

the project, the cost estimated for developing and executing the system, target dates for each ph<strong>as</strong>e of<br />

delivery of system developed and so on. Th<strong>is</strong> ph<strong>as</strong>e <strong>is</strong> the b<strong>as</strong>e of software development process<br />

since further steps taken in software development life cycle would be b<strong>as</strong>ed on the analys<strong>is</strong><br />

made on th<strong>is</strong> ph<strong>as</strong>e and so careful analys<strong>is</strong> h<strong>as</strong> to be made in th<strong>is</strong> ph<strong>as</strong>e.<br />

3. Systems Analys<strong>is</strong> and Design:<br />

Th<strong>is</strong> <strong>is</strong> an important ph<strong>as</strong>e in system development .Here analys<strong>is</strong> <strong>is</strong> made on the design of the system<br />

that <strong>is</strong> going to be developed. In other words <strong>data</strong>b<strong>as</strong>e design, the design of the architecture chosen,<br />

functional specification design, low level design documents, high level design documents and so on<br />

takes place. Care must be taken to prepare these design documents because the next ph<strong>as</strong>es<br />

namely the development ph<strong>as</strong>e <strong>is</strong> b<strong>as</strong>ed on these design documents. If a well structured and analyzed<br />

design document <strong>is</strong> prepared it would reduce the time taken in the coming steps namely<br />

development and testing ph<strong>as</strong>es of the software development life cycle.<br />

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


4. Code Generation:<br />

Th<strong>is</strong> <strong>is</strong> the ph<strong>as</strong>e where actual development of the system takes place. That <strong>is</strong> b<strong>as</strong>ed on the design<br />

documents prepared in the earlier ph<strong>as</strong>e code <strong>is</strong> written in the programming technology chosen. After<br />

the code <strong>is</strong> developed generation of code also takes place in th<strong>is</strong> ph<strong>as</strong>e. In other words the code <strong>is</strong><br />

converted into executables in th<strong>is</strong> ph<strong>as</strong>e after code generation.<br />

5. Testing:<br />

A software or system which <strong>is</strong> not tested would be of poor quality. Th<strong>is</strong> <strong>is</strong> because th<strong>is</strong> <strong>is</strong> the<br />

ph<strong>as</strong>e where system developed would be tested and reports are prepared about bugs or errors in<br />

system. To do th<strong>is</strong> testing ph<strong>as</strong>e there are different levels and methods of testing like unit testing,<br />

system test and so on. B<strong>as</strong>ed on the need the testing methods are chosen and reports are prepared<br />

about bugs. After th<strong>is</strong> process the system again goes to development ph<strong>as</strong>e for correction of errors and<br />

again tested. Th<strong>is</strong> process continues until the system <strong>is</strong> found to be error free. To e<strong>as</strong>e the testing<br />

process debuggers or testing tools are also available.<br />

To develop reliable and good quality Program/Software we need to follow the<br />

following 5 steps :<br />

1. Requirement Specification.<br />

2. Analys<strong>is</strong>.<br />

3. Design.<br />

4. Implementation.<br />

5. Verification and testing.<br />

<strong>Question</strong> <strong>No</strong> (13): Explain the steps involved in developing a program? (or) Brief<br />

about planning the <strong>computer</strong> program?<br />

Answer: The Programming Process – Purpose<br />

1. Understand the problem<br />

• Read the problem statement<br />

• <strong>Question</strong> users<br />

• Inputs required<br />

• Outputs required<br />

• Special formul<strong>as</strong><br />

• Talk to users<br />

2. Plan the logic<br />

(a) V<strong>is</strong>ual Design Tools<br />

• Input record chart<br />

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


• Printer spacing chart<br />

• Hierarchy chart<br />

• Flowchart<br />

(b) Verbal Design Tools<br />

• Narrative Description<br />

• Pseudocode<br />

3. Code the program<br />

• Select an appropriate programming language<br />

• Convert flowchart and/or Pseudocode instructions into programming language statements<br />

4. Test the program<br />

1. Syntax errors<br />

2. Runtime errors<br />

3. Logic errors<br />

4. Test Data Set<br />

5. Implement the program<br />

• Buy hardware<br />

• Publ<strong>is</strong>h software<br />

• Train users<br />

6. Maintain the program<br />

• Maintenance programmers<br />

• Legacy systems<br />

• Up to 85% of IT department budget<br />

<strong>Question</strong> <strong>No</strong> (14): Explain flowchart in detail?<br />

Answer:A flowchart <strong>is</strong> a schematic representation of an algorithm or a stepw<strong>is</strong>e process, showing the<br />

steps <strong>as</strong> boxes of various kinds, and their order by connecting these with arrows. Flowcharts are used in<br />

designing or documenting a process or program.<br />

A flow chart, or flow diagram, <strong>is</strong> a graphical representation of a process or system that details the<br />

sequencing of steps required to create output. A flowchart <strong>is</strong> a picture of the separate steps of a process<br />

in sequential order.<br />

The benefits of flowcharts are <strong>as</strong> follows:<br />

a. Communication: Flowcharts are better way of communicating the logic of a system to all concerned.<br />

b. Effective analys<strong>is</strong>: With the help of flowchart, problem can be analyzed in more effective way.<br />

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


c. Proper documentation: Program flowcharts serve <strong>as</strong> a good program documentation, which <strong>is</strong><br />

needed for various purposes.<br />

d. Efficient Coding: The flowcharts act <strong>as</strong> a guide or blueprint during the systems analys<strong>is</strong> and program<br />

development ph<strong>as</strong>e.<br />

e. Proper Debugging: The flowchart helps in debugging process.<br />

f. Efficient Program Maintenance: The maintenance of operating program becomes e<strong>as</strong>y with the help<br />

of flowchart. It helps the programmer to put efforts more efficiently on that part.<br />

Advantages<br />

• Logic Flowcharts are e<strong>as</strong>y to understand. They provide a graphical representation of actions to be<br />

taken.<br />

• Logic Flowcharts are well suited for representing logic where there <strong>is</strong> intermingling among many<br />

actions.<br />

D<strong>is</strong>advantages<br />

• Logic Flowcharts may encourage the use of GoTo statements leading to software design that <strong>is</strong><br />

unstructured with logic that <strong>is</strong> difficult to decipher.<br />

• Without an automated tool, it <strong>is</strong> time-consuming to maintain Logic Flowcharts.<br />

• Logic Flowcharts may be used during detailed logic design to specify a module.<br />

• However, the presence of dec<strong>is</strong>ion boxes may encourage the use of GoTo statements, resulting in<br />

software that <strong>is</strong> not structured. For th<strong>is</strong> re<strong>as</strong>on, Logic Flowcharts may be better used during Structural<br />

Design.<br />

LIMITATIONS OF USING FLOWCHARTS<br />

Complex logic: Sometimes, the program logic <strong>is</strong> quite complicated. In that c<strong>as</strong>e, flowchart becomes<br />

complex and clumsy.<br />

Alterations and Modifications:If alterations are required the flowchart may require re-drawing<br />

completely.<br />

Reproduction:As the flowchart symbols cannot be typed, reproduction of flowchart becomes a<br />

problem.<br />

The essentials of what <strong>is</strong> done can e<strong>as</strong>ily be lost in the technical details of how it <strong>is</strong> done.<br />

GUIDELINES FOR DRAWING A FLOWCHART<br />

a. In drawing a proper flowchart, all necessary requirements should be l<strong>is</strong>ted out in logical order.<br />

b. The flowchart should be clear, neat and e<strong>as</strong>y to follow. There should not be any room for ambiguity in<br />

understanding the flowchart.<br />

c. The usual direction of the flow of a procedure or system <strong>is</strong> from left to right or top to<br />

bottom.<br />

d. Only one flow line should come out from a process symbol.<br />

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


e. Only one flow line should enter a dec<strong>is</strong>ion symbol, but two or three flow lines, one for<br />

each possible answer, should leave the dec<strong>is</strong>ion symbol.<br />

f. Only one flow line <strong>is</strong> used in conjunction with terminal symbol.<br />

g. Write within standard symbols briefly. As necessary, you can use the annotation symbol to<br />

describe <strong>data</strong> or computational steps more clearly.<br />

h. If the flowchart becomes complex, it <strong>is</strong> better to use connector symbols to reduce the<br />

number of flow lines. Avoid the intersection of flow lines if you want to make it more<br />

effective and better way of communication.<br />

i. Ensure that the flowchart h<strong>as</strong> a logical start and fin<strong>is</strong>h.<br />

j. It <strong>is</strong> useful to test the validity of the flowchart by p<strong>as</strong>sing through it with a simple test <strong>data</strong>.<br />

<strong>Question</strong> <strong>No</strong> (15): Describe in detail about algorithm? Give example<br />

Answer: An algorithm <strong>is</strong> a description of a procedure which terminates with a result. Simple algorithms<br />

can be implemented within a function.<br />

Properties of an algorithm<br />

• <strong>No</strong> ambiguity<br />

• There should not be any uncertainty about which instruction to execute next.<br />

• The algorithm should conclude after a finite number of steps.<br />

• The algorithm should be general.<br />

Example:<br />

• Biggest among two numbers<br />

• Addition of N numbers<br />

• Finding Factorial of a number<br />

• Finding Fibonacci series.<br />

Guidelines<br />

• Statements should be in simple Engl<strong>is</strong>h<br />

• Must produce a solution for the specified problem<br />

• It should be conc<strong>is</strong>e<br />

• Each instruction should be written in separate line and express one action.<br />

• Capitalize keywords such <strong>as</strong> READ, PRINT and so on.<br />

• Instruction should be written from top to bottom, with one entry and one exit.<br />

• Should allow e<strong>as</strong>y transition from design to coding in programming language.<br />

Benefits:<br />

• Language Independent.<br />

• E<strong>as</strong>y to develop a program from pseudo code than flowchart.<br />

• E<strong>as</strong>y to translate into programming language.<br />

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


• It <strong>is</strong> compact.<br />

Limitations:<br />

• <strong>No</strong> v<strong>is</strong>ual representation of program logic<br />

• <strong>No</strong> accepted standards for writing pseudo codes.<br />

• Cannot be compiled or executed.<br />

• <strong>No</strong> real form or syntax rules.<br />

Examples:<br />

• Finding a number <strong>is</strong> prime or not<br />

<strong>Question</strong> <strong>No</strong>(16): <strong>Define</strong> Operating System? What are functions and typesof operating System?<br />

Answer: OPERATING SYSTEM: Operating System <strong>is</strong> a software that can be defined <strong>as</strong>:<br />

• An interface between users and hardware - an environment "architecture”<br />

• Allows convenient usage; hides the tedious stuff<br />

• Allows efficient usage; parallel activity, avoids w<strong>as</strong>ted cycles<br />

• Provides information protection<br />

• Gives each user a slice of the resources<br />

• Acts <strong>as</strong> a control program.<br />

Functions of operating System:<br />

• An operting system manages hardware, runs applications, provides an interface for users, and<br />

stores, retrieves, and manipulates files.<br />

• It manages the hardware and software resources of the system.<br />

• It provides a stable, cons<strong>is</strong>tent way for applications to deal with the hardware without having to<br />

know all the details of the hardware.<br />

• System tool (programs) used to monitor <strong>computer</strong> performance,debug,problems, or maintain<br />

parts of the system.<br />

• A set of libraries or functions which may use to perform specific t<strong>as</strong>ks especially relating to<br />

interfacing with <strong>computer</strong> system components.<br />

• It avoids the situation of deadlock.<br />

• It <strong>is</strong> responsible for resource and performance optimization.<br />

• It manages process management and memory management<br />

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


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


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


<strong>Question</strong> <strong>No</strong>(17): What are various Internal and External DOS Commands?<br />

Answer: Internal Commands: The internal commands reside in COMMAND.COM, which loads into<br />

memory when the <strong>computer</strong> system <strong>is</strong> started; these commands do not reside on d<strong>is</strong>k. e.g.<br />

(a) TIME- D<strong>is</strong>plays current time and allows it to be changed.<br />

Syntax: TIME<br />

(b) DATE- D<strong>is</strong>plays current date and allows it to be changed.<br />

Syntax: DATE<br />

(c) CLS- Clears the screen.<br />

Syntax: CLS<br />

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


(d) DIR- Shows directory information of a d<strong>is</strong>kette: name, size, and the date and time stamp of<br />

files.<br />

Syntax: DIR [d:][path]<br />

Optional switches:<br />

/p D<strong>is</strong>play dir info and pauses d<strong>is</strong>play when the screen <strong>is</strong> full<br />

/w D<strong>is</strong>play names and extensions only in five columns<br />

To d<strong>is</strong>play a file directory l<strong>is</strong>ting for D:\LET\ANNUAL<br />

D:\LET\ANNUAL>DIR (from D:\LET\ANNUAL)<br />

D:\DATA>DIR \LET\ANNUAL (from D:\DATA)<br />

C:\WINDOWS>DIR D:\LET\ANNUAL (from C:\WINDOWS)<br />

(e) COPY- Copies a file. Name of copy may be the same <strong>as</strong> original, or different.<br />

Syntax: COPY [d:][path][name.ext] [d:][path][name.ext]<br />

Optional switches:<br />

/v Verify, copies the file and compares it with the original<br />

/b Binary file<br />

To copy a file from D:\BATCH to the root of A: drive<br />

A:\>COPY D:\BATCH\CL.BAT (from A: drive)<br />

D:\BATCH>COPY CL.BAT A:\ (from D:\BATCH)<br />

To copy a file from the root of C: to A: drive and change its name<br />

A:\>COPY C:\MSDOS.SYS MSDOSSYS.BAK (from A:)<br />

C:\>COPY MSDOS.SYS A:\MSDOSSYS.BAK (from the root of C:)<br />

To copy all of the files from the root of A: to D:\CCV\ENGCOMP<br />

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

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

(f) TYPE-D<strong>is</strong>plays the contents of a file.<br />

Syntax: TYPE [d:][path][name.ext]<br />

To d<strong>is</strong>play the contents of the file MY.LET to the screen<br />

A:\>TYPE MY.LET<br />

(g) DEL- Deletes a file from d<strong>is</strong>k.<br />

Syntax: DEL [d:][path][name.ext]<br />

To delete one file:<br />

A:\>DEL A:\MY.LET<br />

To del all files in current directory<br />

A:\>DEL *.*<br />

(h) REN- Renames a file.<br />

Syntax: REN [d:][path][name.ext] [d:][path][newname.ext]<br />

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

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


D:\LET>REN ANNUAL\99.DOC 1999.DOC (from D:\LET)<br />

D:\DATA>REN \LET\ANNUAL\99.DOC 1999.DOC (from D:\DATA)<br />

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

(i) MD- Makes (creates) a new directory.<br />

Syntax: MD [d:][path][dirname]<br />

To create a directory named HERMIT in the root of D: drive<br />

D:\>MD HERMIT (from D:\)<br />

C:\>MD D:\HERMIT (from C:\)<br />

(j) RD- Removes an ex<strong>is</strong>ting directory (directory must be empty).<br />

Syntax: RD [d:][path][dirname]<br />

To remove the HERMIT sub-directory<br />

D:\>RD HERMIT (from D:\)<br />

C:\>RD D:\HERMIT (from C:\)<br />

(k) CD- Changes the current directory.<br />

Syntax: CD [path][dirname]<br />

To make D:\HERMIT the current directory<br />

D:\>CD HERMIT (from D:\)<br />

D:\DATA>CD \HERMIT (from D:\DATA)<br />

D:\DATA\SOURCE>CD \HERMIT (from D:\DATA\SOURCE)<br />

D:\DATA\SOURCE>CD .. (from D:\DATA\SOURCE)<br />

(l) PATH-The PATH command <strong>is</strong> used to help the command interpreter find external commands<br />

which are not in the current directory. The command interpretter looks into the DOS<br />

environment for "PATH=" and then searches the paths (each separated from the next by a<br />

semicolon) that follow.<br />

Syntax: PATH=[path;path;...]<br />

To set the DOS PATH:<br />

PATH=C:\DOS;C:\PCW;\C:\BIN<br />

To d<strong>is</strong>play the current path:<br />

PATH<br />

(m) SET PROMPT- Used to specify the appearance of the DOS prompt.<br />

Syntax: SET PROMPT= (from the command line)<br />

PROMPT= (in a batch file)<br />

To d<strong>is</strong>play current drive & current path followed by ">" <strong>as</strong> prompt<br />

SET PROMPT=$P$G<br />

To d<strong>is</strong>play the current date, time, and drive on separate lines<br />

SET PROMPT $D$_$T$_$N$G<br />

To redefine F9 to CD\Windows\Start Menu\Programs\Startup<br />

SET PROMPT $e[0,67;"'CD\Windows\Start Menu\Programs\Startup'";13p<br />

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


External Commands:-The external commands are files that do reside on d<strong>is</strong>k and have an extension of<br />

.COM, .EXE, or .BAT. Both command types are executed from the MS-DOS prompt. Instructions for<br />

external commands are d<strong>is</strong>k-b<strong>as</strong>ed. Th<strong>is</strong> means the file with the name of the command must be loaded<br />

into RAM at the moment when the command <strong>is</strong> given. Application programs are external commands<br />

and some DOS programs are external. The syntax for some of the more useful DOS external commands,<br />

including their parameters and switches follow:<br />

(a) FORMAT -Prepares a d<strong>is</strong>kette for use by DOS.<br />

Syntax: FORMAT [d:]<br />

Parameters: [d:] = Drive which <strong>is</strong> to receive the format.<br />

Optional switches:<br />

• /s Include all system files necessary to make d<strong>is</strong>k "bootable"<br />

• /b Reserve space for system files on d<strong>is</strong>kette. (Formats 320k instead of 360k).<br />

• /v Volume label of 11 characters<br />

Some examples:<br />

• To format a d<strong>is</strong>kette in drive B: without system files: FORMAT B:<br />

• To format a d<strong>is</strong>kette in drive A: with system files: FORMAT A: /s<br />

• To give the formatted d<strong>is</strong>kette a volume name, include the /v switch: FORMAT A: /V<br />

• Combine switches to format a boot d<strong>is</strong>kette with a volume label:FORMAT A: /S /V<br />

(b) CHKDSK -Analyzes d<strong>is</strong>k or d<strong>is</strong>kette (first and only parameter) and d<strong>is</strong>plays d<strong>is</strong>k and memory<br />

status report.<br />

Syntax: CHKDSK [d:] [/f] [/v]<br />

Parameters: [d:] = Drive upon which to perform the checkd<strong>is</strong>k.<br />

Optional switches:<br />

• /f Fix. Writes lost clusters to a d<strong>is</strong>k file and corrects file allocation table.<br />

• /v Verbose. L<strong>is</strong>ts all files on a d<strong>is</strong>k.<br />

Example:<br />

• To d<strong>is</strong>play stat<strong>is</strong>tics about the d<strong>is</strong>kette in drive A: CHKSDK A:<br />

• To d<strong>is</strong>play stat<strong>is</strong>tics about the first hard d<strong>is</strong>k and fix any lost clusters: CHKSDK A: /f<br />

(c) DISKCOPY-Makes an exact copy of a d<strong>is</strong>kette, including hidden system files if they are present.<br />

Syntax: DISKCOPY [d1:] [d2:]<br />

Parameters:[d1:] = Drive for source d<strong>is</strong>kette, [d2:] = Drive for target d<strong>is</strong>kette.<br />

Example: To make an exact copy of a d<strong>is</strong>kette in drive A: to a d<strong>is</strong>kette in B:DISKCOPY A: B:<br />

• To make an exact copy of a d<strong>is</strong>kette using only drive A: DISKCOPY A: A:<br />

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


DISKCOPY <strong>as</strong>ks for a SOURCE d<strong>is</strong>kette (the d<strong>is</strong>kette being copied) and a TARGET d<strong>is</strong>kette (the d<strong>is</strong>kette<br />

being copied to). The TARGET d<strong>is</strong>kette need not be formatted, DOS will format it while doing the<br />

DISKCOPY. If the SOURCE d<strong>is</strong>kette <strong>is</strong> bootable, the system will be transferred to the TARGET <strong>as</strong> well. The<br />

two d<strong>is</strong>k drives must always use the same media.<br />

<strong>Question</strong> <strong>No</strong>:(19): Explain Architecture of Unix? What are various Unix Commands?<br />

Answer:- UNIXS <strong>is</strong> named after UNICS (UNiplexed Information and Computing Service). Its architecture<br />

can be shown <strong>as</strong> below:<br />

(1)UNIX Shell- Shell <strong>is</strong> an ordinary user program – needs the ability to read from and write to the<br />

terminal, and execute other programs, Commands may take arguments, which are p<strong>as</strong>sed to the<br />

called program <strong>as</strong> character strings<br />

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


Shell does not have to open terminal, but it h<strong>as</strong> access automatically to a file ‘standard input’<br />

(for reading), file ‘standard output’ (for writing normal output), and file ‘standard error’ (for<br />

writing error messages)<br />

Shell can redirect standard input/output to files<br />

It can also use Pipe symbol<br />

Example: grep ter *.t | sort >out<br />

Possible pipeline – sequence of pipe symbols<br />

Single user can run several programs at once<br />

Shell syntax for running a program in the background – use &<br />

Example: wc –l b &<br />

Shell scripts refers to the files containing shell command<br />

UNIX Utility Programs- refers to standard application available with UNIX.<br />

Large number of utility programs<br />

Divided into six categories<br />

File and directory manipulation commands<br />

Example: cp a b | ls *.*<br />

Filters<br />

Example: grep (extracts lines containing patterns), cut, p<strong>as</strong>te,<br />

Program development tools such <strong>as</strong> editors/compilers<br />

Example: cc (C compiler), make (maintain large programs whose source code<br />

cons<strong>is</strong>ts of multiple files)<br />

Text processing<br />

Example: vi<br />

System admin<strong>is</strong>tration<br />

Example: mount (mount file system)<br />

M<strong>is</strong>cellaneous<br />

Example: kill 1325 (kill a process), chmod (change privileges of a file)<br />

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


UNIX Kernel- <strong>is</strong> the heart of the operating system with following structure:<br />

All UNIX drivers are cl<strong>as</strong>sified <strong>as</strong> either character device drivers (mouse, keyboard) or block<br />

device drivers (d<strong>is</strong>k)<br />

Network device drivers (possible character devices, but handled very differently)<br />

Process d<strong>is</strong>patching – when interrupt happens, context switch happens between processes<br />

Editors such <strong>as</strong> vi/emacs need raw tty<br />

Shell <strong>is</strong> line oriented, hence uses cooked mode and line d<strong>is</strong>ciplines<br />

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


Networking software <strong>is</strong> layered with MAC/Routing/Transport layers and Socket interface<br />

On top of buffer cache sits file system<br />

Most UNIX systems support multiple file systems<br />

Berkeley f<strong>as</strong>t file system<br />

Log-structured file system<br />

Various System V file systems<br />

On top of file system comes file naming, directory management, hard link and symbolic link<br />

management, etc<br />

On top page cache sits virtual memory (VM)<br />

All paging logic <strong>is</strong> here, such <strong>as</strong> replacement algorithm<br />

On top of VM <strong>is</strong> mapping files onto VM and high level page fault management code<br />

Figure out what to do when a page fault occurs<br />

On top of process d<strong>is</strong>patching <strong>is</strong> process management<br />

Process scheduler to choose which process to run next<br />

If threads are managed in the kernel, thread management <strong>is</strong> also here<br />

<strong>No</strong>te in some UNIX systems, threads are managed in user space<br />

On top of scheduling we have signal processing and process creation and termination<br />

Top layer h<strong>as</strong> the system call interface<br />

All system calls are directed to one of the lower modules, depending on the nature of<br />

the call<br />

Top layer also h<strong>as</strong> entrance to interrupts and traps Entrance to signals, page faults,<br />

processor exceptions of all kinds, I/O interrupts<br />

Various Commands Of Unix:-<br />

Directories:File and directory paths in UNIX use the forward sl<strong>as</strong>h "/"<br />

to separate directory names in a path.<br />

examples:<br />

/ "root" directory<br />

/usr directory usr (sub-directory of / "root" directory)<br />

/usr/STRIM100 STRIM100 <strong>is</strong> a subdirectory of /usr<br />

Moving around the file system:<br />

• pwd Show the "present working directory", or current directory.<br />

• cd Change current directory to your HOME directory.<br />

• cd .. Change current directory to the parent directory of the current directory.<br />

• cd $STRMWORK: Change current directory to the directory defined by the environment variable<br />

'STRMWORK'.<br />

• cd ~bob:Change the current directory to the user bob's home directory (if you have perm<strong>is</strong>sion).<br />

L<strong>is</strong>ting directory contents:<br />

ls l<strong>is</strong>t a directory<br />

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


ls -l l<strong>is</strong>t a directory in long ( detailed ) format<br />

for example:<br />

$ ls -l<br />

drwxr-xr-x 4 cliff user 1024 Jun 18 09:40 WAITRON_EARNINGS<br />

-rw-r--r-- 1 cliff user 767392 Jun 6 14:28 scanlib.tar.gz<br />

^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^<br />

| | | | | | | | | | |<br />

| | | | | owner group size date time name<br />

| | | | number of links to file or directory contents<br />

| | | perm<strong>is</strong>sions for world<br />

| | perm<strong>is</strong>sions for members of group<br />

| perm<strong>is</strong>sions for owner of file: r = read, w = write, x = execute -=no perm<strong>is</strong>sion<br />

type of file: - = normal file, d=directory, l = symbolic link, and others...<br />

ls -a L<strong>is</strong>t the current directory including hidden files. Hidden files start<br />

with "."<br />

ls -ld * L<strong>is</strong>t all the file and directory names in the current directory using long format. Without the "d"<br />

option, ls would l<strong>is</strong>t the contents of any sub-directory of the current. With the "d" option, ls<br />

just l<strong>is</strong>ts them like regular files.<br />

Changing file perm<strong>is</strong>sions and attributes<br />

chmod 755 file Changes the perm<strong>is</strong>sions of file to be rwx for the owner, and rx for the group and the<br />

world. (7 = rwx = 111 binary. 5 = r-x = 101 binary)<br />

chgrp user file Makes file belong to the group user.<br />

chown cliff file Makes cliff the owner of file.<br />

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

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

Moving, renaming, and copying files:<br />

cp file1 file2 copy a file<br />

mv file1 newname move or rename a file<br />

mv file1 ~/AAA/ move file1 into sub-directory AAA in your home directory.<br />

rm file1 [file2 ...] remove or delete a file<br />

rm -r dir1 [dir2...] recursively remove a directory and its contents BE CAREFUL!<br />

mkdir dir1 [dir2...] create directories<br />

mkdir -p dirpath create the directory dirpath, including all implied directories in the path.<br />

rmdir dir1 [dir2...] remove an empty directory<br />

Viewing and editing files:<br />

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


cat filename Dump a file to the screen in <strong>as</strong>cii.<br />

more filename Progressively dump a file to the screen: ENTER = one line down<br />

SPACEBAR = page down q=quit<br />

less filename Like more, but you can use Page-Up too. <strong>No</strong>t on all systems.<br />

vi filename Edit a file using the vi editor. All UNIX systems will have<br />

head filename Show the first few lines of a file.<br />

head -n filename Show the first n lines of a file.<br />

tail filename Show the l<strong>as</strong>t few lines of a file.<br />

tail -n filename Show the l<strong>as</strong>t n lines of a file.<br />

Shells :The behavior of the command line interface will differ slightly depending on the shell program<br />

that <strong>is</strong> being used.Depending on the shell used, some extra behaviors can be quite nifty.You can find out<br />

what shell you are using by the command:<br />

echo $SHELL<br />

Of course you can create a file with a l<strong>is</strong>t of shell commands and execute it like a program to perform a<br />

t<strong>as</strong>k. Th<strong>is</strong> <strong>is</strong> called a shell script. Th<strong>is</strong> <strong>is</strong> in fact the primary purpose of most shells, not the interactive<br />

command line behavior.<br />

Environment variables<br />

You can teach your shell to remember things for later using environment variables.For example under<br />

the b<strong>as</strong>h shell:<br />

export CASROOT=/usr/local/CAS3.0 <strong>Define</strong>s the variable CASROOT with the value<br />

/usr/local/CAS3.0.<br />

export LD_LIBRARY_PATH=$CASROOT/Linux/lib <strong>Define</strong>s the variable LD_LIBRARY_PATH with the<br />

value of CASROOT with /Linux/lib appended, or /usr/local/CAS3.0/Linux/lib<br />

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

cd $CASROOT Changes your present working directory to the value of CASROOT<br />

echo $CASROOT Prints out the value of CASROOT, or /usr/local/CAS3.0<br />

printenv CASROOT Does the same thing in b<strong>as</strong>h and some other shells.<br />

Interactive H<strong>is</strong>tory: A feature of b<strong>as</strong>h and tcsh (and sometimes others) you can use the up-arrow keys to<br />

access your previous commands, edit<br />

them, and re-execute them.<br />

Redirection:<br />

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


grep string filename > newfile Redirects the output of the above grep<br />

command to a file 'newfile'.<br />

grep string filename >> ex<strong>is</strong>tfile Appends the output of the grep command to the end of 'ex<strong>is</strong>tfile'.<br />

The redirection directives, > and >> can be used on the output of most commands to direct their output<br />

to a file.<br />

Pipes:<br />

The pipe symbol "|" <strong>is</strong> used to direct the output of one command to the input<br />

of another.<br />

For example:<br />

ls -l | more Th<strong>is</strong> commands takes the output of the long format directory l<strong>is</strong>t command<br />

"ls -l" and pipes it through the more command (also <strong>known</strong> <strong>as</strong> a filter).<br />

In th<strong>is</strong> c<strong>as</strong>e a very long l<strong>is</strong>t of files can be viewed a page at a time.<br />

du -sc * | sort -n | tail<br />

The command "du -sc" l<strong>is</strong>ts the sizes of all files and directories in the<br />

current working directory. That <strong>is</strong> piped through "sort -n" which orders the<br />

output from smallest to largest size. Finally, that output <strong>is</strong> piped through "tail"<br />

which d<strong>is</strong>plays only the l<strong>as</strong>t few (which just happen to be the largest) results.<br />

Command Substitution<br />

You can use the output of one command <strong>as</strong> an input to another command in another way called<br />

command substitution. Command substitution <strong>is</strong> invoked when by enclosing the substituted command<br />

in backwards single quotes. For example:<br />

cat `find . -name aaa.txt`<br />

which will cat ( dump to the screen ) all the files named aaa.txt that ex<strong>is</strong>t in the current directory or in<br />

any subdirectory tree.<br />

Searching for strings in files: The grep command<br />

grep string filename prints all the lines in a file that contain the string<br />

Searching for files : The find command<br />

find search_path -name filename<br />

find . -name aaa.txt Finds all the files named aaa.txt in the current directory or<br />

any subdirectory tree.<br />

find / -name vimrc Find all the files named 'vimrc' anywhere on the system.<br />

find /usr/local/games -name "*xpilot*"<br />

Find all files whose names contain the string 'xpilot' which<br />

ex<strong>is</strong>t within the '/usr/local/games' directory tree.<br />

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


Reading and writing tapes, backups, and archives: The tar command<br />

The tar command stands for "tape archive". It <strong>is</strong> the "standard" way to read<br />

and write archives (collections of files and whole directory trees).<br />

Often you will find archives of stuff with names like stuff.tar, or stuff.tar.gz. Th<strong>is</strong><br />

<strong>is</strong> stuff in a tar archive, and stuff in a tar archive which h<strong>as</strong> been compressed using the<br />

gzip compression program respectivly.<br />

Chances are that if someone gives you a tape written on a UNIX system, it will be in tar format,<br />

and you will use tar (and your tape drive) to read it.<br />

Likew<strong>is</strong>e, if you want to write a tape to give to someone else, you should probably use<br />

tar <strong>as</strong> well.<br />

Tar examples:<br />

tar xv Extracts (x) files from the default tape drive while l<strong>is</strong>ting (v = verbose)<br />

the file names to the screen.<br />

tar tv L<strong>is</strong>ts the files from the default tape device without extracting them.<br />

tar cv file1 file2<br />

Write files 'file1' and 'file2' to the default tape device.<br />

tar cvf archive.tar file1 [file2...]<br />

Create a tar archive <strong>as</strong> a file "archive.tar" containing file1,<br />

file2...etc.<br />

tar xvf archive.tar extract from the archive file<br />

tar cvfz archive.tar.gz dname<br />

Create a gzip compressed tar archive containing everything in the directory<br />

'dname'. Th<strong>is</strong> does not work with all versions of tar.<br />

tar xvfz archive.tar.gz<br />

Extract a gzip compressed tar archive. Does not work with all versions of tar.<br />

tar cvfI archive.tar.bz2 dname<br />

Create a bz2 compressed tar archive. Does not work with all versions of tar<br />

File compression: compress, gzip, and bzip2<br />

The standard UNIX compression commands are compress and uncompress. Compressed files have<br />

a suffix .Z added to their name. For example:<br />

compress part.igs Creates a compressed file part.igs.Z<br />

uncompress part.igs Uncompresse<strong>is</strong> part.igs from the compressed file part.igs.Z. <strong>No</strong>te the .Z<br />

<strong>is</strong> not required.<br />

Another common compression utility <strong>is</strong> gzip (and gunzip). These are the GNU compress and<br />

uncompress utilities. gzip usually gives better compression than standard compress,<br />

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


ut may not be installed on all systems. The suffix for gzipped files <strong>is</strong> .gz<br />

gzip part.igs Creates a compressed file part.igs.gz<br />

gunzip part.igs Extracts the original file from part.igs.gz<br />

The bzip2 utility h<strong>as</strong> (in general) even better compression than gzip, but at the cost of longer<br />

times to compress and uncompress the files. It <strong>is</strong> not <strong>as</strong> common a utility <strong>as</strong> gzip, but <strong>is</strong><br />

becoming more generally available.<br />

bzip2 part.igs Create a compressed Iges file part.igs.bz2<br />

bunzip2 part.igs.bz2 Uncompress the compressed iges file.<br />

Looking for help: The man and apropos commands<br />

Most of the commands have a manual page which give sometimes useful, often more or less detailed,<br />

sometimes cryptic and unfathomable d<strong>is</strong>criptions of their usage. Some say they<br />

are called man pages because they are only for real men.<br />

Example:<br />

man ls Shows the manual page for the ls command<br />

You can search through the man pages using apropos<br />

Example:<br />

apropos build Shows a l<strong>is</strong>t of all the man pages whose d<strong>is</strong>criptions contain the word "build"<br />

Do a man apropos for detailed help on apropos.<br />

B<strong>as</strong>ics of the vi editor<br />

Opening a file<br />

vi filename<br />

Creating text<br />

Edit modes: These keys enter editing modes and type in the text<br />

of your document.<br />

i Insert before current cursor position<br />

I Insert at beginning of current line<br />

a Insert (append) after current cursor position<br />

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


A Append to end of line<br />

r Replace 1 character<br />

R Replace mode<br />

Terminate insertion or overwrite mode<br />

Deletion of text<br />

x Delete single character<br />

dd Delete current line and put in buffer<br />

ndd Delete n lines (n <strong>is</strong> a number) and put them in buffer<br />

J Attaches the next line to the end of the current line (deletes carriage return).<br />

Oops<br />

u Undo l<strong>as</strong>t command<br />

cut and p<strong>as</strong>te<br />

yy Yank current line into buffer<br />

nyy Yank n lines into buffer<br />

p Put the contents of the buffer after the current line<br />

P Put the contents of the buffer before the current line<br />

cursor positioning<br />

^d Page down<br />

^u Page up<br />

:n Position cursor at line n<br />

:$ Position cursor at end of file<br />

^g D<strong>is</strong>play current line number<br />

h,j,k,l Left,Down,Up, and Right respectivly. Your arrow keys should also work if<br />

if your keyboard mappings are anywhere near sane.<br />

string substitution<br />

:n1,n2:s/string1/string2/[g] Substitute string2 for string1 on lines<br />

n1 to n2. If g <strong>is</strong> included (meaning global),<br />

all instances of string1 on each line<br />

are substituted. If g <strong>is</strong> not included,<br />

only the first instance per matching line <strong>is</strong><br />

substituted.<br />

^ matches start of line<br />

. matches any single character<br />

$ matches end of line<br />

These and other "special characters" (like the forward sl<strong>as</strong>h) can be "escaped" with \<br />

i.e to match the string "/usr/STRIM100/SOFT" say "\/usr\/STRIM100\/SOFT"<br />

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


Examples:<br />

:1,$:s/dog/cat/g Substitute 'cat' for 'dog', every instance<br />

for the entire file - lines 1 to $ (end of file)<br />

:23,25:/frog/bird/ Substitute 'bird' for 'frog' on lines<br />

23 through 25. Only the first instance<br />

on each line <strong>is</strong> substituted.<br />

Saving and quitting and other "ex" commands<br />

These commands are all prefixed by pressing colon (:) and then entered in the lower<br />

left corner of the window. They are called "ex" commands because they are commands<br />

of the ex text editor - the precursor line editor to the screen editor<br />

vi. You cannot enter an "ex" command when you are in an edit mode (typing text onto the screen)<br />

Press to exit from an editing mode.<br />

:w Write the current file.<br />

:w new.file Write the file to the name 'new.file'.<br />

:w! ex<strong>is</strong>ting.file Overwrite an ex<strong>is</strong>ting file with the file currently being edited.<br />

:wq Write the file and quit.<br />

:q Quit.<br />

:q! Quit with no changes.<br />

:e filename Open the file 'filename' for editing.<br />

:set number Turns on line numbering<br />

:set nonumber Turns off line numbering<br />

<strong>Question</strong> <strong>No</strong>:(20) What are the character<strong>is</strong>tics of structure programming?<br />

Answer:-Structured programming (sometimes <strong>known</strong> <strong>as</strong> modular programming) <strong>is</strong> a subset of<br />

procedural programming that enforces a logical structure on the program being written to make it more<br />

efficient and e<strong>as</strong>ier to understand and modify.<br />

Certain languages such <strong>as</strong> Ada, P<strong>as</strong>cal, and dBASE are designed with features that encourage or enforce<br />

a logical program structure.<br />

Structured programming frequently employs a top-down design model, in which developers map out<br />

the overall program structure into separate subsections. A defined function or set of similar functions <strong>is</strong><br />

coded in a separate module or submodule, which means that code can be loaded into memory<br />

more efficiently and that modules can be reused in other programs. After a module h<strong>as</strong> been tested<br />

individually, it <strong>is</strong> then integrated with other modules into the overall program structure.<br />

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


Program flow follows a simple hierarchical model that employs looping constructs such <strong>as</strong> "for,"<br />

"repeat," and "while." Use of the "Go To" statement <strong>is</strong> d<strong>is</strong>couraged.<br />

Structured programming w<strong>as</strong> first suggested by Corrado Bohm and Gu<strong>is</strong>eppe Jacopini. The two<br />

mathematicians demonstrated that any <strong>computer</strong> program can be written with just three structures:<br />

dec<strong>is</strong>ions, sequences, and loops.<br />

<strong>Question</strong> <strong>No</strong>:(21) What <strong>is</strong> Top-Down and bottom up approach of programming?<br />

Answer:-Top-down and bottom-up are strategies of information processing and knowledge ordering,<br />

mostly involving software, but also other human<strong>is</strong>tic and scientific theories. In practice, they can be seen<br />

<strong>as</strong> a style of thinking and teaching. In many c<strong>as</strong>es top-down <strong>is</strong> used <strong>as</strong> a synonym of analys<strong>is</strong> or<br />

decomposition, and bottom-up of synthes<strong>is</strong>.<br />

A top-down approach (also <strong>known</strong> <strong>as</strong> stepw<strong>is</strong>e design) <strong>is</strong> essentially the breaking down of a system to<br />

gain insight into its compositional sub-systems. In a top-down approach an overview of the system <strong>is</strong><br />

formulated, specifying but not detailing any first-level subsystems. Each subsystem <strong>is</strong> then refined in yet<br />

greater detail, sometimes in many additional subsystem levels, until the entire specification <strong>is</strong> reduced<br />

to b<strong>as</strong>e elements. A top-down model <strong>is</strong> often specified with the <strong>as</strong>s<strong>is</strong>tance of "black boxes", these make<br />

it e<strong>as</strong>ier to manipulate. However, black boxes may fail to elucidate elementary mechan<strong>is</strong>ms or be<br />

detailed enough to real<strong>is</strong>tically validate the model.<br />

A bottom-up approach <strong>is</strong> the piecing together of systems to give r<strong>is</strong>e to grander systems, thus making<br />

the original systems sub-systems of the emergent system. Bottom-up processing <strong>is</strong> a type of information<br />

processing b<strong>as</strong>ed on incoming <strong>data</strong> from the environment to form a perception. Information enters the<br />

eyes in one direction (input), and <strong>is</strong> then turned into an image by the brain that can be interpreted and<br />

recognized <strong>as</strong> a perception (output). In a bottom-up approach the individual b<strong>as</strong>e elements of the<br />

system are first specified in great detail. These elements are then linked together to form larger<br />

subsystems, which then in turn are linked, sometimes in many levels, until a complete top-level system<br />

<strong>is</strong> formed. Th<strong>is</strong> strategy often resembles a "seed" model, whereby the beginnings are small but<br />

eventually grow in complexity and completeness. However, "organic strategies" may result in a tangle of<br />

elements and subsystems, developed in <strong>is</strong>olation and subject to local optimization <strong>as</strong> opposed to<br />

meeting a global purpose.<br />

<strong>Question</strong> <strong>No</strong>:(22) What <strong>is</strong> IEEE- floating point notation?<br />

Answer:-The IEEE standard for floating point arithmetic:The IEEE (Institute of Electrical and Electronics<br />

Engineers) h<strong>as</strong> produced a standard for floating point arithmetic. Th<strong>is</strong> standard specifies how single<br />

prec<strong>is</strong>ion (32 bit) and double prec<strong>is</strong>ion (64 bit) floating point numbers are to be represented, <strong>as</strong> well <strong>as</strong><br />

how arithmetic should be carried out on them.<br />

The differences in the formats also affect the accuracy of floating point computations.<br />

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


Summary:<br />

Single Prec<strong>is</strong>ion:<br />

The IEEE single prec<strong>is</strong>ion floating point standard representation requires a 32 bit word, which may be<br />

represented <strong>as</strong> numbered from 0 to 31, left to right. The first bit <strong>is</strong> the sign bit, S, the next eight bits are<br />

the exponent bits, 'E', and the final 23 bits are the fraction 'F':<br />

S EEEEEEEE FFFFFFFFFFFFFFFFFFFFFFF<br />

0 1 8 9 31<br />

The value V represented by the word may be determined <strong>as</strong> follows:<br />

• If E=255 and F <strong>is</strong> nonzero, then V=NaN ("<strong>No</strong>t a number")<br />

• If E=255 and F <strong>is</strong> zero and S <strong>is</strong> 1, then V=-Infinity<br />

• If E=255 and F <strong>is</strong> zero and S <strong>is</strong> 0, then V=Infinity<br />

• If 0


Double Prec<strong>is</strong>ion<br />

The IEEE double prec<strong>is</strong>ion floating point standard representation requires a 64 bit word, which may be<br />

represented <strong>as</strong> numbered from 0 to 63, left to right. The first bit <strong>is</strong> the sign bit, S, the next eleven bits<br />

are the exponent bits, 'E', and the final 52 bits are the fraction 'F':<br />

S EEEEEEEEEEE FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF<br />

0 1 11 12 63<br />

The value V represented by the word may be determined <strong>as</strong> follows:<br />

• If E=2047 and F <strong>is</strong> nonzero, then V=NaN ("<strong>No</strong>t a number")<br />

• If E=2047 and F <strong>is</strong> zero and S <strong>is</strong> 1, then V=-Infinity<br />

• If E=2047 and F <strong>is</strong> zero and S <strong>is</strong> 0, then V=Infinity<br />

• If 0 All Programs >> Microsoft V<strong>is</strong>ual C++ 2010 Express Edition >> V<strong>is</strong>ual Studio Tools >><br />

V<strong>is</strong>ual Studio 2010 Command Prompt]. Run with admin<strong>is</strong>trator privileges.<br />

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

C:> edit myprogram.c<br />

3. After written the program, to compile it, <strong>is</strong>sue the command cl<br />

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


C:> cl myprogram.c<br />

4. During the compilation and linking, myprogram.obj and myprogram.exe will be created.To run the<br />

program:<br />

C:> myprogram<br />

Using V<strong>is</strong>ual C++ 2010 IDE<br />

1. Create an empty project by select [File >> New >> Project]. Select [General >> Empty Project] and type<br />

in the project name. Alternatively, you can select [File >> New >> Project], follow by [Win32 >> Win32<br />

Console Application]. Type in the project name.<br />

2. If you use Win32 Console Application, you can skip th<strong>is</strong> step. Under [Solution Explorer], right click the<br />

project name, and select [Properties]. Select [Configuration Properties >> Linker >> System]. Under<br />

[SubSystem], select [Console (/SUBSYSTEM:CONSOLE)].<br />

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

4. Under Code, Select C++ File (.cpp), however, when you type in the name use a program name with<br />

extension .c, such <strong>as</strong> myprog.c and click [Add].<br />

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

6. To compile the program, under [Solution Explorer, Source File], right click the source file and select<br />

[Compile or (Ctrl+F7)].<br />

7. Ple<strong>as</strong>e note that you cannot run the program until you have build solution.<br />

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

9. To run the program without debugging, select [Debug >> Start without debugging or (Ctrl+F5)]. (<strong>No</strong>te:<br />

If you do not have th<strong>is</strong> option, you need to add the command manually under Tools >> Customize. You<br />

may add a menu option or a button in the Debug toolbar.)<br />

10. For any runtime error, you can debug the program <strong>as</strong> follows; Select [Debug >> Start debugging<br />

(F5)].<br />

11. Ple<strong>as</strong>e note that during debugging, the program will show and close the console d<strong>is</strong>play<br />

immediately.<br />

12. To see the console d<strong>is</strong>play, you must run without debugging.<br />

<strong>No</strong>te:<br />

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


The problem using V<strong>is</strong>ual Studio <strong>is</strong> that many files will be created even for a very simple program. All<br />

files are created inside the project folder.<br />

Under the project name of your program, the source code and object file <strong>is</strong> located at sub folder similar<br />

to your project name, the executable file <strong>is</strong> under sub folder .<br />

It <strong>is</strong> simpler to use the command line to compile and run a C program, however, you could use the IDE<br />

for writing a properly formatted C program.<br />

[In addition to above students must exhaustively practice on the<br />

Exerc<strong>is</strong>es given in the cl<strong>as</strong>sroom on Flow Charts, Algorithms and<br />

Number Conversions]<br />

[Also practice first 2 questions from all FCP question papers of l<strong>as</strong>t<br />

three years of UTU]<br />

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

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!