You are on page 1of 58

Spring 2012 Master of Computer Application (MCA) Semester III MC0071 Software Engineering 4 Cre its (!

(!oo" I#$ !0%0% & !0%0') Assignment Set 1 ((0 Mar"s) )1* +,at o -ou un erstan .- information eterminac-/ Information determinacy refers to the predictability of the order and timing of information.An engineering analysis program accepts data that have a predefined order, executes the analysis algorithm without interruption and produces resultant data in report or graphical format. Such applications are determinate. A multi-user operating system, on the other hand, accepts inputs that have varied content and arbitrary timing, executes algorithms that can be interrupted by external conditions, and produces output that varies as a function of environment and time. Applications with these characteristics are indeterminate. It is some what difficult to develop meaningful generic categories for software applications. As software complexity grows, neat compartmentalization disappears. The following software areas indicate the breadth of potential applications S-stem software$ System software is a collection of programs written to service other programs. Some system software process complex information structures. !ther systems applications process largely indeterminate data. It is characterized by heavy interaction with hardware, heavy usage by multiple users, concurrent operation that re"uires scheduling, resource sharing, and sophisticated process management, complex data structures and multiple external interfaces. 0eal time software$ Software that monitors#analyzes#controls real-world events as they occur is called real time. $lements of real-time software include a data gathering component that collects and formats information from an external environment, an analysis component that transforms information as re"uired by the application, a control#output component that responds to the external environment, and a monitoring component that coordinates all other components so that realtime response %typically ranging from & millisecond to & second' can be maintained. !usiness Software$ (usiness information processing is the largest single software application area. )iscrete systems li*e payroll, accounts receivable#payable have evolved into management information systems %+IS' software that accesses one or more large databases containing business information. Applications in this area restructure existing data in a way that facilitates business operations or management decision ma*ing. Engineering an scientific software$ $ngineering and scientific software has been characterized by ,number crunching- algorithms. Applications range from astronomy to volcano logy, from automotive stress analysis to space shuttle orbital dynamics and from molecular biology to automated manufacturing.

Em.e e software$ $mbedded software resides only in read-only memory and is used to control products and systems for the consumer and industrial mar*ets. $mbedded software can provide very limited and esoteric functions or provide significant function and control capability.

Dinesh (521138580)

1ersonal computer software$ )ay to day useful applications li*e word processing, spreadsheets, multimedia, database management, personal and business financial applications are some of the common examples for personal computer software. +e.2.ase software$ The web pages retrieved by a browser are software that incorporates executable instructions and data. In essence, the networ* becomes a massive computer providing an almost unlimited software resource that can be accessed by anyone with a modem. Artificial Intelligence software$ Artificial Intelligence software ma*es use of non-numerical algorithms to solve complex problems that are not amenable to computation or straight forward analysis. $xpert systems, also called *nowledge based systems, pattern recognition, game playing are representative examples of applications within this category. Software crisis$ The set of problems that are encountered in the development of computer software is not limited to software that does not function properly rather the affliction encompasses problems associated with how we develop software, how we support a growing volume of existing software, and how we can expect to *eep pace with a growing demand for more software

)2*+,- is it inappropriate to use relia.ilit- metrics3 w,ic, were e4elope for ,ar ware s-stems in estimating software s-stem relia.ilit-/ Illustrate -our answer wit, an e5ample/ It is inappropriate to use reliability metrics, which were developed for hardware systems in estimating software system reliability because ./ardware metrics are not suitable for software since its metrics are based on notion of component failure. .Software failures are often design failures .!ften the system is available after the failure has occurred ./ardware components can wear out Since Software 0eliability is one of the most important aspects of software "uality, 0eliability engineering approaches is practiced in software field as well.Software 0eliability $ngineering %S0$' is the "uantitative study of the operational behavior of software-based systems with respect to user re"uirements concerning reliability. Software 0eliability +odels A proliferation of software reliability models have emerged as people try to understand the characteristics of how and why software fails, and try to "uantify software reliability. !ver 122 models have been developed since the early &342s, but how to "uantify software reliability still remains largely unsolved. As many models as there are and many more emerging, none of the models can capture a satisfying amount of the complexity of software5 constraints and assumptions have to be made for the "uantifying process. Therefore, there is no single model that can be used in all situations. 6o model is complete or

MC0071, MC0072,MC0073,MC0074,MC0075

Page 2

Dinesh (521138580)
even representative. !ne model may wor* well for a set of certain software, but may be completely off trac* for other *inds of problems. +ost software models contain the following parts assumptions, factors, and a mathematical function that relates the reliability with the factors. The mathematical function is usually higher order exponential or logarithmic. Software 0eliability +etrics +easurement is commonplace in other engineering field, but not in software engineering. Though frustrating, the "uest of "uantifying software reliability has never ceased. 7ntil now, we still have no good way of measuring software reliability. +easuring software reliability remains a difficult problem because we don8t have a good understanding of the nature of software. There is no clear definition to what aspects are related to software reliability. 9e cannot find a suitable way to measure software reliability, and most of the aspects related to software reliability. $ven the most obvious product metrics such as software size have not uniform definition. Software 0eliability Improvement Techni"ues :ood engineering methods can largely improve software reliability. (efore the deployment of software products, testing, verification and validation are necessary steps. Software testing is heavily used to trigger, locate and remove software defects. Software testing is still in its infant stage5 testing is crafted to suit specific needs in various software development pro;ects in an ad-hoc manner. <arious analysis tools such as trend analysis, fault-tree analysis, !rthogonal )efect classification and formal methods, etc., canals are used to minimize the possibility of defect occurrence after release and therefore improve software reliability. After deployment of the software product, field data can be gathered and analyzed to study the behavior of software defects. =ault tolerance or fault#failure forecasting techni"ues will be helpful techni"ues and guide rules to minimize fault occurrence or impact of the fault on the system. )6* 7sing e5amples e5plain t,e ifference .etween o.8ect & an o.8ect class/ An ob;ect is an entity that has a state and a defined set of operations, which operate, on that state. The state is represented as a set of ob;ect attributes. The operations associated with the ob;ect provide services to other ob;ects %clients' which re"uest these services when some computation is re"uired. !b;ects are created according to some ob;ect class definition. An ob;ect class definition serves as a template for ob;ects. It includes declarations of all the attributes and services which should be associated with an ob;ect of that class. An ob;ect oriented design process is normally concerned with designing ob;ect classes. 9hen the design is implemented, the re"uired ob;ects are created using these class definitions. !b;ects communicate by re"uesting services from other ob;ects and, if necessary, exchange information re"uired for service provision. In some distributed systems, ob;ect communications are implemented directly as text messages, which are exchanged by ob;ects. The receiving ob;ect parses the message, identifies the service and the associated data and carries out the re"uested service.=or good design we have to hide information so the representation of the ob;ect should not be accessible from outside the ob;ect. 9hen the ob;ect design is developed, the attributes should be accessed and modified through appropriate access and update functions. This allows there presentation to be changed at a later stage in the design or implementation process without affecting other ob;ects. So let8s now use an example to clarify what the differences are between a class and an ob;ect class. >et us consider the class car. ?ars have a body, wheels, an engine, and seats, are used to transport people between locations, and re"uire at least one person in the car for it to move by its own power. These are some of the attributes of the class -car -and all members that this class has ever or will ever have share these attributes. The members of the class -car @are ob;ects and the ob;ects are individual and specific cars. $ach individual car has a creation date %an example of an ob;ect having an attribute that is static', an owner, a registered address

MC0071, MC0072,MC0073,MC0074,MC0075

Page 3

Dinesh (521138580)
%examples of attributes that may or may not change', a current location, current occupants, current fuel level %examples of attributes that change "uic*ly', and it may be covered by insurance %an example of an attribute that may or may not exist'.To use a more programming related example, the class window has edges, a title bar, maximize and minimize buttons, and an area to display the window contents. Specific window has a location on the screen, a size,a title, and may or may not have something in the content area.So basically the difference between a class and an ob;ect is that a class is a general concept while ob;ects are the specific and real instances that embody that concept. 9hen creating an ob;ect-oriented program we define the classes and the relationships between the classes. 9e then execute the program to create, update, and destroy the ob;ects which are the specific realization of these classes. )4* +,at is t,e importance of 9Software :ali ation;3 in testing/ <alidation chec*s that the product design satisfies or fits the intended usage %high-level chec*ing'-i.e., you built the right product. This is done through dynamic testing and other forms of review. According to the ?apability +aturity +odel, <erification The process of evaluating software to determine whether the products of given development phase satisfy the conditions imposed at the start of that phase. <alidation The process of evaluating software during or at the end of the development process to determine whether it satisfies specified re"uirements. <alidation ensures that the product actually meets the user8s needs, and that the specifications were correcting the first place, while verification is ensuring that the product has been built according to the re"uirements and design specifications. <alidation ensures that Ayou built the right thingB. <erification ensures that ,you built it right-. <alidation confirms that the product, as provided, will fulfill its intended use. =rom testing perspective =ault -wrong or missing function in the code. =ailure -the manifestation of a fault during execution. +alfunction -according to its specification the system does not meet its specified functionality. 9ithin the modeling and simulation community, the definitions of validation, verification and accreditation are similar <alidation is the process of determining the degree to which a model, simulation, or federation of models and simulations, and their associated data are accurate representations of the real world from the perspective of the intended use%s'. Accreditation is the formal certification that a model or simulation is acceptable to be used for a specific purpose

MC0071, MC0072,MC0073,MC0074,MC0075

Page 4

Dinesh (521138580)
<erification is the process of determining that a computer model, simulation, or federation of models and simulations implementations and their associated data accurately represents the developer8s conceptual description and specifications. )<*E5plain w,- a software s-stem w,ic, is use in a real2worl en4ironment must c,ange or .ecome progressi4el- less useful/ >arge software systems may be considered as configuration of components. )uring the right time, these systems evolve. +any different versions, made up of different component configurations of the system are created. ?onfiguration management %?+' is the process, which controls the changes made to a system, and manages the different versions of the evolving software product. ?onfiguration management involves the development and application of procedures and standards for managing an evolving system product. Crocedures should be developed for building systems and releasing them to customers. Standards should be developed for recording and processing proposed system changes and identifying and storing different versions of the system. The process of changing a system after it has been delivered and is in use is called software maintenance The changes may involve simple changes to correct coding errors, more extensive changes to correct design errors or significant enhancement to correct specification errors or accommodate new re"uirements. +aintenance therefore, in this context, means evaluation. It is the process of changing the system to maintain its ability to survive. Software re-engineering is concerned with ta*ing existing legacy systems and re implementing them to ma*e it more maintainable. As part of this re-engineering process, the system may be re-documented or restructured. It may be translated to a more modern programming language, implemented on a distributed platform rather than mainframe or its data may be migrated to a different database management system. Software 0efactoring is the process of factoring the design module. !b;ectives ?learly understand the concept of configuration management. 7nderstand what is meant by software maintenance, software re-engineering >earn about software refactoring. ?onfiguration management planning ?onfiguration management ta*es over control of systems after they have been developed. /owever, planning this management process must start during system development. A configuration management plan should be developed as part of the over all planning process. The ?+ plan should include at least the following information %&' The definition of what entities are to be managed and a formal scheme for identifying these entities. %1' A statement of who ta*es responsibility for the configuration management procedures and for submitting controlled entities to the configuration management team. %D' The configuration management policies, which are used for, change control and version management. %E' A description of the records of the configuration management process which should be maintained. %F' A description of the tools to be used for configuration management and the process to be applied when using these tools. %G' A definition of the configuration database which will be used to record configuration information. !ther information such as the management of software from external suppliers and the ?+ process auditing procedures may also be included in the ?+ plan. An important part of the ?+ plan is the definition of responsibilities. It should define who is responsible for

MC0071, MC0072,MC0073,MC0074,MC0075

Page 5

Dinesh (521138580)
the delivery of each document or software component to "uality assurance and configuration management. It may also define the reviewers of each document. The person responsible for document delivery need not be the same as the person responsible for producing the document. To simplify interface, it is often convenient to ma*e pro;ect managers or team leaders responsible for all of the documents produced by their team. )(* +rite a .rief note on 0is" 0e uction Mo els*/ 0is*-0eduction +odels (uilding a bridge or investing in a business involves a ris*, as does developing a software product. Hust as with other enterprises, the product may turn out to be harder to construct than expected or even infeasible or the mar*et for the product may disappear. This section reviews various models that address the issue of ris* in software development. The Crototyping +odel Crototypes are used in many engineering disciplines. Although what constitutes a software or information systems prototype cannot be uni"uely defined, there are three readily identifiable characteristics. The prototype should be able to (e a temporary system (e designed rapidly Crovide a tangible or visual expression of a proposed system Crototyping has been adopted in almost every process model since the 9aterfall +odel and was even thought of as an extension to the bidirectional, feedbac*-control feature of that model. The prototyping approach usually involves building a small version of the intended system prior to building the proposed complete system. This allows developers an opportunity to wor* out the *in*s in the specification and design of the system before its full-scale development is attempted5 the expectation is that this will significantly reduce the ris* of development. The need for such ris* reduction may derive from the novelty of the application or because the user interface design re"uires user experience and feedbac* based on the users live interaction with a tangible approximation of the desired product %:raham&331'. $xploratory prototyping refers to the use of prototyping as a techni"ue for gathering and clarifying re"uirements %=loyd &3IE'.This approach gives the developer a better understanding of the users wor* problems and needs and helps the users to clarify their re"uirements as well. $xperimental prototyping is used as a testing or evaluation techni"ue to verify whether the proposed system will meet user or customer expectations, to determine system feasibility, or to explore alternative solutions. $volutionary prototyping is used to explore changing re"uirements incrementally and adapt a system to them. $mbedded prototyping refers to prototyping as a component of another software development strategy. A convenient dichotomy is between horizontal and vertical prototyping. In horizontal prototyping, most of the system functions are at least nominally accessible, but only a few are actually operational. In vertical prototyping, a narrow vertical slice of the system functions is implemented.

MC0071, MC0072,MC0073,MC0074,MC0075

Page 6

Dinesh (521138580)

Some of the ma;or benefits of prototyping %>ichter et al. &33E' include the ability to :ain important feedbac* from users early in the development process J Crovide a common baseline for users and developers to identify problems and opportunities J +otivate user involvement J /elp to prevent misunderstanding between users and developers. J Strengthen wor*ing relationships between the users and developers Crototyping represents an experimental method for obtaining an understanding of a proposed system for the user and the developer. Timely prototype development greatly increases pro;ect visibility in the user organization by "uic*ly providing a wor*ing system5 helps the pro;ect gain credibility with the prospective users5 and gives the users a greater sense of ownership or buyin into the pro;ect because it allows their immediate impact on the system design %Alavi &3IE'. The availability of a tangible system cognitively facilitates user feedbac* because they can criticize and evaluate a tangible, existing system, rather than speculatively describe what they need in a potential system. $arly exposure to the prototype system also tends to increase user utilization of the system. The prototype provides a common baseline in the sense of a ,reference point for both users and designers by which to identify problems and opportunities early in the development process- %Alavi &3IE'. The interaction between developers and users that occurs as a result of discussions of the prototype also tends to lead to , better communication and rapport, and a better appreciation of each others ;obs,- thereby is enhancing the wor*ing relationship between the two groups %Alavi &3IE'. These improvements in user developer dynamics are significant advantages, given the recurrent behavioral problems between developers and users in systems development. =urthermore, although prototyping is commonly perceived to be more expensive, it addresses some of the limitations of the 9aterfall +odel, such as an ability to deal with semi structured or non-structured re"uirements %Khalifa L <erner 1222'. Crototyping has been criticized for a variety of shortcomings, including J >eading users to overestimate the capabilities of a software product J )ifficulties in pro;ect management and control J )ifficulty in applying the techni"ue to large systems design J Cotential difficulties in maintaining necessary user interest. The management difficulties arise partly from the difference between the prototyping approach and the more well-defined life-cycle approaches system specifications evolve over the course of the pro;ect5 users are more involved5 and changes are more fre"uent. +anagement is conse"uently complicated by the uncertainty of the development5 the revisions to the prototype or versions of the prototype5 and the associated potential for reduced development discipline, which is re"uired in order to maintain proper managerial control. Ironically, although the "uic* availability of a responsive prototype can stimulate user interest, heightened interest may decline precisely because ,high priority user re"uirements- may have been satisfied by the prototype %Alavi &3IE'.

)7* +,at are t,e ifferent stages of implementing a CMM/ The ?++ identifies five levels of software development maturity in an organization J At level &, the organization software development follows no formal development process.

MC0071, MC0072,MC0073,MC0074,MC0075

Page 7

Dinesh (521138580)
J The process maturity is said to be at level 1 if software management controls have been introduced and some software process is followed. A decisive feature of this level is that the organization process is supposed to be such that it can repeat the level of performance that it achieved on similar successful past pro;ects. This is related to a central purpose of the ?++ namely, to improve the predictability of the development process significantly. The ma;or technical re"uirement at level 1 is incorporation of configuration management into the process. ?onfiguration management %or change management, as it is sometimes called' refers to the processes used to *eep trac* of the changes made to the development product%including all the intermediate deliverables' and the multifarious impacts of these changes. These impacts range from the recognition of development problems5 identification of the need for changes5 alteration of previous wor*5 verification that agreed upon modification shave corrected the problem and that corrections have not had a negative impact on other parts of the system5 etc.J An organization is said to be at level D if the development process is standard and consistent. The pro;ect management practices of the organization are supposed to have been formally agreed on, defined, and codified at this stage of process maturity. J !rganizations at level E are presumed to have put into place "ualitative and "uantitative measures of organizational process. These process metrics are intended to monitor development and to signal trouble and indicate where and how a development is going wrong when problems occur. J !rganizations at maturity level F are assumed to have established mechanisms designed to ensure continuous process improvement and optimization. The metric feedbac*s at this stage are not ;ust applied to recognize and control problems with the current pro;ect as they were inlevel-E organizations. They are intended to identify possible root causes in the process that have allowed the problems to occur and to guide the evolution of the process so as to prevent the recurrence of such problems in future pro;ects, such as through the introduction of appropriate new technologies and tools. The higher the ?++ maturity level is, the more disciplined, stable, and well-defined the development process is expected to be and the environment is assumed to ma*e more use of ,automated tools and the experience gained from many past successes- %Mhiying 12 2D'. The staged character of the model lets organizations progress up the maturity ladder by setting process targets for the organization. $ach advance reflects a further degree of stabilization of an organizations development process, with each level ,in stitutionalizingN a different aspect- of the process %!shana L >inger &333'.$ach ?++ level has associated *ey process areas %KCA' that correspond to activities that must be formalized to attain that level. =or example, the KCAs at level 1 include configuration management, "uality assurance, pro;ect planning and trac*ing, and effective management of subcontracted software. The KCAs at level D include intergroup communication, training, process definition, product engineering, and integrated software management. Ouantitative process management and development "uality define the re"uired KCAs at level E. >evel F institutionalizes process and technology change management and optimizes defect prevention. The ?++ model is not without its critics. =or example, /amlet and +ay be %122&' ob;ect to its overemphasis on managerial supervision as opposed to technical focus. They observe that agreement on the relation between the goodness of a process and the goodness of the product is by no means universal. They present an interesting criti"ue of ?++ from the point of view of the so-called process versus product controversy. The issue is to what extent software engineers should focus their efforts on the design of the software product being developed as opposed to the characteristics of the software process used to develop that product. The usual engineering

MC0071, MC0072,MC0073,MC0074,MC0075

Page 8

Dinesh (521138580)
approach has been to focus on the product, using relatively straight forward processes, such as the standard practice embodied in the 9aterfall +odel, adapted to help organize the wor* on developing the product. A *ey point of dispute is that no one has really demonstrated whether a good process leads to a good product. Indeed, good products have been developed with little process used, and poor products have been developed under the guidance of a lot of purportedly good processes. =urthermore, adopting complex managerial processes to oversee development may distract from the underlying ob;ective of developing a superior product. /amlet and +ay be %122&' agree that, at the extremes of pro;ect size, there is no particular argument about the planning process to follow. They observe that for small-scale pro;ects, the cost of a heavy process management structure far outweighs the benefits5 however, for very large-scale pro;ects that will develop multimillion-lines systems with long lifetimes, significant pro;ect management is clearly a necessity. /owever, in the midrange of pro;ects with a few hundred thousand lines of code, the tradeoffs between the ,managed model- of development and the ,technical model- in which the management hierarchy is *ept to an absolute minimum are less obvious5 indeed, the technical model may possibly be the superior and more creative approach. (amberger %&334', one of the authors of the ?apability +aturity +odel, addresses what she believes are some misconceptions about the model. =or example, she observes that the motivation for the second level, in which the organization must have a ,repeatable software process,- arises as a direct response to the historical experience of developers when their software development is ,out of control- %(amberger &334'. !ften this is for reasons having to do with configuration management or mismanagementP Among the many symptoms of configuration mismanagement are confusion over which version of a file is the current official one5 inadvertent side effects when repairs by one developer obliterate the changes of another developer5 inconsistencies among the efforts of different developers5 etc. A *ey appropriate response to such actual or potential disorder is to get control of the product and the ,product pieces under development- %configuration management' by %(amberger &334' J ?ontrolling the feature set of the product so that the ,impact#s of changes are more fully understood- %re"uirements management' J 7sing the feature set to estimate the budget and schedule while ,leveraging as much past *nowledge as possible- %pro;ect planning' J $nsuring schedules and plans are visible to all the sta*eholders %pro;ect trac*ing' J $nsuring that the team follows its own plan and standards and ,corrects discrepancies when they occur- %"uality assurance' J (amberger contends that this *ind of process establishes the ,basic stability and visibilitythat are the essence of the ?++ repeatable level. )%* E5plain t,e roun 2trip pro.lem sol4ing approac,/ 0oun 2=rip 1ro.lem2Sol4ing Approac,$2 The software engineering process represents a round-trip framewor* for problem solving in a business context in several senses.J The software engineering process is a problem-solving process entailing that software engineering should incorporate or utilize the problem-solving literature regardless of its interdisciplinary sources.J The value of software engineering derives from its success in solving business and human problems. This entails establishing strong relationships between the software process and the business metrics used to evaluate business processes in general.J The software engineering process is a round-trip approach. It has a bidirectional character, which fre"uently re"uires adopting forward and reverse engineering strategies to restructure and reengineer information systems. It uses feedbac* control loops to ensure that specifications are accurately maintained across multiple process phases5 reflective "uality assurance is a critical metric for the process in general.J The non

MC0071, MC0072,MC0073,MC0074,MC0075

Page 9

Dinesh (521138580)
terminating, continuing character of the software development process is necessary to respond to ongoing changes in customer re"uirements and environmental pressures. )'*+,at are t,e factors t,at affect inter2 isciplinar- ignorance/ =or present purposes, the term ignorance refers to a lac* of data or the presence of in accurate data in a circumstance in which such a lac* hinders the proper understanding and definition of business and human problems. Ignorance in this sense includes lac* of *nowledge about available information as well as about ade"uate or effective tools. This results in a problemsolving process that may have unreliable or insufficient inputs. 7nderstanding the sources and varieties of ignorance can help reduce the failure rate in problem-solving processes. Hustas in the case of domain *nowledge, domain or process ignorance is also an inter disciplinary phenomenon. Thus, overcoming this *ind of ignorance re"uires an interdisciplinary response. Although a thorough grasp of a problem area and the solution domain results in success, ignorance mas*s or obscures the real situation and thus broadens the distance between actual problems and their appropriate solutions. The many sources of ignorance include unreliable sources of information, partial *nowledge, lac* of communication, and interorganizational ignorance. 1) 7nrelia.le Sources of Information This category includes inade"uately accountable sources of information. $xamples range from unconfirmed, inconsistent, suspicious, or doubtful resources to resources that are untrustworthy or lac* "ualification. ?learly, determining whether a resource is reliable re"uires examining the "uality and credibility of the data and the data carrier. $ven computerized systems can be based on incorrect formulas, programming bugs, and in accurate entries. Interdisciplinary capabilities are needed to eliminate or dis"ualify unreliable resources and to rate or ran* sources, which can be human, digital, or hardcopy sources. =or example, one can estimate the reliability of a human source by examining characteristics of sub;ects such as their s*ills, psychology, physiological criteria, etc. Technical testing may be re"uired if data is delivered by electronic media. If a source involves specialized information, domain *nowledge and expertise in the area may be needed to evaluate its reliability. 2) 1artial >nowle ge This refers to aspects of an issue that have not been revealed %so-called in-breadth ignorance'or information about a specific aspect of an issue that is left incomplete %so-called in-depth ignorance'. This type of ignorance may even be derived from a complacent or selfsatisfied attitude @ ,what we do not *now does not exist.In-breadth ignorance assumes that information can be gathered using only one or two paths of *nowledge, with other aspects of the problem not even considered for relevancy. =ailure to recognize all the dimensions of an issue can result in solving the wrong problem and thus leaving the real problem unsolved. =or example, although the infamous Q1K problem was atone level a technical problem, it had in fact many managerial aspects. =or example, solving the technical dimension of Q1K was arguably easier than finding sufficient staff capable of reviewing systems for relevant bugs. In this situation, because of the intense demand for "ualified staff, managing the available human resources became a real challenge. The ,technical- problem was indeed interdisciplinary, li*e most business problems. 6) ?ac" of Communication

MC0071, MC0072,MC0073,MC0074,MC0075

Page 10

Dinesh (521138580)
>ac* of communication is a ma;or source of ignorance. ?ommunication narrows the distance between the various elements of the problem in "uestion. >ac* of communication originates in factors such as failure to contact the sta*eholders in a business problem, not using effective communication techni"ues, or not being able to carry out an efficient communication process. The effects of a lac* of communication can be summarized as follows Ignorance of lac* of sources. $xtra ?ontextual Ignorance. Ignorance of lac* of communication channels. )ifferentiation Ignorance.

E' Inter-organizational Ignorance The value of *nowledge stems from its usability and adaptability, not from its mere existence. To be valuable, information or data must add value to an organization and to its problemsolving processes. !therwise, it is tantamount to a form of double ignorance in which people do not *now what they *now but assume that they do %or, they do not *now that they do not *now'. This can ma*e *nowledge expensive if one is in possession of unused data, or ma*e an organization a victim of *nowledge utilization delays that result from a lac* of awareness or ignorance of ignorance. Knowledge-based ignorance can hide wea*ness behind apparent strength and business sic*ness behind an apparently healthy organization. This source of ignorance has many manifestations and degrees and even low levels can be damaging and costly )10* +rite a note on t,e contri.utions of t,e customer an t,e e4eloper towar s t,e e4elopment p,ase/ =,e Customer @actor It is a truism that, in a customer-focused economy, software engineering must also be customer driven. This section considers some characteristics and techni"ues typical of a customer-driven software development environment. These include J ?ustomer-driven development is re"uirements intensive and features driven. (ecause customer needs are the highest priority, they must be carefully gathered, identified, specified, visualized, and internally prioritized among themselves. As a conse"uence, re"uirements engineering becomes the *ey strategic phase across the software engineering process.J ?ustomer-driven development is iterative in nature.-Iterative development is essential because it allows extensive feedbac* and development response to the feedbac*. ?ustomer-driven development aims to develop *iller applications The only way to survive in a highly competitive mar*et is to develop winning applications not ordinary applications that merely pass the test of basic viability. ?ustomer-driven development strongly values time to mar*et. Time means opportunity, so applications must be engineered expeditiously enough to capture time-dependent mar*eting opportunities. ?ustomer-driven development attempts to achieve multi sta*e holder satisfaction via win-win situations.

MC0071, MC0072,MC0073,MC0074,MC0075

Page 11

Dinesh (521138580)
$very software development activity involves many participants, each of whom has his or her goals and views of what constitutes value5 therefore, the effective reconciliation of conflicts over system re"uirements becomes a *ey factor in assuring customer satisfaction. ?ustomer-driven development focuses on "uality in products and services. Ouality assurance implies managing software processes in such a way that the developer and the customer are satisfied with the "uality and consistency of the goods or services produced or provided. ?ustomer-driven development views customers as partners not merely as buyers. In order to assure that customer expectations are met, customers should team up with developers at each phase of the software development process. This can significantly minimize ris* and reduce cycle time throughout the development process.J ?ustomer-driven development is customizable, personalized, and adaptable to individual needs and changes in needs. 6o two businesses or individuals are identical %demands and needs vary and evolve even across a single organization', so recognizing individual differences and organizational diversity is crucial to providing effective solutions. ?ustomer-driven development is driven by cognitive psychology. ?ognitive psychology can be thought of as the language for the source code of the software customer mind. Therefore,a customer-driven software development approach should examine the extent to which software design accurately reflects the needs of customers as perceived by the customers. ?ustomer-driven development is informative and accessible. )esigning a software solution in the ,customer age- re"uires full customer service and support in terms of well-documented help, interactive 9eb assistance, and state-of-the-art means of communication. Applications that do not provide support information are sub;ect to customer complaints, dissatisfaction, and re;ection. Security and privacy are concerns in any customer-driven solution. To earn customer trust, software engineers must design reliable systems that are less li*ely to be vulnerable to privacy invasions or security hac*ers. Security and privacy are *ey concerns of software customers.

Spring 2012 Master of Computer Application (MCA) Semester III MC0072 Computer Arap,ics 4 Cre its

MC0071, MC0072,MC0073,MC0074,MC0075

Page 12

Dinesh (521138580)

&.$xplain the development of hardware and software for computer graphics. Ans )evelopment of /ardware and Software for ?omputer :raphics The development of hardware of computer graphics involves the development of input andoutput device technology. Therefore, in all development of computer graphics involves thedevelopment in three fields &. !utput technology1. Input technology andD. Software technology & !utput Technology =ig. &.D shows the historical development in the output technology. In early days of computer the hardcopy devices such as teletype printer and line printer were in use withcomputer driven ?0T displays. In mid fifties command and control ?0T display consoleswere introduced. The more display devices developed in mid-sixties and in common useuntil the mid-eighties, are called vector, stro*e, line drawing or calligraphic displays. Theterm vector is used as a synonyms for line5 a stro*e is a short line, and characters are madeof se"uence of such stro*es.=ig. &.D

1 Input Technology Input technology has also improved greatly over the years. 6umber of input devices weredeveloped over the years. These devices are punch cards, light pens, *eyboard, tables,mouse and scanners. D Software Technology >i*e output and input technology there is a lot of development in the software technology.In early days low level software were available. !ver the years software technology movedfrom low level to device dependent and then to device independent pac*ages. The deviceindependent pac*ages are high level pac*ages with can drive a wide variety of display and printer devices. As a need for the device independent pac*age a standardization is madeand specification are decided. The first graphics specification to be officially standardizedwas :KS %the :raphical Kernel System'. :KS supports the grouping of logically related primitives such as lines, polygons, and character strings and their attributes in collectedform called segments. In &3II, a D) extension of :KS, became an official standard, as dida much more sophisticated but even more complex graphics system called C/I:S%CrogrammerBs /ierarchical Interactive :raphics System'.C/I:S, as its name implies, supports nested hierarchical grouping of D) primitives, called

MC0071, MC0072,MC0073,MC0074,MC0075

Page 13

Dinesh (521138580)
structures. In C/I:S, all primitives are sub;ected to geometric transformations such asscaling, rotation and translation to accomplish dynamic movement. C/I:S also supports adatabase of structures the programmer may edit and modify. C/I:S automatically updatesthe display whenever the database has been modified. 1. $xplain the use of video loo*up table Ans <ideo loo*up table In a color raster system, the number of color choices available depends on the amount of storage provided per pixel in the frame buffer. Also,color-information can be stored in theframe buffer in two ways 9e can store color codes directly in the frame buffer, or we can put the color codes in a separate table and use pixel values as an index into this table. 9iththe direct storage scheme, whenever a particular color code is specified in an application program, the corresponding binary value is placed in the frame buffer for eachcomponent pixel in the output primitives to be displayed in that color. A minimum number of colorscan be provided in this scheme with D bits of storage per pixel, as shown in the table 1.F. $ach of the three bit positions is used to control the intensity level %either on or off' of thecorresponding electron gun in an 0:( monitor. The leftmost bit controls the red gun, themiddle bit controls the green gun, and the rightmost bit controls the blue gun . Adding more bits per pixel to the frame buffer increases the number of color choices. 9ith G bits per pixel, 1 bits can be used for each gun. This allows four different intensity settings for eachof the three color guns, and a total of GE color values are available for each screen pixel.9ith a resolution of &21E by &21E, a full-color %1Ebit per pixel' 0:( system needs Dmegabytes of storage for the frame buffer. ?olor tables are an alternate means for providingextended color capabilities to a user without re"uiring large frame buffers. >ower cost personal computer systems, in particular, often use color tables to reduce frame-buffer storage re"uirements. ?olor tables In color displays, 1E- bits per pixel are commonly used, where I-bits represent 1FG levelsfor each color. /ere it is necessary to read 1E-bits for each pixel from frame buffer. This isvery time consuming. To avoid this video controller uses loo* up table %>7T' to storemany entries of pixel values in 0:( format. 9ith this facility, now it is necessary only toread index to the loo* up table from the frame buffer for each pixel. This index specifiesthe one of the entries in the loo*-up table. The specified entry in the loop up table is thenused to control the intensity or color of the ?0T.7sually, loo*-up table has 1FG entries. Therefore, the index to the loo*-up table has I-bitsand hence for each pixel, the frame buffer has to store I-bits per pixel instead of 1E bits.=ig. 1.G shows the organization of a color %<ideo' loo*-up table !rganization of a <ideo loo*-up tableThere are several advantages in storing color codes in a loo*up table. 7se of a color tablecan provide a RreasonableR number of simultaneous colors without re"uiring Iarge frame buffers. =or most applications, 1FG or F&1 different colors are sufficient for a single picture. Also, table entries can be changed at any time, allowing a user to be able toexperiment easily with different color combinations in a design, scene, or graph withoutchanging the attribute settings

MC0071, MC0072,MC0073,MC0074,MC0075

Page 14

Dinesh (521138580)
for the graphics data structure. In visualization and image- processing applications, color tables are convenient means for setting color thresholds sothat all pixel values above or below a specified threshold can be set to the same color. =or these reasons, some systems provide both capabilities for color-code storage, so that a user can elect either to use color tables or to store color codes directly in the frame buffer.

.D. $xplain the steps in ))A line drawing algorithm Ans ))A >ine )rawing Algorithm Step & S)etermine The )x L )yN )xTUb-Ua )yTQb-Qa Step 1 S)etermine Slope is :entle or SharpN If V)xVWV)yV then:entle Slope +T)y#)x Set The Starting Coint If )xW2 Then?T?$>I6:%Ub' )TQbX+Y%?-Ub' =T=>!!0%Ua' 0T=>!!0%)X2.F' /T0-)X+ I= +W2 ThenCositive :entle Slope +&T+-& 6ow Step Through The ?olumns 9/I>$ ?ZT= E. $xplain the steps in the scan line algorithm for filling the polygon Ans Scan >ine algorithm 0ecursive algorithm for seed fill methods have got two difficulties. The first difficulty isthat if some inside pixels are already displayed in fill color then recursive branchterminates, leaving further internal pixels unfilled. To avoid this difficulty, we have to firstchange the color of any internal pixels that are initially set to fill color before applying theseed fill procedure. Another difficulty with recursive seed fill methods is that it can not beused for large polygons. This is

MC0071, MC0072,MC0073,MC0074,MC0075

Page 15

Dinesh (521138580)
because recursive seed fill procedures re"uire stac*ing of neighboring points. To avoid this problem more efficient method can be used. Such methodfills horizontal pixel spans across scan lines, instead of proceeding to E-connected or I-connected neighboring points. This is achieved by identifying the right most and left most pixels of the seed pixel and then drawing a horizontal line between these 1 boundary pixels.This procedure is repeated with changing the seed pixel above and below the line ;ustdrawn until complete polygon is filled. 9ith this efficient method we have to stac* only a beginning position for each horizontal pixel span, instead of stac*ing all unprocessedneighboring positions around the current position.

Scan conversion algorithm for polygon filling &. read n, the number of vertices of polygon 1. read x and y coordinates of all vertices in array xSnN and ySnN D. find ymin and ymax E. Store the initial x value%x&' y values y&and y1 for 1 end points and x increment fromscan line to scan line for each edge in the array edges SnNSEN. 9hile doing this chec* that y&W y1, if not interchange y&and y1 and corresponding x&and x1 so that for each edge, y& represents its maximum y coordinate and y1 represents its minimum y coordinate. F. Sort the rows of array, edges SnNSEN in descending of y&, descending order of y1 andascending order of x1 G. Set yTymax 4. =ind the active edges and update active edge list I. If%y W y1and y ZTy&' 3. [ edge is active\ &2. $lse &&. [ edge is not active\ &1. ?ompute the x intersects for all active edges for current y value. Initially x intersect is x&and x intersects for successive y values can be given as &D. If x intersect is vertex i.e x-intersectTx&and yTy&then apply vertex test to chec* whether to consider one intersect or 1 intersects. Store all x intersects in the x-intersects S Narray. &E. Sort x-intersects S N array in the ascending order &F. $xtract pairs of intersects from the sorted x-intersect S N array &G. Cass pairs of x values to line drawing routine to draw corresponding line segments &4. Set yTy-& &I. 0epeat step 4 through &I until yWTymin &3. Stop F. $xplain the ?yrus-(ec* algorithm for generalized line clipping

MC0071, MC0072,MC0073,MC0074,MC0075

Page 16

Dinesh (521138580)
Ans :eneralized ?lipping with ?yrus-bec* Algorithm The algorithms explained above assume that the clipping window is a regular rectangle.These algorithms are not applicable for non rectangular clipping windows. ?yrus and (ec* have developed a generalized line clipping algorithm. This algorithm is applicable to anarbitrary convex region. This algorithm uses a parametric e"uation of a line segment to findthe intersection points of a line with the clipping edges. The parametric e"uation of a linesegment from C&to C1is C%t' T C&X %C1- C&'t 52Z t Z& . . . . . .%F.1' 9here is a parameter, tT2 at C&and t T& at C1 ?onsider a convex clipping region 0, f is a boundary point of the convex region 0 and n isan inner normal for one of its boundaries, as shown in the =ig. F.I. =ig. F.I convex region, boundary point and inner normal Then we can distinguish in which region appoint lie by loo*ing at the value of the dot product n. S C%t' @ f N, as shown in the =ig.F.3. If dot product is negative, i.e. n.S C%t' @fN Z2 . . .%F.D'

Then the vector C%t' @f is pointed away from the interior of 0. 1. If dot product is zero, i. e., n. SC%t'-fN T2. . . %F.E' Then C%t' @ f is pointed parallel to the plane containing f and perpendicular to the normal. D. If dot product is positive, i.e. n. SC%t' @ fN W 2 Then the vector C%t' @ f is pointed towards the interior of 0, as shown in fig. F.3. =ig. F.3 )ot products for D points inside, outside and on the boundary of the clipping region As shown in the =ig. F.3, if the point lies in the boundary plane or edge for which n is theinner normal, then that point t on the line C%t' which satisfies n.SC%t' @f N T 2 condition isthe intersection of the line with the boundary edge. G. )erive the D-) transformation matrix to transform world coordinates to viewing?oordinates Ans D-) transformation matrix

MC0071, MC0072,MC0073,MC0074,MC0075

Page 17

Dinesh (521138580)
the D) viewing process is inherently more complex than the 1 ) viewing process. In twodimensional viewing we have D) window and 1) viewport and ob;ects in the worldcoordinates are clipped against the window and are then transformed into the viewport for display. The complexity added in the three dimensional viewing is because of the added

dimension and the fact that even though ob;ects are three dimensional the display devicesare only 1).The mismatch between D) ob;ects and 1) displays is compensated by introducing pro;ections. The pro;ections transform D) ob;ects into a 1) pro;ection plane. The =ig. 4.&shows the conceptual model of the D) transformation process.In D) viewing, we specify a view volume in the world coordinates using modelingtransformation. The world coordinate positions of the ob;ects are then converted intoviewing coordinates by viewing transformation. The pro;ection transformation is then usedto convert D) description of ob;ects in viewing coordinates to the 1) pro;ectioncoordinates. =inally, the wor*station transformation transforms the pro;ection coordinatesinto the device coordinates.

Specifying an Arbitrary D) <iew As mentioned earlier, we can view the ob;ect from the side, or the top, or even from behind. Therefore, it is necessary to choose a particular view for a picture by first defininga view plane. A view plane is nothing but the film plane in a camera which is positionedand oriented for a particular shot of the scene. 9orld coordinate positions in the scene aretransformed to viewing coordinates, then viewing coordinates are pro;ected onto the view plane. A view plane can be defined by establishing the viewing @ coordinate system or view reference coordinate system, as shown in the =ig. 4.1.

MC0071, MC0072,MC0073,MC0074,MC0075

Page 18

Dinesh (521138580)

=ig. 4.1 0ight handed viewing coordinate system The first viewing parameter we must consider is the view reference point. This point is thecenter of our viewing coordinate system. It is often chosen to be close to or to the surfaceof some ob;ect in a scene. Its coordinates are specified as Uw, Qwand Mw. The next viewing parameter is a 4iew2planenormal4ector36. This normal vector is thedirection perpendicular to the view plane and it is defined as S)U6 )Q6 )M6N. 9e *nowthat the view plane is the film in the camera and we focus camera towards the viewreference point. This means that the camera is pointed in the direction of the view planenormal. This is illustrated in =ig. 4.D=ig. 4.D <iew reference point and <iew plane normal vector As shown in the =ig. 4.D, the view plane normal vector is a directed line segment from theview plane to the view reference point. The length of this directed line segment is referredto as 4iew2 istance*This is another viewing parameter. It tells how far the camera is positioned from the view reference point. In other words we can say that a view plane is

MC0071, MC0072,MC0073,MC0074,MC0075

Page 19

Dinesh (521138580)
positioned view-distance away from the view reference point in the direction of the view plane

normal. This is illustrated in =ig. 4.E. =ig. 4.E D) viewing parameters As shown in the =ig. 4.E we have world coordinate system which we used to model our ob;ect, and we have view plane coordinates, which are attached to the view plane.It is possible to obtain the different views by rotating the camera about the view planenormal vector and *eeping view reference point and direction of 6 vector fixed, as shownin the =ig. 4.F =ig. 4.F 0otating <iew plane=ig. 4.G <iewing ob;ect by changing view plane vector 6 At different angles, the view plane will show the same scene, but rotated so that a different part of the ob;ect is up. The rotation of a camera or view plane is specified by a viewupvector < SU7C Q7C M7CN which is another important viewing parameter. 9e can also obtain a series of views of a scene, by *eeping the view reference point fixedand changing the direction of 6, as shown in the =ig. 4.G changing the view plane normalchanges the orientation of camera or view plane giving different views. 4. $xplain random scan display system. Ans 0andom scan system &'random displays have high resolutions since the picture defination is stored as a set of linedrawing commands and not as a set of intensity values. 1'smooth lines are produced asthe electron beam directly follows the line path.

MC0071, MC0072,MC0073,MC0074,MC0075

Page 20

Dinesh (521138580)
D'realism is difficult to achieve.E'random-scan system8s are generally costlier. or I. $xplain the steps in midpoint circle drawing algorithm Ans +idpoint circle drawing Algorithm In computer graphics, the mi point circle algorit,m is an algorithm used to determine the points needed for drawing a circle. The algorithm is a variant of (resenham8s line algorithm, and is thus sometimes *nown as !resen,amBs circle algorit,m, although not actually invented by Hac* $. (resenham. The algorithm can be generalized to conic sections.

0asterisation of a circle by the (resenham algorithm The algorithm is related to wor* by CittewayS1N and <an A*en.SDN The algorithm starts with the circle e"uation center of the circle is at . =or simplicity, assume the . 9e consider first only the first octant and draw a curve which

starts at point and proceeds countercloc*wise, reaching the angle of EF. The RfastR direction here %the basis vector with the greater increase in value' is the direction. The algorithm always ta*es a step in the positive direction %upwards', and occasionally ta*es a step in the RslowR direction %the negative direction'. =rom the circle e"uation we obtain the transformed e"uation , where is computed only a single time during initialization. >et the points on the circle be a se"uence of coordinates of the vector to the point %in the usual basis'. >et denote the point index, with =or each point, the following holds This can be rearranged as follows And li*ewise for the next point assigned to the point .

MC0071, MC0072,MC0073,MC0074,MC0075

Page 21

Dinesh (521138580)
In general, it is true that

So we refashion our next-point-e"uation into a recursive one by substituting (ecause of the continuity of a circle and because the maxima along both axes is the same, we *now we will not be s*ipping x points as we advance in the se"uence. 7sually we will stay on the same x coordinate, and sometimes advance by one. Additionally, we need to add the midpoint coordinates when setting a pixel. These fre"uent integer additions do not limit the performancemuch, as we can spare those s"uare %root' computations in the inner loop in turn. Again the zero in the transformed circle e"uation is replaced by the error term. The initialization of the error term is derived from an offset of ] pixel at the start. 7ntil the intersection with the perpendicular line, this leads to an accumulated value of in the error term, so that this value is used for initialization. The fre"uent computations of s"uares in the circlee"uation, trigonometric expressions and s"uare roots can again be avoided by dissolving everything into single steps and using recursive computation of the "uadratic terms from the preceding iterations. (elow is an implementation of the (resenham Algorithm for a full circle in ?. /ere another variable for recursive computation of the "uadratic terms is used, which corresponds with the term above. It ;ust has to be increased by 1 from one step to the next. '* E5plain t,e 4arious t-pes of parallel pro8ections* +ultiview Cro;ection 9ith a multi4iew pro8ection, the pro;ection lines are oriented parallel to one of the principle a5es of the ob;ect. This is the case in =igure &. 6otice that the pro;ection lines are following a large number of edges on the ob;ect. These edges define one of the principle axes which, in turn, defines one of the primary dimensions of the ob;ect. (y pro;ecting along one of the primary dimensions, this dimension is collapsed completely into the pro;ection. Another way of stating this is that when you orient a principle axis perpendicular to a pro;ection surface, it is not seen at all. 6otice in the pro;ection, all of the features represented along that primary dimension are completely missing on the pro;ection. /ow do you determine what are the principle axes^ !b;ects don8t come predefined this way, so you end up having to decide what orientation of three mutually perpendicular %ort,ogonal' axes follows a ma;ority of the *ey edges of the ob;ect. These axes can also be thought of as the ?artesian coordinate axes, U, Q, and M. !ne way of thin*ing of this is imagine putting the ob;ect in the smallest box possible. /ow is the ob;ect oriented in the box^ The corners of the box now represent the primary axes relative to the ob;ect. +ultiview pro;ection gets its name because only two dimensions of the ob;ect are shown in each pro;ection. These two principle dimensions displayed are shown intrue siCe, there is no distortion. This is the case because these principle axes are both parallel to the surface it is being pro;ected onto. If you are going to describe all three dimensions of the ob;ect, you must have two or more %multi' views. +ultiple multiview pro;ections brought together into a single drawing is the standard format for technical drawings used in engineering and architecture. =igure 1 shows the three most common multiview pro;ections front

MC0071, MC0072,MC0073,MC0074,MC0075

Page 22

Dinesh (521138580)
side top Cictorial Cro;ection 1ictorial pro8ection, unli*e multiview pro;ection, is designed to allow the viewer to see all three primary dimensions of the ob;ect in the pro;ection. The degree to which a dimension gets 8collapsed8 in the pro;ection depends on the orientation of the line of sight relative to the ob;ect. 9hereas a multiview is designed to focus in on only two of the three dimensions of the ob;ect, a pictorial provides a holistic view of the ob;ect. The tradeoff is that a multiview allows, in general, a more undistorted view of the features in the two dimensions displayed while lac*ing a holistic view of the ob;ect %thus needing multiple views to fully describe the ob;ect'. Axonometric Cictorial Cro;ections 9hen parallel pro;ection is used to create a view showing all three dimensions of an ob;ect, this is called an axonometric pictorial pro;ection. Axonometric pro;ections are classified according to the orientation of the principle axes relative to the pro;ected surface. This orientation of axes determines how much each principle dimension is distorted. 9hen a principle axis is oriented at something other than parallel to the pro;ected surface, then the lengths of features in that dimension are shown shorter than their true length. This is called foreshortening. The closer the axis comes to being perpendicular to the pro;ection surface, the The most common type of axonometric pro;ection is called an isometric pictorial pro;ection. 9ith this pictorial, all three principle axes are oriented at the same angle to the pro;ection plane, creating an e"ual amount of foreshortening in all three dimensions. =igure G shows an example of an isometric pro;ection. 6otice that the three principle axes overdrawn on the ob;ect ma*e an angle of &12 degrees to each other on the pro;ected surface. In the real ob;ect, these axes would actually be 32 degrees to each other.more foreshortened it becomes, until it finally collapses to zero length. Cerspective Cro;ection If parallel pro;ection provides the least of amount of distortion, why would you want to do anything else^ In fact, parallel pro;ection does not do a very good ;ob of mimic*ing how we see the real world around us. 9hen loo*ing around us, ob;ects that are farther away loo* as though they are smaller. Similarly, single ob;ects that span a great distance, such as roads or railroad trac*s, loo* as though parallel edges are getting closer together as they recede into the distance. =inally, when an ob;ect gets to a theoretical 8far point8, they disappear all together. This happens at what we call the ,oriCon line. 9e mimic this effect by allowing edges that are parallel on the ob;ect to converge as they move towards the theoretical horizon line on the pro;ection surface. This techni"ue uses perspective pro;ection, which has lines of site which are not parallel to each other nor perpendicular to the pro;ection surface. The rate at which parallel edges converge is called the perspecti4e angle%=igure 3'. This angle is determined by the distance an imaginary viewer is from the ob;ect being represented.o length. &2. )erive the transformation matrix for rotation about an arbitrary plane Ans transformation matrix for rotation about an arbitrary plane The standard way to compute a rotation about an arbitrary axis through theorigin is toconcatenate five rotation matrices. This note shows how vector algebra ma*esit easy torotate about an arbitrary axis in a single step.=igure & shows a point C which we want to rotate an angle _ about an axis thatpassesthrough ( with a direction defined by unit vector n. So, given the angle _, theunit vectorn, and ?artesian coordinates for the points C, (, we want to find ?artesiancoordinatesfor the point C `

MC0071, MC0072,MC0073,MC0074,MC0075

Page 23

Dinesh (521138580)

=igure & 0otation about an Arbitrary Axis The *ey insight needed is shown in =igure >et u and v be any two three-dimensional =igure 1 Key Insightvectors that satisfy u J v T 2 %that is, they are perpendicular' and VuV T VvV GT 2%that is,they are they same length but not necessarily unit vectors'. 9e want to find avector rthat is obtained by rotating u an angle _ in the plane defined by u and v. Assuggested in=igure 1,r T u cos _ X v sin _. %&'9ith that insight, it is easy to compute a rotation about an arbitrary axis.0eferring to =igure D, we compute

=igure D 0otation about an Arbitrary Axis

MC0071, MC0072,MC0073,MC0074,MC0075

Page 24

Dinesh (521138580)
? T ( X S%C a (' J nNn. %1' u T C a ? %D' vTnbu%E' Then, r is computed using e"uation %&', and p T?Xr.%F' It is possible to ta*e these simple vector e"uations and to create from them asingleE b E transformation matrix for rotation about an arbitrary axis. >et C T %x, y,z', C` T%x`, y`, z`', ( T %(x,(y,(z', and n T %nx.ny, nz'. 9e see* a E b E matrix + suchthat%?x,?y,?z'T %(x,(y,(z' X SxnxX ynyX znza (JnN%nx, ny, nz' %G'?xT xn1X ynxnyX znxnzX (xa %( J n'nx%4'?yT xnxnyX yn1yX znynzX (ya %( J n'ny%I'?zT xnxnzXynynzX zn1zX (za %( J n'nz%3'u T %x, y, z' a %?,?y,?z'%&2'xTx%&an1x' a ynxnya znxnzX %( J n'nxa (x%&&'uyTaxnxnyXy%&an1y' a znynzX %( J n'nya (y%&1'uzTaxnxnza ynynzX %& a n1z' X %( J n'nza (z%&D'vxT nyuza nzuy%&E'vyTnzuxa nxuz%&F'vzT nxuya nyux%&G'rxT uxcos _ X %nyuza nzuy' sin _ %&4'ryT uycos _ X %nzuxa nxuz' sin _ %&I'ryT uycos _ X %nxuya nyux' sin _ %&3'%x`, y`, z`'T%?xX rx,?yX ry,?zX rz' %12'x `T xn1xX ynxnyX znxnzX (xa %( J n'nxX %1&'%x%& a n1x' a ynxnya znxnzX %( J n'nxa (x' cos _ X %11'ny%axnxnza ynynzX%&an1z' X %( J n'nza (z' sin _ a %1D'

nz%axnxnyXy%&an1y' a znynzX %( J n'nya (y' sin _ %1E'x `TxSn1x%&an1x'cos_NXySnxny%& a cos _' a nzsin _NX zSnxnz%& a cos _' X nysin _N X %(xa %( J n'nx'%& a cos _' X nz(ya ny(z. %1F'Since n1xX n1yX n1zT &, %& a n1x' T n1yX n1z. In li*e manner we can come up with anexpression for y `andz`, and our matrix + is thuswith T&T %(xa %( J n'nx'%& a cos _' X nz(ya ny(zT1T %(ya %( J n'ny'%& a cos _' X nz(xa nx(z TDT %(za %( J n'nz'%& a cos _' X nx(ya ny(x

MC0071, MC0072,MC0073,MC0074,MC0075

Page 25

Dinesh (521138580)

Spring 2012 Master of Computer Application (MCA) Semester III MC0076 S-stems 1rogramming 4 Cre its (!oo" I#$ !0%11) Assignment Set 1 ((0 Mar"s) )ues $6 I entif- t,e following notations an efine t,em wit, e5amples$ (10 Mar"s)

(a) ?3 =3 D=3 an A efine t,em wit, e5amples The alphabet of >, denoted by the :ree* symbol , is the collection of symbols in its characterset. 9e will use lower case letters a, b, c, etc. to denote symbols in . A symbol in the alphabetis *nown as a terminal symbol %T' of >. The alphabet can be represented using the mathematicalnotation of a set, e.g. T [a, b,c z, 2, l,c 3\ /ere the symbols [, d, and\ are part of the notation. 9e call them metasymbols to differentiatethem from terminal symbols. Throughout this discussion we assume that metasymbols are distinctfrom the terminal symbols. If this is not the case, i.e. if a terminal symbol and a meta symbol areidentical, we enclose the terminal symbol in "uotes to differentiate it from the meta symbol. =or example, the set of punctuation symbols of $nglish can be defined as where d, denotes theterminal symbol dcomma. A nonterminal symbol %6T' is the name of a syntax category of a language, e.g. noun, verb, etc.An 6T is written as a single capital leter, or as a name enclosed between ZcW, e.g. A or Z 6ounW. )uring grammatical analysis, a nonterminal symbol represents an instance of the category.Thus, Z 6oun W represents a noun. $ach grammar : defines a language lg. : contains an 6T called the distinguished symbol or the start 6T of :. 7nless otherwise specified, we use the symbol S as the distinguished symbol of :. (.) I entif- t,e .asic elements of Arammar A $ach grammar : defines a language lg. : contains an 6T called the distinguished symbol or the start 6T of :. 7nless otherwise specified, we use the symbol S as the distinguished symbol of :. A valid string e of lg is obtained by using the following procedure &. >et eT dS. 1. 9hile e is not a string of terminal symbols %a' Select an 6T appea

MC0071, MC0072,MC0073,MC0074,MC0075

Page 26

Dinesh (521138580)
ring in e, say U. %c' 0eplace U by a string appearing on the 0/S of a production of U* )ues $ < Eow man- c,aracters can .e represente .- ASCII2% ata format/ +,at is t,e limitation of ASCII27 format/ Ans The code called AS?II %pronounced RAS-*eyR', which stands for American Standard ?ode forInformation Interchange, uses 4 bits for each character. Since there are exactly &1I uni"uecombinations of 4 bits, this 4-bit code can represent only characters. A more common version isAS?II-I, also called extended AS?II, which uses I bits per character and can represent 1FGdifferent characters. =or example, the letter A is represented by 2&22222&. The AS?IIrepresentation has been adopted as a standard by the 7.S. government and is found in a variety of computers, particularly minicomputers and microcomputers. The following table shows part of the AS?II-I code. 6ote that the byte 2&2222&& does represent the character 8?8. Ascii7 is a 7nicode-to-AS?II conversion module for programmers. It converts any 7nicodestring to 4bit AS?II preserving information. Available as a source code module, Ascii4 is aneasy way to support good 7nicode-to-AS?II conversion in your own applications. >e- features* ?onvert 7nicode strings to 4-bit 7S-AS?II. )rop diacritics. 0emove accents andumlauts. 0eplace special symbols with pure AS?II. ?onvert ?yrillic and :ree* letters to their>atin e"uivalents. :et rid of gargabe conversion. A4aila.le as source co e for$ <isual (asic G.2<isual (asic .6et<isual (asic for Applications!ther languages can be arranged on demand. Clease in"uire. =,e pro.lem. Today8s applications support a large range of 7nicode characters. /owever,compatibility often re"uires the use of 4-bit AS?II. ?haracter values must be forced to the 2 @ &14range. 9hat8s the best way to convert 7nicode text to AS?II^ Crogramming environments, suchas <isual (asic and the .6et framewor*, have lac*ing support for proper conversion. $ven whereavailable, conversion loses some non-AS?II characters and converts them to "uestion mar*s %^'.The result is loss of information and garbage text. =,e solution. This is where Ascii4 comes to help. Ascii4 converts 7nicode text to its AS?IIrepresentation. Instead of turning non-AS?II characters to garbage, it provides a meaningfulconversion. It does this by dropping diacritics from >atin letters and finding the closest AS?IIe"uivalent for a wide range of characters.9here an exact match is not possible, a reasonablee"uivalent is used. The text stays as intelligible as possible for a human reader. Suggeste uses* $nforce AS?II filenames for generated files. Croduce standards-compliant fileformats. ?ommon formats re"uiring 4-bit AS?II :I= file comment field, +/T file header linesand email headers. 9ith Ascii4 you convert national characters to an international format that isguaranteed to wor* everywhere. )ues $ ( Compare 0ISC Arc,itecture wit, CISC Arc,itecture/ +,at was t,e necessit- to mo4e to0ISC arc,itecture/ Ans The simplest way to examine the advantages and disadvantages of 0IS? architecture is bycontrasting it with it8s predecessor ?IS?%?omplex Instruction Set ?omputers' architecture.

MC0071, MC0072,MC0073,MC0074,MC0075

Page 27

Dinesh (521138580)
+ultiplying Two 6umbers in +emory !n the right is a diagram representing the storagescheme for a generic computer. The main memoryis divided into locations numbered from %row' & %column' & to %row' G %column' E. The executionunit is responsible for carrying out allcomputations. /owever, the execution unit canonly operate on data that has been loaded intoone of the six registers %A, (, ?, ), $, or ='. >et8ssay we want to find the product of two numbers -one stored in location 1 D and another stored inlocation F 1 - and then store the product bac* inthe location 1 D. The ?IS? Approach The primary goal of ?IS? architecture is tocomplete a tas* in as few lines of assembly aspossible. This is achieved by building processorhardware that is capable of understanding andexecuting a series of operations. =or this particulartas*, a ?IS? processor would come prepared witha specific instruction %we8ll call it R+7>TR'. 9hen executed, this instruction loads the twovalues into separate registers, multiplies the operands in the execution unit, and then storesthe product in the appropriate register. Thus, the entire tas* of multiplying two numbers canbe completed with one instruction +7>T 1 D, F 1 +7>T is what is *nown as a Rcomplex instruction.R It operates directly on the computer8smemory ban*s and does not re"uire the programmer to explicitly call any loading or storingfunctions. It closely resembles a command in a higher level language. =or instance, if we letRaR represent the value of 1 D and RbR represent the value of F 1, then this command isidentical to the ? statement Ra T a Y b.R !ne of the primary advantages of this system is that the compiler has to do very little wor*to translate a high-level language statement into assembly. (ecause the length of the code isrelatively short, very little 0A+ is re"uired to store instructions. The emphasis is put onbuilding complex instructions directly into the hardware. The 0IS? Approach 0IS? processors only use simple instructions that can be executed within one cloc* cycle.Thus, the R+7>TR command described above could be divided into three separatecommands R>!A),R which moves data from the memory ban* to a register, RC0!),R whichfinds the product of two operands located within the registers, and RST!0$,R which movesdata from a register to the memory ban*s. In order to perform the exact series of stepsdescribed in the ?IS? approach, a programmer would need to code four lines of assembly >!A) A, 1 D>!A) (, F 1

MC0071, MC0072,MC0073,MC0074,MC0075

Page 28

Dinesh (521138580)

C0!) A, (ST!0$ 1 D, A At first, this may seem li*e a much less efficient way of completing the operation. (ecausethere are more lines of code, more 0A+ is needed to store the assembly level instructions.The compiler must also perform more wor* to convert a high-level language statement intocode of this form./owever, the 0IS? strategy alsobrings some very importantadvantages. (ecause eachinstruction re"uires only one cloc*cycle to execute, the entireprogram will execute inapproximately the same amount of time as the multi-cycle R+7>TRcommand. These 0IS? RreducedinstructionsR re"uire less transistorsof hardware space than thecomplex instructions, leaving moreroom for general purpose registers.(ecause all of the instructions execute in a uniform amount of time %i.e. one cloc*',pipelining is possible. Separating the R>!A)R and RST!0$R instructions actually reduces the amount of wor* thatthe computer must perform. After a ?IS?-style R+7>TR command is executed, the processorautomatically erases the registers. If one of the operands needs to be used for anothercomputation, the processor must re-load the data from the memory ban* into a register. In0IS?, the operand will remain in the register until another value is loaded in its place )ues $ 7 #iscuss A ressing Mo es of Intel %0F%( wit, suita.le e5amples*

A))0$SSI6: +!)$S != I2IGAddressing mode indicates a way of locating data or operands. )ependingupon the data types used in the instruction and the memory addressingmodes, any instruction may belong to one or more addressing modes, orsome instruction may not belong to any of the addressing modes. Thus theaddressing modes describe the types of operands and the way they areaccessed for executing an instruction. /ere, we will present the addressingmodes of the instructions depending upon their types. According to theflow of instruction execution, the instructions may be categorized as%i' Se"uential control flow instructions and%ii' ?ontrol transfer instructions.Se"uential control flow instructions are the instructions, whichafter execution, transfer control to the next instruction appearingimmediately after it %in the se"uence' in the program. =or example, thearithmetic, logical, data transfer and processor control instructions arese"uential control flow instructions. The control transfer instructions,on the other hand, transfer control to some predefined addresssomehow specified in the instruction after their execution. =or example,

MC0071, MC0072,MC0073,MC0074,MC0075

Page 29

Dinesh (521138580)

I6T, ?A>>, 0$T and H7+C instructions fall under this category.The addressing modes for se"uential control transfer instructions areexplained as follows &. Immediate In this type of addressing, immediate data is a part ofinstruction, and appears in the form of successive byte or bytes.$xample +!< AU, 222F/In the above example, 222F/ is the immediate data. The immediatedata may be I-bit or &G-bit in size.1. )irect In the direct addressing mode, a &G-bit memory address%offset' is directly specified in the instruction as a part of it.$xample +!< AU, SF222/N/ere, data resides in a memory location in the data segment, whoseeffective address may be computed using F222/ as the offsetaddress and content of )S as segment address. The effectiveaddress, here, is &2/Y)SXF222/.D. 0egister In register addressing mode, the data is stored in a registerand it is referred using the particular register. All the registers,except IC, may be used in this mode.$xample +!< (U, AU.E. 0egister Indirect Sometimes, the address of the memory location,which contains data or operand, is determined in an indirect way,using the offset registers. This mode of addressing is *nown asregister indirect mode. In this addressing mode, the offset addressof data is in either (U or SI or )I registers. The default segment iseither )S or $S. The data is supposed to be available at the addresspointed to by the content of any of the above registers in the defaultdata segment.$xample +!< AU, S(UN/ere, data is present in a memory location in )S whose offsetaddress is in (U. The effective address of the data is given as&2/Y)SX S(UN.F. Indexed In this addressing mode, offset of the operand is stored inone of the index registers. )S and $S are the default segments forindex registers SI and )I respectively. This mode is a special case ofthe above discussed register indirect addressing mode.$xample +!< AU, SSIN/ere, data is available at an offset address stored in SI in )S. Theeffective address, in this case, is computed as &2/Y)SX SSIN.G. 0egister 0elative In this addressing mode, the data is available at aneffective address formed by adding an I-bit or &G-bit displacementwith the content of any one of the registers (U, (C, SI and )I inthe default %either )S or $S' segment. The example given beforeexplains this mode. $xample +!< Ax, F2/ S(UN/ere, effective address is given as &2/Y)SXF2/X S(UN.4. (ased Indexed The effective address of data is formed, in thisaddressing mode, by adding content of a base register %any one of(U or (C' to the content of an index register %any one of SI or )I'.The default segment register may be $S or )S.$xample +!< AU, S(UN SSIN/ere, (U is the base register and SI is the index register. Theeffective address is computed as &2/Y)SX S(UN X SSIN.I. 0elative (ased Indexed The effective address is formed by addingan I-bit or &Gbit displacement with the sum of contents of any oneof the bases registers %(U or (C' and any one of the index registers,in a default segment.$xample +!< AU, F2/ S(UN SSIN/ere, F2/ is an immediate displacement, (U is a base register andSI is an index register. The effective address of data is computed as&G2/Y)SX S(UN X SSIN X F2/.=or the control transfer instructions, the addressing modes dependupon whether the destination location is within the same segmentor a different one. It also depends upon the method of passingthe destination address to the processor. (asically, there are twoaddressing modes for the control transfer instructions, viz. inter-segment and intra-segment addressing modes.If the location to which the control is to be transferred lies in adifferent segment other than the current one, the mode is calledinter-segment mode. If the destination location lies in the samesegment, the mode is called intra-segment.Inter-segment )irectInter-segmentInter-segmentIndirect+odes for controlTransfer instructionsIntra-segmentIntra-segment)irectIntra-segmentIndirectAddressing +odes for ?ontrol Transfer Instruction 3. Intra-segment direct mode In this mode, the address to which thecontrol is to be transferred lies in the same segment in which the controltransfer instruction lies and appears directly in the instruction as animmediate displacement value. In this addressing mode, the

MC0071, MC0072,MC0073,MC0074,MC0075

Page 30

Dinesh (521138580)
displacementis computed relative to the content of the instruction pointer IC.The effective address to which the control will be transferred is givenby the sum of I or &G bit displacement and current content of IC. In caseof ;ump instruction, if the signed displacement %d' is of I bits %i.e. @ &1IZdZX&1I', we term it as short ;ump and if it is of&G bits %i.e. @ D14GIZXD14GI', it is termed as long ;ump.&2. Intra-segment Indirect +ode In this mode, the displacement to whichthe control is to be transferred, is in the same segment in which the controltransfer instruction lies, but it is passed to the instruction indirectly. /ere,the branch address is found as the content of a register or a memorylocation. This addressing mode may be used in unconditional branchinstructions.&&. Inter-segment )irect +ode In this mode, the address to which thecontrol is to be transferred is in a different segment. This addressing modeprovides a means of branching from one code segment to another codesegment. /ere, the ?S and IC of the destination address are specifieddirectly in the instruction.&1. Intersegment Indirect +ode In this mode, the address to which thecontrol is to be transferred lies in a different segment and it is passed tothe instruction indirectly, i.e. contents of a memory bloc* containing fourbytes, i.e. IC %>S(', IC %+S(', ?S %>S(' and ?S %+S(' se"uentially. Thestarting address of the memory bloc* may be referred using any of theaddressing modes, except immediate mode.I2IG I6ST07?TI!6 =!0+ATThe I2IG instruction sizes vary from one to six bytes. )ues $ % ?ist out t,e pass21 ata structures an pass22 ata structures* Ans Two Cass Assembler Cass & %define symbols' - Assign addresses to all statements- Save addresses assigned to all labels- Crocess assembler directives %e.g., 9!0), 0$S(, ... Cass 1 %assemble instructions L write output files' - Translate operation codes - Assemble operands- :enerate data values for (QT$ L 9!0) directives- Crocess STA0T and $6) directives- 9rite to ob;ect and listing files Algorithm Cass & ($:I6 initialize Scnt , >occtr , $6)val , and $rrorflag to 2 9/I>$ Sourceline S

MC0071, MC0072,MC0073,MC0074,MC0075

Page 31

Dinesh (521138580)
Scnt N is a comment ($:I6 increment Scnt $6) [while\ (rea*up Sourceline S Scnt N I= !pcode T 8STA0T8 T/$6 ($:I6 convert !perand from hex and save in >occtr and $6)val I= >abel not 67>> T/$6 Insert % >abel , >occtr ' into Symtab $6)I= increment Scnt (rea*up Sourceline S Scnt

MC0071, MC0072,MC0073,MC0074,MC0075

Page 32

Dinesh (521138580)
N $6) $6)I= 9/I>$ !pcode ZW 8$6)8 ($:I6 I= Sourceline S Scnt N is not a comment T/$6 ($:I6 I= >abel not 67>> T/$6 Usearch Symtab for >abel I= not found Insert % >abel , >occtr ' into Symtab $>S$ set errors flag in $rrors S Scnt N $6)I=

MC0071, MC0072,MC0073,MC0074,MC0075

Page 33

Dinesh (521138580)
$6)I= Usearch !pcodetab for !pcode I= found T/$6 )! ?AS$ &. !pcode is 80$S98 or 80$S(8 ($:I6 increment >occtr by Storageincr I= error T/$6 set errors flag in $rrors S Scnt N $6)I= $6) [case & %0$S9 or 0$S('\1. !pcode is 89!0)8 or 8(QT$8 T/$6 ($:I6 increment >occtr by Storageincr I= error T/$6 set errors flag in $rrors S Scnt

MC0071, MC0072,MC0073,MC0074,MC0075

Page 34

Dinesh (521138580)
N $6)I= $6) [case 1 %9!0) or (QT$'\D. !T/$09IS$ ($:I6 increment >occtr by !pcodeincr I= error T/$6 set errors flag in $rrors S Scnt N $6)I= [case D %default'\ $6) $6)?AS$ $>S$ #Y directives such as (AS$ handled here or Y# set errors flag in $rrors S Scnt N $6)I= $6) [I= bloc*\ $6)I= increment Scnt (rea*up Sourceline S Scnt

MC0071, MC0072,MC0073,MC0074,MC0075

Page 35

Dinesh (521138580)
N $6) [while\ I= >abel not 67>> T/$6 Usearch Symtab for >abel I= not found Insert % >abel , >occtr ' into Symtab $>S$ set errors flag in $rrors S Scnt N $6)I= $6)I= I= !perand not 67>> Usearch Symtab for !perand I= foundinstall in $6)val $6)I=

MC0071, MC0072,MC0073,MC0074,MC0075

Page 36

Dinesh (521138580)
$6)I= $6) [of Cass &\ Cass 1 ($:I6 initialize Scnt , >occtr , S*ip , and $rrorflag to 2write assembler report headings 9/I>$ Sourceline S Scnt N is a comment ($:I6 append to assembler reportincrement Scnt $6) [while\ (rea*up Sourceline S Scnt N I= !pcode T 8STA0T8 T/$6 ($:I6 convert !perand from hex and save in >occtr append to assembler reportincrement Scnt (rea*up

MC0071, MC0072,MC0073,MC0074,MC0075

Page 37

Dinesh (521138580)
Sourceline S Scnt N $6) $6)I= format and place the load point on ob;ect code arrayformat and place $6)val on ob;ect code array, index $6)loc 9/I>$ !pcode ZW 8$6)8 ($:I6 I= Sourceline S Scnt N is not a comment T/$6 ($:I6 Usearch !pcodetab for !pcode I= found T/$6 )! ?AS$ &. !pcode is 80$S98 or 80$S(8 ($:I6 increment >occtr by Storageincr place 8P8 on ob;ect code arrayreplace the value at index $6)loc with loader addressformat and place >occtr

MC0071, MC0072,MC0073,MC0074,MC0075

Page 38

Dinesh (521138580)
on ob;ect code arrayformat and place $6)val on ob;ect code array, index $6)loc set S*ip to & $6) 1. !pcode is 89!0)8 or 8(QT$8 ($:I6 increment >occtr by Storageincr )ostorage to get !b;line I= error T/$6 set errors flag in $rrors S Scnt N $6)I= $6) D. !T/$09IS$ ($:I6 increment >occtr by !pcodeincr )oinstruct to get !b;line I= error T/$6 set errors flag in

MC0071, MC0072,MC0073,MC0074,MC0075

Page 39

Dinesh (521138580)
$rrors S Scnt N $6)I= $6) $6)?AS$ $>S$ #Y directives such as (AS$ handled here or Y# set errors flag in $rrors S Scnt N $6)I= $6) $6)I= append to assembler report I= $rrors S Scnt N ZW 2 T/$6 ($:I6 set $rrorflag to &append error report to assembler report $6) $6)I= I= $rrorflag T 2 and S*ip T2 T/$6 ($:I6

MC0071, MC0072,MC0073,MC0074,MC0075

Page 40

Dinesh (521138580)
place !b;line on ob;ect code array $6) $6)I= I= S*ip T& T/$6 set S*ip to 2 $6)I= increment Scnt (rea*up Sourceline S Scnt N $6) [while\place 8P8 on ob;ect code array I= $rrorflag T2 T/$6 transfer ob;ect code array to file $6)I= $6) [of Cass 1\ )ata Structures &' !CTA( %operation code table' f mnemonic, machine code %instruction format, length' etc.f static tablef instruction lengthf array or hash table, easy for searchf ?ontents- +nemonic ?odes of all instructions- +achine language op code

MC0071, MC0072,MC0073,MC0074,MC0075

Page 41

Dinesh (521138580)

- !ther Information %for architectures with more that one length of instruction format'o >ength of instructiono Instruction formatsf In pass &- <alidate op codes- ?ompute instruction length %in SI?#U$'f In pass 1- Translate op codes to machine languagef !rganized as hash table- Static %no updates'1' SQ+TA( %symbol table' f label name, value, flag, %type, length' etc.f dynamic table %insert, delete, search'f hash table, non-random *eys, hashing functionf ?ontents- 6ame of symbol- Address %value'- $rror flags %from pass&'- !ther information attributes of data or instruction labeledf In pass &- $nter labels as they are encountered in source program- $nter addresses from >!??T0f In pass 1- >oo* up operand labels for addressesf Also organized as a hash table- $ntries only %no deletions'- 6on-random *eys -- watch hashing function D' >ocation ?ounter %>!??T0' f counted in bytes.f Initialized to address specified in STA0T directive.f >ength of each assembled instruction is added to >!??T0.f >!??T0 points to starting address of each statement in the program. Intermediate )ata . (etween Casses & and 1. =or each statement in source program- Address- $rror flagsCointers to !CTA( and SQ+TA(- !ther %more complicated languages' results of processing of operation and operandfields T9! CASS ASS$+(>$0

MC0071, MC0072,MC0073,MC0074,MC0075

Page 42

Dinesh (521138580)

3* #efine Macro* +rite a C program wit, a macro to fin out .iggest of two num.ers. Ans A macro is a fragment of code which has been given a name. 9henever the name is used, it is replacedby the contents of the macro. There are two *inds of macros. They differ mostly in what they loo* li*ewhen they are used. !b;ect-li*e macros resemble data ob;ects when used, function-li*e macros resemblefunction calls.Qou may define any valid identifier as a macro, even if it is a ? *eyword. The preprocessor does not *nowanything about *eywords.gincludeZstdio.hWgincludeZconio.hWgdefine :reatest%U,Q' UWQ^U Qint main%'[int x,y5scanf%Rhd hdR,Lx,Ly'5printf%RhdR,:reatest%x,y''5getch%'5\

Spring 2012 Master of Computer Application (MCA) Semester III MC0074 Statistical An Dumerical Met,o s 7sing CGG 4 Cre its (!oo" I#$ !0%12)

)uest1*

MC0071, MC0072,MC0073,MC0074,MC0075

Page 43

Dinesh (521138580)
=,irteen car s are rawn simultaneousl- from a pac" of car s* If aces count 13 face car s 10 an ot,ers accor ing to enomination3 fin t,e e5pectation of t,e total score on 16 car s* Solution$

Oues 1

MC0071, MC0072,MC0073,MC0074,MC0075

Page 44

Dinesh (521138580)

Oues D $xplain +ar*ov ?hains Solution

MC0071, MC0072,MC0073,MC0074,MC0075

Page 45

Dinesh (521138580)

MC0071, MC0072,MC0073,MC0074,MC0075

Page 46

Dinesh (521138580)

Spring 2012

MC0071, MC0072,MC0073,MC0074,MC0075

Page 47

Dinesh (521138580)
Master of Computer Application (MCA) Semester III +?224F @ Computer Detwor"s @ E ?redits (!oo" I#$ !0%16 & !0%14 ) Assignment Set 1 ((0 Mar"s) &. )escribe the classification of ?omputer 6etwor*s giving suitable real time examples for each class. Ans @ ?lassification of ?omputer 6etwor*s There is no generally taxonomy accepted into which all computer networ*s fit. The computer networ*s are classified depending on transmission technology and scale. ?omputer networ*s may be classified according to the networ* layerat which they operate according to some basic reference models that are considered to be standards in the industry such as the seven layer !SI reference model and the four layers T?C#IC model. =ew ways of classification are listed below.J (y transmission techni"ues ?omputer networ*s may be classified as broadcast or point to point networ*s.J (y scale to the scale or extent of reach of the networ*, for example as a Cersonal area networ* %CA6', >ocal area networ* %>A6', ?ampus area networ* %?A6', +etropolitan area networ* %+A6', or 9ide area networ*%9A6'.J (y connection method ?omputer networ*s may be classified according to the technology that is used to connect the individual devices in the networ* such as /ome C6A, Cower line communication, $thernet, or 9ireless >A6.J (y functional relationship ?omputer networ*s may be classified according to the functional relationships which exist between the elements of the networ*, for example Active 6etwor*ing, ?lient-server and Ceer-to-peer %wor*group' architectures.J (y networ* topology ?omputer networ*s may be classified accordingto the networ* topology upon which the networ* is based, such as (us

networ*, Star networ*, 0ing networ*, +esh networ*, Star-bus networ*, Treeor /ierarchical topology networ*, etc. This topic is covered in detail in unitE.J (y services provided ?omputer networ*s may be classified accordingto the services which they provide, such as Storage area networ*s, Serverfarms, Crocess control networ*s, <alue-added networ*, 9ireless communitynetwor*, etc.J (y Crotocol ?omputer networ*s may be classified according to thecommunications protocol that is being used on the networ*. 0ead thearticles on >ist of networ* protocols and protocol stac*s for moreinformation. The

MC0071, MC0072,MC0073,MC0074,MC0075

Page 48

Dinesh (521138580)
most common way of classifications is by transmission techni"ues, byscale and by the way the computers are connected. The first two ways arediscussed in the following section where as the classification by topology isdiscussed in unit E. (ased on transmission technology J (roadcast lin*sJ Coint-to-point lin*s(roadcast networ*s have a single communication channel that isshared by all the users on the networ*. Short messages are commonlycalled as pac*ets or frames %in certain context'. The user on the networ*sends pac*ets. All other machines receive these pac*ets. An address fieldwithin the pac*et or frame specifies the address of the destination machine.So upon receiving the pac*et, all machines chec* the address field. !nlyintended user uses or processes the pac*et or frame and others neglectand discard it. As an example in a class of F2 students, the teacher puts"uestion to say AUB student %where U is the name of the student'. All thestudents hear to the "uestion but will not answer as the "uestion isintended to U only. /ence only U will analyze the "uestion and others willnot respond.(roadcast system generally allows the possibility of addressing apac*et to all the destinations by using a special code in the address field.9hen this code is transmitted, it is received and processed by everymachine on the networ*. Again considering the above example A teacherput forth the "uestion in a class to all students. That is the teacher does notas* to a specific student by any uni"ue name. Then, all are supposed toanalyze the "uestion and answer. This mode of operation is referred to broadcasting . Some broadcasting systems also support transmission to a subset of the users, which is a group of users. This mode is called asmulticasting.In contrast the pointto-point networ* consists of many connectionsbetween individual pairs of machines. A pac*et to be sent from source todestination may have to first visit one or more intermediate machines.7sually different routes of different length are possible. So finding the bestpath or route is important in point-topoint networ*s. This type of transmission with one sender and one receiver is also referred to asunicasting.:eographically localized networ*s or smaller networ*s tend to usebroadcasting where as larger networ*s usually are point-to-point networ*s. (ased on the their scale At the top we have personal area networ*s %CA6', networ*s meant fora single person. =or example a wireless networ* connecting a computerwith its mouse, *eyboard and a printer can constitute a personal areanetwor*.(eyond the personal area networ* we have longer-range networ*s whichare broadly classified networ*s asJ >A6J +A6J 9A69e will see these three networ*s in detail later. =inally the connectionof two or more networ*s is called an inter-networ*. The world wide Internetis a well *nown example of inter-networ*. )istance is important as aclassification metric as different techni"ues are used at different scales. >ocal Area 6etwor*s >ocal Area 6etwor*s are generally called >A6s. They are privatelyowned networ*s within a single building or campus of up to few *ilometersin size. +ost of >A6Bs use (us or ring topology for connection and isillustrated as shown in fig. &.F. They are used to connect personalcomputers and wor*stations in company offices and factories to shareresources and exchange information. Traditional >A6s run at speeds of &2+bps to &22+bps, have low delay %microseconds and nanoseconds' andma*e very few errors. 6ewer >A6s operate at &2:bps. <arious topologiesare possible for broadcast >A6s. +etropolitan Area 6etwor*s A +etropolitan Area 6etwor*s, referred as +A6s covers a city. Thebest *nown example is cable television networ* available in many cities.$arlier these were used for T< reception only but with

MC0071, MC0072,MC0073,MC0074,MC0075

Page 49

Dinesh (521138580)
changes a two wayinternet service could be provided. A +A6 might loo* something li*e thesystem shown in figure &.G. In this system both television signals andinternet being fed into centralized head end for distribution to peopleBshome.?able television is not the only +A6. 0ecent developments in highspeed wireless internet access also resulted in +A6.A wide area networ* is referred as 9A6. 9A6 spans a largegeographical area often a continent or country. 9A6 contains a collectionof machines, traditionally called as hosts. As illustrated in figure &.4, thesehosts can be on >A6s and are connected by a subnet or also calledcommunication subnet. The hosts are owned by customers or are personalcomputers. The communication subnets are owned by a telephonecompany or internet service provider. The subnet carries the messagesfrom hosts to hosts, ;ust as telephone system carries words from spea*er tolistener. $ach host is connected to a >A6 on which a router is present.Sometimes a host may be connected directly to a router. The collection of communication lines and routers is called a communication subnet.In most 9A6s, the networ* contains many transmission lines eachconnecting a pair of routers. As illustrated in figure &.I, a pac*et is sentfrom one router to another via one or more intermediate routers. Thepac*et is received at each intermediate router in its entirety. That is storethe pac*et in full until the re"uired output line is free, and then forwards it.A subnet that wor*s according to this principle is called store and forward orpac*et switched subnet. 6ot all 9A6s are pac*et switched. A secondpossibility for a 9A6 is a satellite system. Satellite networ*s are inherentlybroadcast networ*s. 9ireless 6etwor*s The Italian physicist :uglielmo +arconi in &32&, demonstrated a ship-to-shore telegraph, using +orse code. +orse code is a collection of binarydigits called dots and dashes. +odern digital wireless systems have betterperformance, but the basic idea is the same. 9ireless networ*s are dividedinto three main categories. These are discussed below. System interconnection It is all about interconnecting the components of a computer usingshort range radio. $very computer has a monitor, *eyboard, mouse, printerconnected to the main unit by cables. (luetooth configuration is as shownin figure &.3%a'. Some companies got together to design a short rangewireless networ* called (luetooth to connect these components withoutwires.(lue tooth allows digital cameras, headsets, scanners, and otherdevices li*e even computers to connect to a computer by merely beingbrought within range. 6o cables, no driver installation, ;ust put them on andturn them on they wor*. 9ireless >A6s These are systems in which every computer has a radio modem and aantenna with which it can communicate with other systems. !ften there isan antenna on the ceiling that the machines tal* to as shown in figure&.3%b'. 9ireless >A6s are becoming common in small offices and homes,where installing $thernet is considered too much trouble. Also used in olderbuildings, company cafeterias, conference rooms etc. I$$$ I21.&& is thestandard for wireless >A6s. 9ireless 9A6s This is also wireless networ* but is a wide area system. 2* #escri.e t,e HSI reference mo el an compare it wit,=C1 I I1 mo el* Ans @ The !SI 0eference +odel This reference model is proposed by International standardorganization %IS!' as a a first step towards standardization of the protocolsused in various layers in &3ID by )ay and Mimmermann. This model iscalled !pen system Interconnection %!SI' reference model. It is referred !SIas it deals with connection open systems. That is the systems are open forcommunication with other systems. It consists of seven layers.

MC0071, MC0072,MC0073,MC0074,MC0075

Page 50

Dinesh (521138580)
>ayers of !SI +odel The principles that were applied to arrive at 4 layers &. A layer should be created where a different level of abstraction isneeded. 1. $ach layer should perform a well defined tas*.D. The function of each layer should define internationally standardizedprotocolsE. >ayer boundaries should be chosen to minimize the information flowacross the interface.F. The number of layers should not be high or too small. The IS!-!SI reference model is as shown in figure 1.F. As such thismodel is not a networ* architecture as it does not specify exact servicesand protocols. It ;ust tells what each layer should do and where it lies. Thebottom most layer is referred as physical layer. IS! has produced standardsfor each layers and are published separately.$ach layer of the IS!-!SI reference model are discussed below Chysical >ayer This layer is the bottom most layer that is concerned withtransmitting raw bits over the communication channel %physical medium'. The design issues have to do with ma*ing sure that when one side sends a& bit, it is received by other side as a & bit, and not as a 2 bit. It performsdirect transmission of logical information that is digital bit streams intophysical phenomena in the form of electronic pulses.+odulators#demodulators are used at this layer. The design issue herelargely deals with mechanical, electrical, and procedural interfaces, and thephysical transmission medium, which lies below this physical layer.In particular, it defines the relationship between a device and aphysical medium. This includes the layout of pins, voltages, and cablespecifications. /ubs, repeaters, networ* adapters and /ost (us Adapters%/(As used in Storage Area 6etwor*s' are physical-layer devices. The ma;orfunctions and services performed by the physical layer are

J $stablishment and termination of a connection to a communicationsmedium.J Carticipation in the process whereby the communication resources areeffectively shared among multiple users. =or example, contention resolutionand flow control.J +odulation, is a techni"ue of conversion between the representation of digital data in user e"uipment and the corresponding signals transmittedover a communications channel. These are signals operating over thephysical cabling %such as copper and fiber optic' or over a radio lin*.Carallel S?SI buses operate in this layer. <arious physical-layer$thernet standards are also in this layer5 $thernet incorporates both thislayer and the data-lin* layer. The same applies to other local-areanetwor*s, such as To*en ring, =))I, and I$$$ I21.&&, as well as personalarea networ*s such as (luetooth and I$$$ I21.&F.E. 1. )ata >in* >ayer The )ata >in* layer provides the functional and procedural means totransfer data between networ* entities and to detect and possibly correcterrors that may occur in the Chysical layer. That is it ma*es sure that themessage indeed reach the other end without corruption or without signaldistortion and noise. It accomplishes this tas* by having the sender brea*the input data up into the frames called data frames. The )>> of transmitter, then transmits the frames se"uentially, and processesac*nowledgement frames sent bac* by the receiver. After processingac*nowledgement frame, may be the transmitter needs to re-transmit acopy of the frame. So therefore the )>> at receiver is re"uired to detectduplications of frames. The best *nown example of this is $thernet. This layer manages theinteraction of devices with a shared medium. !ther examples of data lin*protocols are /)>? and A)??C for point-to-point or pac*et-switchednetwor*s and Aloha for local area networ*s. !n I$$$ I21 local areanetwor*s, and some non-I$$$ I21 networ*s such as =))I, this layer may besplit

MC0071, MC0072,MC0073,MC0074,MC0075

Page 51

Dinesh (521138580)
into a +edia Access ?ontrol %+A?' layer and the I$$$ I21.1 >ogical>in* ?ontrol %>>?' layer. It arranges bits from the physical layer into logicalchun*s of data, *nown as frames. This is the layer at which the bridges and switches operate. ?onnectivity isprovided only among locally attached networ* nodes forming layer 1domains for unicast or broadcast forwarding. !ther protocols may beimposed on the data frames to create tunnels and logically separated layer1 forwarding domain. The data lin* layer might implement a sliding window flow control andac*nowledgment mechanism to provide reliable delivery of frames5 that isthe case for S)>? and /)>?, and derivatives of /)>? such as >AC( and>AC). In modern practice, only error detection, not flow control using slidingwindow, is present in modern data lin* protocols such as Coint-to-Coint Crotocol %CCC', and, on local area networ*s, the I$$$ I21.1 >>? layer is notused for most protocols on $thernet, and, on other local area networ*s, itsflow control and ac*nowledgment mechanisms are rarely used. Slidingwindow flow control and ac*nowledgment is used at the transport layers byprotocols such as T?C. D. 6etwor* >ayer The 6etwor* layer provides the functional and procedural means of transferring variable length data se"uences from a source to a destinationvia one or more networ*s while maintaining the "uality of service re"uestedby the Transport layer. The 6etwor* layer performs networ* routingfunctions, and might also perform fragmentation and reassembly, andreport delivery errors. 0outers operate at this layer sending datathroughout the extended networ* and ma*ing the Internet possible. This isa logical addressing scheme values are chosen by the networ* engineer. The addressing scheme is hierarchical. The best *nown example of a layer D protocol is the Internet Crotocol %IC'.Cerhaps itBs easier to visualize this layer as managing the se"uence of human carriers ta*ing a letter from the sender to the local post office,truc*s that carry sac*s of mail to other post offices or airports, airplanesthat carry airmail between ma;or cities, truc*s that distribute mail sac*s in acity, and carriers that ta*e a letter to its destinations. Thin* of fragmentation as splitting a large document into smaller envelopes forshipping, or, in the case of the networ* layer, splitting an application ortransport record into pac*ets. The ma;or tas*s of networ* layer are listedJ It controls routes for individual message through the actual topology.J =inds the best route.J =inds alternate routes.J It accomplishes buffering and deadloc* handling. E. Transport >ayer The Transport layer provides transparent transfer of data betweenend users, providing reliable data transfer while relieving the upper layersof it. The transport layer controls the reliability of a given lin* through flowcontrol, segmentation#de-segmentation, and error control. Some protocolsare state and connection oriented. This means that the transport layer can*eep trac* of the segments and retransmit those that fail. The best *nownexample of a layer E protocol is the Transmission ?ontrol Crotocol %T?C'. The transport layer is the layer that converts messages into T?C segmentsor 7ser )atagram Crotocol %7)C', Stream ?ontrol Transmission Crotocol%S?TC', etc. pac*ets. Cerhaps an easy way to visualize the Transport >ayeris to compare it with a Cost !ffice, which deals with the dispatch andclassification of mail and parcels sent. )o remember, however, that a postoffice manages the outer envelope of mail. /igher layers may have thee"uivalent of double envelopes, such as cryptographic Cresentationservices that can be read by the addressee only.0oughly spea*ing, tunneling protocols operate at the transport layer,such as carrying non-IC protocols such as I(+Bs S6A or 6ovellBs ICU over anIC networ*, or endto-end encryption with IC security %IC sec'. 9hile :eneric0outing $ncapsulation %:0$' might seem to be a networ* layer protocol, if the encapsulation of the payload ta*es place only at endpoint, :0$becomes closer to a transport protocol that uses IC headers but containscomplete frames or pac*ets to deliver to an endpoint. The ma;or tas*s of Transport layer are listed below J It locates the

MC0071, MC0072,MC0073,MC0074,MC0075

Page 52

Dinesh (521138580)
other partyJ It creates a transport pipe between both end-users.J It brea*s the message into pac*ets and reassembles them at thedestination.J It applies flow control to the pac*et stream. F. Session >ayer The Session layer controls the dialogues#connections %sessions'between computers. It establishes, manages and terminates theconnections between the local and remote application. It provides for eitherfull-duplex or half-duplex operation, and establishes chec* pointing,ad;ournment, termination, and restart procedures. The !SI model made thislayer responsible for Rgraceful closeR of sessions, which is a property of T?C,and also for session chec* pointing and recovery, which is not usually usedin the Internet protocols suite. The ma;or tas*s of session layer are listedJ It is responsible for the relation between two end-users.J It maintains the integrity and controls the data exchanged between theendusers.J The end-users are aware of each other when the relation is established%synchronization'.J It uses naming and addressing to identify a particular user. J It ma*es sure that the lower layer guarantees delivering the message%flow control'. G. Cresentation >ayer The Cresentation layer transforms the data to provide a standardinterface for the Application layer. +I+$ encoding, data encryption andsimilar manipulation of the presentation are done at this layer to presentthe data as a service or protocol developer sees fit. $xamples of this layerare converting an $(?)I?-coded text file to an AS?II-coded file, orserializing ob;ects and other data structures into and out of U+>. The ma;or tas*s of presentation layer are listed below J It translates the language used by the application layer.J It ma*es the users as independent as possible, and then they canconcentrate on conversation. 4. Application >ayer %end users' The application layer is the seventh level of the seven-layer !SImodel. It interfaces directly to the users and performs common applicationservices for the application processes. It also issues re"uests to thepresentation layer. 6ote carefully that this layer provides services to user-defined application processes, and not to the end user. =or example, itdefines a file transfer protocol, but the end user must go through anapplication process to invo*e file transfer. The !SI model does not includehuman interfaces. The common application services sub layer provides functionalelements including the 0emote !perations Service $lement %comparable toInternet 0emote Crocedure ?all', Association ?ontrol, and TransactionCrocessing %according to theA?I)re"uirements'. Above the commonapplication service sub layer are functions meaningful to user applicationprograms, such as messaging %U.E22', directory %U.F22', file transfer%=TA+', virtual terminal %<TA+', and batch ;ob manipulation %HTA+'. A ?omparison of !SI and T?C#IC 0eference +odels ?oncepts central to the !SI model are J Services It tells what the layer does.J Interfaces It tells the processes above it how to access it. It specifieswhat parameters are and what result to expect.

MC0071, MC0072,MC0073,MC0074,MC0075

Page 53

Dinesh (521138580)

J Crotocols It provides the offered service. It is used in a layer and arelayers own business. The T?C#IC did not originally distinguish between the service, interface Lprotocols. The only real services offered by the internet layer are S$6) ICpac*ets and 0$?$I<$ IC pac*ets. The !SI model was devised before the protocols were invented. )ata lin*layer originally dealt only with point-to-point networ*s. 9hen broadcastnetwor*s came around, a new sub-layer had to be hac*ed into the model.9ith T?C#IC the reverse was true, the protocols came first and the modelwas really ;ust a description of the existing protocols. This T?C#IC model didfit any other protocol stac*. Then !SI model has seven layers and T?C#IC has four layers as shown infigure below?omparisons of the two reference modelsAnother difference is in the area of connectionless and connection orientedservices. The !SI model supports both these services in the networ* layerbut supports only connection oriented communication in the transportlayer. 9here as the T?C#IC has supports only connection lesscommunication in the networ* layer, and supports both these services inthe transport layer. A ?riti"ue of the T?C#IC 0eference +odelCroblems J Service, interface, and protocol not distinguishedJ 6ot a general modelJ /ost-to-networ* ,layer- not really a layerJ 6o mention of physical and data lin* layersJ +inor protocols deeply entrenched, hard to replace 6etwor* standardization 6etwor* standardization is a definition that has been approved by arecognized standards organization. Standards exist for programminglanguages, operating systems, data formats, communications protocols,and electrical interfaces. Two categories of standards J )e facto %>atin for ,from the fact-' standards These are those that have ;ust happened without any formal plan. These are formats that have become standard simply because a largenumber of companies have agreed to use them. They have not beenformally approved as standards $.g., I(+ C? for small office computers,76IU for operating systems in ?S departments. CostScript is a goodexample of a de facto standard.J )e ;ure %>atin for ,by law-' standards These are formal legal standards adopted by some authorizedstandardization body. Two classes of standard organizationsJ !rganizations established by treaty among national governments.J <oluntary, nontreaty organizations.=rom a userBs standpoint, standards are extremely important in thecomputer industry because they allow the combination of products fromdifferent manufacturers to create a customized system. 9ithout standards, only hardware and software from the same company could be usedtogether. In addition, standard user interfaces can ma*e it much easier tolearn how to use new applications.+ost official computer standards are set by one of the followingorganizations J A6SI %American 6ational Standards Institute'J IT7 %International Telecommunication 7nion'J I$$$ %Institute of $lectrical and $lectronic $ngineers'J IS! %International Standards !rganization' J <$SA

MC0071, MC0072,MC0073,MC0074,MC0075

Page 54

Dinesh (521138580)
%<ideo $lectronics Standards Association' (enefits of standardization J Allow different computers to communicate.J Increase the mar*et for products adhering to the standard. 9hoBs who in the telecommunication world^ ?ommon carriers private telephone companies %e.g., ATLT, 7SA'.J CTT %Cost, Telegraph L Telephone' administration nationalizedtelecommunication companies %most of the world'.J IT7 %International Telecommunication 7nion' an agency of the 76 forinternational telecommunication coordination.J ??ITT %an acronym for its =rench name' one of the organs of IT7 %i.e., IT7- T', specialized for telephone and data communication systems. 6* E5plain t,e following wit, respect to #ataCommunications$ A) @ourier anal-sis !) !an limite signalsC) Ma5imum ata rate of a c,annel Ans @ A)@ourier anal-sis In &3th century, the =rench mathematician =ourier proved that any periodicfunction of time g %t' with period T can be constructed by summing anumber of cosines and sines.%D.&'9here fT&#T is the fundamental fre"uency, and are the sine and cosineamplitudes of the n th harmonics. Such decomposition is called a =ourierseries. !) !an limite signals ?onsider the signal given in figure below. =igure shows the signal that is theAS?II representation of the character AbB which consists of the bit patternA2&&222&2B along with its harmonics.Any transmission facility cannot pass all the harmonics and hence fewof the harmonics are diminished and distorted. The bandwidth is restrictedto low fre"uencies consisting of &, 1, E, and I harmonics and thentransmitted. =igure D.&%b' to D.&%e' shows the spectra and reconstructedfunctions for these band-limited signals.>imiting the bandwidth limits the data rate even for perfect channels./owever complex coding schemes that use several voltage levels do existand can achieve higher data rates. C) Ma5imum ata rate of a c,annel In &31E, /. 6y"uist realized the existence of the fundamental limitand derived the e"uation expressing the maximum data for a finitebandwidth noiseless channel. In &3EI, ?laude Shannon carried 6y"uist wor*further and extended it to the case of a channel sub;ect to random noise.In communications, it is not really the amount of noise that concernsus, but rather the amount of noise compared to the level of the desiredsignal. That is, it is the ratio of signal to noise power that is important,rather than the noise power alone. This Signal-to-6oise 0atio %S60', usuallyexpressed in decibel %d(', is one of the most important specifications of anycommunication system. The decibel is a logarithmic unit used forcomparisons of power levels or voltage levels. In order to understand theimplication of d(, it is important to *now that a sound level of zero d(corresponds to the threshold of hearing, which is the smallest sound thatcan be heard. A normal speech conversation would measure about G2 d(.If an arbitrary signal is passed through the >ow pass filter of bandwidth /, the filtered signal can be completely reconstructed by ma*ingonly 1/ samples per second. Sampling the line faster than 1/ per second ispointless. If the signal consists of < discrete levels, then 6y"uist theoremstates that, for a noiseless channel+aximum data rate T 1/.log 1 %<' bits per second. %D.1'=or a noisy channel with bandwidth is again

MC0071, MC0072,MC0073,MC0074,MC0075

Page 55

Dinesh (521138580)
/ , *nowing signal to noise ratio S#6 , the maximum data rate according to Shannon is given as+aximum data rate T /.log 1 %&XS#6' bits per second. %D.D'

4* E5plain in etail t,e Internet Arc,itecture$ !1222(3 !22<( Ans @ A'Internet Architecture (&-11G, (1-FG The Internet is a worldwide, publicly accessible networ* of interconnected computer networ*s that transmit data by pac*et switchingusing the standard Internet Crotocol %IC'. It is a Rnetwor* of networ*sR thatconsists of millions of smaller domestic, academic, business, andgovernment networ*s, which together carry various information andservices, such as electronic mail, online chat, file transfer, and theinterlin*ed web pages and other documents of the 9orld 9ide 9eb. /ow are networ*s interconnected to form an internetwor*^ Theanswer has two parts. Chysically, two networ*s can only be connected by acomputer that attaches both of them. (ut ;ust a physical connection cannotprovide interconnection where information can be exchanged as there is noguarantee that the computer will cooperate with other machines that wishto communicate.Internet is not restricted in size. Internets exist that contain a fewnetwor*s and internets also exist that contain thousands of networ*s.Similarly the number of computers attached to each networ* in an internetcan vary. Some networ*s have no computers attached, while others havehundreds. To have a viable internet, we need a special computer that is willing totransfer pac*ets from one networ* to another. ?omputers that interconnecttwo networ*s and pass pac*ets from one to the other are called internetgateways or internet routers.

<* E5plain t,e following ifferent classes of I1 a Ans @ A'Crimary addresses

resses$

!ut of five the three classes are called ?lass A, ?lass (, and ?lass ?. These three classes together are often referred to as RclassfulR addressingor primary address class.$ach class fixes the boundary between the networ*-prefix and thehost-number at a different point within the D1-bit address. The formats of the fundamental address classes are illustrated in =igure 1.&%a'. !ne of thefundamental features of classful IC addressing is that each address containsa self-encoding *ey that identifies the dividing point between the networ*-prefix and the host-number. (' ?lass A 6etwor*s %#I Crefixes' $ach ?lass A networ* address has an I-bit networ*-prefix with thehighest order bit set to 2 and a seven-bit networ* number, followed by a 1E-bit host-number. Today, it is no longer considered AmodernB to refer to a?lass A networ*. ?lass A networ*s are now referred to as R#IsR %pronouncedRslash eightR or ;ust ReightsR' since they have an I-bit networ*-prefix.A maximum of &1G %14-1' #I networ*s can be defined as shown infigure 1.&%b'. The calculation re"uires that the 1 is subtracted because the #I networ* 2.2.2.2 is reserved for use as the

MC0071, MC0072,MC0073,MC0074,MC0075

Page 56

Dinesh (521138580)
default route and the #Inetwor* &14.2.2.2 %also written &14#I or &14.2.2.2#I' has been reserved forthe Rloop bac*R function. $ach #I supports a maximum of &G,444,1&E %11E -1' hosts per networ*. The host calculation re"uires that 1 is subtractedbecause the all-2s %Rthis networ*R' and all-&s %RbroadcastR' host-numbersmay not be assigned to individual hosts.Since the#I address bloc* contains 1D&%1,&E4,EID,GEI' individualaddresses and the ICvE address space contains a maximum of 1D1 %E,13E,3G4,13G' addresses, the #I address space is F2h of the total ICvEunicast address space. ?' ?lass ( 6etwor*s %#&G Crefixes' $ach ?lass ( networ* address has a &G-bit networ*-prefix with thetwo highest order bits set to &-2 and a &E-bit networ* number, followed bya &G-bit host-number as illustrated in figure 1.&%b'. ?lass ( networ*s arenow referred to asR#&GsR since they have a &G-bit networ*-prefix.A maximum of &G,DIE %1&E' #&G networ*s can be defined with up toGF,FDE %1&G-1' hosts per networ*. Since the entire #&G address bloc*contains 1D2 %&,24D,4E&,I1E' addresses, it represents 1Fh of the total ICvEunicast address space. )' ?lass ? 6etwor*s %#1E Crefixes' $ach ?lass ? networ* address has a 1E-bit networ*-prefix with thethree highest order bits set to &-&-2 and a 1&-bit networ* number, followedby an I-bit host-number as shown in figure 1.&%b'. ?lass ? networ*s arenow referred to as R#1EsR since they have a 1E-bit networ*-prefix. Amaximum of 1,234,&F1 %11&' #1E networ*s can be defined with up to 1FE %1I-1' hosts per networ*. Since the entire #1E address bloc* contains 113 %FDG,I42,3&1' addresses, it represents &1.Fh %or &#Ith' of the total ICvEunicast address space.

(* E5plain t,e ifferent t-pes of a

ress resolution wit, respect to$

J 0esolution t,roug, #irect mapping J 0esolution t,roug, #-namic !in ing 0esolution t,roug, #irect mapping 6etwor* layer addresses must be resolved into data lin* layer addresses numerous times during the travel of each datagram across an internetwor*. 9e therefore want the process to be as simple and efficient as possible. The easiest method of accomplishing this is to do direct mapping between the two types of addresses. The basic idea behind direct mapping is to choose a scheme for layer two and layer three addresses so that you can determine one from the other using a simple algorithm. This enables you to ta*e the layer three address, and follow a short procedure to convert it into a layer two address. In essence, whenever you have the layer three address you already have the layer two address.

MC0071, MC0072,MC0073,MC0074,MC0075

Page 57

Dinesh (521138580)
The simplest example of direct mapping would be if we used the same structure and semantics for both data lin* and networ* layer addresses. This is generally impractical, because the two types of addresses serve different purposes, and are therefore based on incompatible standards. /owever, we can still perform direct mapping if we have the flexibility of creating layer three addresses that are large enough to encode a complete data lin* layer address within them. Then, determining the layer two address is a simple matter of selecting a certain portion of the layer three address.

#-namic A

ress 0esolution

)irect mapping provides a simple and highly efficient means of resolving networ* layer addresses into data lin* layer addresses. 7nfortunately, it is a techni"ue that we either cannot or should not use in a ma;ority of cases. 9e cannot use it when the size of the data lin* layer address is larger than that of the networ* layer address. 9e shouldn8t use it when we need flexibility, because direct mapping re"uires us to ma*e layer three and layer two addresses correspond. The alternative to direct mapping is a techni"ue called dynamic address resolution. To understand how this wor*s, we can consider a simple analogy. I8m sure you8ve seen limousine drivers waiting to pic* up a person at the airport they do not *now personally. %9ell, you8ve seen it in a movie, haven8t you^' This is similar to our problem they *now the name of the person they must transport, but not the person8s face %a type of ,local address- in a manner of spea*ingP' To find the person, they hold up a card bearing that person8s name. $veryone other than that person ignores the card, but hopefully the individual being sought will recognize it and approach the driver.

MC0071, MC0072,MC0073,MC0074,MC0075

Page 58

You might also like