Notes of Add On Content

Embed Size (px)

Citation preview

  • 8/7/2019 Notes of Add On Content

    1/68

    Geethanjali College Of Engineering and TechnologyDepartment Of CSE

    SUB:Computer Programming and Data Structures:

    Topics:

    1)Abstract Data Type:

    An Abstract Data type is defined as a mathematical model of the data objects thatmake up a data type as well as the functions that operate on these objects. Thereare no standard conventions for defining them. A broad division may be drawnbetween "imperative" and "functional" definition styles.

    Imperative abstract data type definitions

    In the "imperative" view, which is closer to the philosophy of imperative statementlanguages, an abstract data structure is conceived as an entity that is mutable meaning that it may be in different states at different times. Some operations maychange the state of the ADT; therefore, the order in which operations areevaluated is important, and the same operation on the same entities may havedifferent effects if executed at different times just like the instructions of acomputer, or the commands and procedures of an imperative language. Tounderscore this view, it is customary to say that the operations are executedor

    applied, rather than evaluated. The imperative style is often used when describingabstract algorithms.

    Abstract variable

    Imperative ADT definitions often depend on the concept of an abstract variable,which may be regarded as the simplest non-trivial ADT. An abstract variable Vis a

    mutable entity that admits two operations:

    store(V,x) wherexis a value of unspecified nature; and fetch(V), that yields a value;

    Page 1

  • 8/7/2019 Notes of Add On Content

    2/68

    Geethanjali College Of Engineering and TechnologyDepartment Of CSE

    fetch (V) always returns the valuexused in the most recent store(V,x)operation on the same variable V.

    As in many programming languages, the operation store (V,x) is often written V

    x(or some similar notation), and fetch(V) is implied whenever a variable Vis usedin a context where a value is required. Thus, for example, V V+ 1 is commonlyunderstood to be a shorthand for store (V, fetch (V) + 1).

    In this definition, it is implicitly assumed that storing a value into a variable Uhasno effect on the state of a distinct variable V. To make this assumption explicit,one could add the constraint that

    ifUand Vare distinct variables, the sequence { store(U,x); store(V,y) } isequivalent to { store(V,y); store(U,x) }.

    More generally, ADT definitions often assume that any operation that changes thestate of one ADT instance has no effect on the state of any other instance(including other instances of the same ADT) unless the ADT axioms imply thatthe two instances are connected in that sense. For example, when extending thedefinition of abstract variable to include abstract records, the operation that selectsa field from a record variable Rmust yield a variable Vthat is aliased to that part ofR.

    2) Bucket sorting:

    Bucket sort, orbin sort, is a sorting algorithm that works by partitioning an arrayinto a number of buckets. Each bucket is then sorted individually, either using adifferent sorting algorithm, or by recursively applying the bucket sorting algorithm.It is a distribution sort, and is a cousin of radix sort in the most to least significantdigit flavour. Bucket sort is a generalization of Pigeon hole sort. Since bucket sortis not a comparison sort, the (n log n) lower bound is inapplicable. The

    computational complexity estimates involve the number of buckets.

    Bucket sort works as follows:

    1. Set up an array of initially empty "buckets."2. Scatter: Go over the original array, putting each object in its bucket.3. Sort each non-empty bucket.

    4. Gather: Visit the buckets in order and put all elements back into the originalarray.

    Page 2

  • 8/7/2019 Notes of Add On Content

    3/68

    Geethanjali College Of Engineering and TechnologyDepartment Of CSE

    SUB: Advanced Data Structures

    SECOND YEAR

    Topics:1) Fundamental concepts of OOPS.

    Not all of these concepts are to be found in all object-oriented programminglanguages, and so object-oriented programming that uses classes is calledsometime prototype based programming. In particular, prototype basedprogramming does not typically use classes. As a result, a significantly different

    yet analogous terminology is used to define the concepts ofobjectand instance.Benjamin Cuire Pierce and some other researchers view as futile any attempt todistill OOP to a minimal set of features. He nonetheless identifies fundamentalfeatures that support the OOP programming style in most object-orientedlanguages

    Dynamic Dispatch:

    When a method is invoked on an object, the object itself determines what codegets executed by looking up the method at run time in a table associated with theobject. This feature distinguishes an object from an abstract data type(or module),which has a fixed (static) implementation of the operations for all instances. It is aprogramming methodology that gives modular component development while atthe same time being very efficient.Encapsulation (or multi methods, in which case the state is kept separate)Subtype PolymorphismObject inheritanceOpen Recursion a special variable (syntactically it may be a keyword), usuallycalled this or self, that allows a method body to invoke another method body of thesame object. This variable is late-bound; it allows a method defined in one class toinvoke another method that is defined later, in some subclass thereof.Similarly, in his 2003 book, Concepts in programming languages, John C. Mitchellidentifies four main features: dynamic dispatch, abstraction, subtype

    Page 3

    G th j li C ll Of E i i d T h l

    http://en.wikipedia.org/wiki/Abstraction_(computer_science)http://en.wikipedia.org/wiki/Abstraction_(computer_science)
  • 8/7/2019 Notes of Add On Content

    4/68

    Geethanjali College Of Engineering and TechnologyDepartment Of CSE

    polymorphism, and inheritance.Michael Lee Scott in Programming LanguagePragmatics considers only encapsulation, inheritance and dynamic dispatch.

    InstanceOne can have an instance of a class; the instance is the actual object created atrun-time. In programmer vernacular, the Lassie object is an instance of the Dogclass. The set of values of the attributes of a particular object is called its stateobject consists of state and the behavior that's defined in the object's classes.

    2)Trees and Graphs:

    A labeled tree with 6 vertices and 5 edgesVertices vEdges v- 1Chromatic number 2v d eIn mathematics, more specifically graph theory, a tree is an undirected graph inwhich any two vertices are connected by exactly onesimple path. In other words,any connected graph without cycles is a tree. A forest is a disjoint union of trees.The various kinds oftrees used as data structures in computer science are notreally trees in this sense, but rather, types of ordered directed trees.A tree is an undirected simple graphG that satisfies any of the following

    equivalent conditions:G is connected and has no cycles.G has no cycles, and a simple cycle is formed if any edge is added to G.

    Page 4

    G th j li C ll Of E i i d T h l

    http://en.wikipedia.org/wiki/Vertex_(graph_theory)http://en.wikipedia.org/wiki/Edge_(graph_theory)http://en.wikipedia.org/wiki/Chromatic_numberhttp://en.wikipedia.org/wiki/Template:Infobox_graphhttp://en.wikipedia.org/w/index.php?title=Template_talk:Infobox_graph&action=edit&redlink=1http://en.wikipedia.org/w/index.php?title=Template:Infobox_graph&action=edithttp://en.wikipedia.org/wiki/Mathematicshttp://en.wikipedia.org/wiki/Graph_theoryhttp://en.wikipedia.org/wiki/Graph_(mathematics)http://en.wikipedia.org/wiki/Vertex_(graph_theory)http://en.wikipedia.org/wiki/Path_(graph_theory)http://en.wikipedia.org/wiki/Connectednesshttp://en.wikipedia.org/wiki/Cycle_(graph_theory)http://en.wikipedia.org/wiki/Disjoint_unionhttp://en.wikipedia.org/wiki/Tree_(data_structure)http://en.wikipedia.org/wiki/Data_structureshttp://en.wikipedia.org/wiki/Computer_sciencehttp://en.wikipedia.org/wiki/Graph_(mathematics)#Simple_graphhttp://en.wikipedia.org/wiki/Equivalenthttp://en.wikipedia.org/wiki/Connected_graphhttp://en.wikipedia.org/wiki/Closed_walkhttp://en.wikipedia.org/wiki/Edge_(graph_theory)http://en.wikipedia.org/wiki/File:Tree_graph.svghttp://en.wikipedia.org/wiki/Vertex_(graph_theory)http://en.wikipedia.org/wiki/Edge_(graph_theory)http://en.wikipedia.org/wiki/Chromatic_numberhttp://en.wikipedia.org/wiki/Template:Infobox_graphhttp://en.wikipedia.org/w/index.php?title=Template_talk:Infobox_graph&action=edit&redlink=1http://en.wikipedia.org/w/index.php?title=Template:Infobox_graph&action=edithttp://en.wikipedia.org/wiki/Mathematicshttp://en.wikipedia.org/wiki/Graph_theoryhttp://en.wikipedia.org/wiki/Graph_(mathematics)http://en.wikipedia.org/wiki/Vertex_(graph_theory)http://en.wikipedia.org/wiki/Path_(graph_theory)http://en.wikipedia.org/wiki/Connectednesshttp://en.wikipedia.org/wiki/Cycle_(graph_theory)http://en.wikipedia.org/wiki/Disjoint_unionhttp://en.wikipedia.org/wiki/Tree_(data_structure)http://en.wikipedia.org/wiki/Data_structureshttp://en.wikipedia.org/wiki/Computer_sciencehttp://en.wikipedia.org/wiki/Graph_(mathematics)#Simple_graphhttp://en.wikipedia.org/wiki/Equivalenthttp://en.wikipedia.org/wiki/Connected_graphhttp://en.wikipedia.org/wiki/Closed_walkhttp://en.wikipedia.org/wiki/Edge_(graph_theory)
  • 8/7/2019 Notes of Add On Content

    5/68

    Geethanjali College Of Engineering and TechnologyDepartment Of CSE

    G is connected, and it is not connected anymore if any edge is removed from G.G is connected and the 3-vertex complete graph K3 is not a minorofG.Any two vertices in G can be connected by a unique simple path.IfG has finitely many vertices, say n of them, then the above statements are also

    equivalent to any of the following conditions:G is connected and has n 1 edges.G has no simple cycles and has n 1 edges.

    SUB: UNIX Shell Programming:

    Topic:

    1) Inter-process communication

    In computing, Inter-process communication (IPC) is a set of techniques for theexchange of data among multiple threads in one or more processes. Processesmay be running on one or more computers connected by a network. IPCtechniques are divided into methods formessage passing, synchronization,shared memory, and remote procedure calls (RPC). The method of IPC used mayvary based on the bandwidth and latency of communication between the threads,

    and the type of data being communicated.

    There are several reasons for providing an environment that allows processcooperation:

    Information sharing speedup; Modularity; Convenience; and Privilege separation.

    IPC may also be referred to as inter-thread communication and inter-applicationcommunication.

    IPC, on par with the address space concept, is the foundation for address spaceindependence/isolation.[

    Page 5

    Geethanjali College Of Engineering and Technology

    http://en.wikipedia.org/wiki/Complete_graphhttp://en.wikipedia.org/wiki/Minor_(graph_theory)http://en.wikipedia.org/wiki/Path_(graph_theory)http://en.wikipedia.org/wiki/Computinghttp://en.wikipedia.org/wiki/Thread_(computer_science)http://en.wikipedia.org/wiki/Process_(computing)http://en.wikipedia.org/wiki/Computer_networkhttp://en.wikipedia.org/wiki/Message_passinghttp://en.wikipedia.org/wiki/Synchronization_(computer_science)http://en.wikipedia.org/wiki/Shared_memoryhttp://en.wikipedia.org/wiki/Remote_procedure_callhttp://en.wikipedia.org/wiki/Privilege_separationhttp://en.wikipedia.org/wiki/Address_spacehttp://en.wikipedia.org/wiki/Inter-process_communication#cite_note-0http://en.wikipedia.org/wiki/Complete_graphhttp://en.wikipedia.org/wiki/Minor_(graph_theory)http://en.wikipedia.org/wiki/Path_(graph_theory)http://en.wikipedia.org/wiki/Computinghttp://en.wikipedia.org/wiki/Thread_(computer_science)http://en.wikipedia.org/wiki/Process_(computing)http://en.wikipedia.org/wiki/Computer_networkhttp://en.wikipedia.org/wiki/Message_passinghttp://en.wikipedia.org/wiki/Synchronization_(computer_science)http://en.wikipedia.org/wiki/Shared_memoryhttp://en.wikipedia.org/wiki/Remote_procedure_callhttp://en.wikipedia.org/wiki/Privilege_separationhttp://en.wikipedia.org/wiki/Address_spacehttp://en.wikipedia.org/wiki/Inter-process_communication#cite_note-0
  • 8/7/2019 Notes of Add On Content

    6/68

    Geethanjali College Of Engineering and TechnologyDepartment Of CSE

    2)Signal processing

    Signal processing is an area ofelectrical engineering and applied mathematicsthat deals with operations on or analysis of signals, in either discrete or continuous

    time, to perform useful operations on those signals. Signals of interest can includesound, images, time-varying measurement values and sensordata, for examplebiological data such as electrocardiograms, control system signals,telecommunication transmission signals such as radio signals, and many others.Signals are analog or digital electrical representations of time-varying or spatial-varying physical quantities. In the context of signal processing, arbitrary binarydata streams and on-off signals are not considered as signals, but only analog anddigital signals that are representations of analog physical quantities.

    Categories of signal processing

    Analog signal processing

    Analog signal processing is for signals that have not been digitized, as in classicalradio, telephone, radar, and television systems. This involves linear electroniccircuits such as passive filters, active filters, additive mixers, integrators and delaylines. It also involves non-linear circuits such as compandors, multiplicators(frequency mixers and voltage-controlled amplifiers), voltage-controlled filters,

    voltage-controlled oscillators and phase-locked loops.

    Discrete time signal processing

    Discrete time signal processing is for sampled signals that are considered asdefined only at discrete points in time, and as such are quantized in time, but notin magnitude.

    Analog discrete-time signal processingis a technology based on electronicdevices such as sample and hold circuits, analog time-division multiplexers,analog delay lines and analog feedback shift registers. This technology was apredecessor of digital signal processing (see below), and is still used in advancedprocessing of gigahertz signals.

    The concept of discrete-time signal processing also refers to a theoreticaldiscipline that establishes a mathematical basis for digital signal processing,without taking quantization errorinto consideration.

    Page 6

    Geethanjali College Of Engineering and Technology

    http://en.wikipedia.org/wiki/Electrical_engineeringhttp://en.wikipedia.org/wiki/Applied_mathematicshttp://en.wikipedia.org/wiki/Audio_signal_processinghttp://en.wikipedia.org/wiki/Image_processinghttp://en.wikipedia.org/wiki/Sensorhttp://en.wikipedia.org/wiki/Electrocardiogramhttp://en.wikipedia.org/wiki/Control_systemhttp://en.wikipedia.org/wiki/Transmission_(telecommunications)http://en.wikipedia.org/wiki/Signal_(electronics)http://en.wikipedia.org/wiki/Analog_signal_processinghttp://en.wikipedia.org/wiki/Passive_filterhttp://en.wikipedia.org/wiki/Active_filterhttp://en.wikipedia.org/wiki/Electronic_mixerhttp://en.wikipedia.org/wiki/Integratorhttp://en.wikipedia.org/wiki/Delay_linehttp://en.wikipedia.org/wiki/Delay_linehttp://en.wikipedia.org/wiki/Compandorhttp://en.wikipedia.org/wiki/Frequency_mixerhttp://en.wikipedia.org/wiki/Voltage-controlled_amplifierhttp://en.wikipedia.org/wiki/Voltage-controlled_filterhttp://en.wikipedia.org/wiki/Voltage-controlled_oscillatorhttp://en.wikipedia.org/wiki/Phase-locked_loophttp://en.wikipedia.org/wiki/Sample_and_holdhttp://en.wikipedia.org/wiki/Multiplexerhttp://en.wikipedia.org/wiki/Analog_delay_linehttp://en.wikipedia.org/wiki/Analog_feedback_shift_registerhttp://en.wikipedia.org/wiki/Quantization_errorhttp://en.wikipedia.org/wiki/Electrical_engineeringhttp://en.wikipedia.org/wiki/Applied_mathematicshttp://en.wikipedia.org/wiki/Audio_signal_processinghttp://en.wikipedia.org/wiki/Image_processinghttp://en.wikipedia.org/wiki/Sensorhttp://en.wikipedia.org/wiki/Electrocardiogramhttp://en.wikipedia.org/wiki/Control_systemhttp://en.wikipedia.org/wiki/Transmission_(telecommunications)http://en.wikipedia.org/wiki/Signal_(electronics)http://en.wikipedia.org/wiki/Analog_signal_processinghttp://en.wikipedia.org/wiki/Passive_filterhttp://en.wikipedia.org/wiki/Active_filterhttp://en.wikipedia.org/wiki/Electronic_mixerhttp://en.wikipedia.org/wiki/Integratorhttp://en.wikipedia.org/wiki/Delay_linehttp://en.wikipedia.org/wiki/Delay_linehttp://en.wikipedia.org/wiki/Compandorhttp://en.wikipedia.org/wiki/Frequency_mixerhttp://en.wikipedia.org/wiki/Voltage-controlled_amplifierhttp://en.wikipedia.org/wiki/Voltage-controlled_filterhttp://en.wikipedia.org/wiki/Voltage-controlled_oscillatorhttp://en.wikipedia.org/wiki/Phase-locked_loophttp://en.wikipedia.org/wiki/Sample_and_holdhttp://en.wikipedia.org/wiki/Multiplexerhttp://en.wikipedia.org/wiki/Analog_delay_linehttp://en.wikipedia.org/wiki/Analog_feedback_shift_registerhttp://en.wikipedia.org/wiki/Quantization_error
  • 8/7/2019 Notes of Add On Content

    7/68

    Geethanjali College Of Engineering and TechnologyDepartment Of CSE

    Digital signal processing

    Digital signal processing is for signals that have been digitized. Processing is doneby general-purpose computers or by digital circuits such as ASICs,field-

    programmable gate arrays or specialized digital signal processors (DSP chips).Typical arithmetical operations include fixed-point and floating-point, real-valuedand complex-valued, multiplication and addition. Other typical operationssupported by the hardware are circular buffers and look-up tables. Examples ofalgorithms are the Fast Fourier transform (FFT), finite impulse response (FIR)filter, Infinite impulse response (IIR) filter, Wiener filter, Adaptive filterand Kalmanfilter.

    Fields of signal processing

    Statistical signal processing analyzing and extracting information fromsignals and noise based on their stochastic properties

    Audio signal processing for electrical signals representing sound, suchas speech or music

    Speech signal processing for processing and interpreting spoken words Image processing in digital cameras, computers, and various imaging

    systems Video processing for interpreting moving pictures Array processing for processing signals from arrays of sensors

    Page 7

    Geethanjali College Of Engineering and Technology

    http://en.wikipedia.org/wiki/Digital_signal_processinghttp://en.wikipedia.org/wiki/Computerhttp://en.wikipedia.org/wiki/Application-specific_integrated_circuithttp://en.wikipedia.org/wiki/Field-programmable_gate_arrayhttp://en.wikipedia.org/wiki/Field-programmable_gate_arrayhttp://en.wikipedia.org/wiki/Digital_signal_processorhttp://en.wikipedia.org/wiki/Fixed-point_arithmetichttp://en.wikipedia.org/wiki/Floating-pointhttp://en.wikipedia.org/wiki/Circular_bufferhttp://en.wikipedia.org/wiki/Look-up_tablehttp://en.wikipedia.org/wiki/Fast_Fourier_transformhttp://en.wikipedia.org/wiki/Finite_impulse_responsehttp://en.wikipedia.org/wiki/Infinite_impulse_responsehttp://en.wikipedia.org/wiki/Wiener_filterhttp://en.wikipedia.org/wiki/Adaptive_filterhttp://en.wikipedia.org/wiki/Kalman_filterhttp://en.wikipedia.org/wiki/Kalman_filterhttp://en.wikipedia.org/wiki/Statistical_signal_processinghttp://en.wikipedia.org/wiki/Audio_signal_processinghttp://en.wikipedia.org/wiki/Speech_signal_processinghttp://en.wikipedia.org/wiki/Image_processinghttp://en.wikipedia.org/wiki/Video_processinghttp://en.wikipedia.org/wiki/Array_processinghttp://en.wikipedia.org/wiki/Digital_signal_processinghttp://en.wikipedia.org/wiki/Computerhttp://en.wikipedia.org/wiki/Application-specific_integrated_circuithttp://en.wikipedia.org/wiki/Field-programmable_gate_arrayhttp://en.wikipedia.org/wiki/Field-programmable_gate_arrayhttp://en.wikipedia.org/wiki/Digital_signal_processorhttp://en.wikipedia.org/wiki/Fixed-point_arithmetichttp://en.wikipedia.org/wiki/Floating-pointhttp://en.wikipedia.org/wiki/Circular_bufferhttp://en.wikipedia.org/wiki/Look-up_tablehttp://en.wikipedia.org/wiki/Fast_Fourier_transformhttp://en.wikipedia.org/wiki/Finite_impulse_responsehttp://en.wikipedia.org/wiki/Infinite_impulse_responsehttp://en.wikipedia.org/wiki/Wiener_filterhttp://en.wikipedia.org/wiki/Adaptive_filterhttp://en.wikipedia.org/wiki/Kalman_filterhttp://en.wikipedia.org/wiki/Kalman_filterhttp://en.wikipedia.org/wiki/Statistical_signal_processinghttp://en.wikipedia.org/wiki/Audio_signal_processinghttp://en.wikipedia.org/wiki/Speech_signal_processinghttp://en.wikipedia.org/wiki/Image_processinghttp://en.wikipedia.org/wiki/Video_processinghttp://en.wikipedia.org/wiki/Array_processing
  • 8/7/2019 Notes of Add On Content

    8/68

    Geethanjali College Of Engineering and TechnologyDepartment Of CSE

    SUB: Software Engineering

    Topic:1)Quality and Quality Assurance

    In the context ofsoftware engineering,software quality measures how wellsoftware is designed (quality of design), and how well the software conforms tothat design (quality of conformance),[1] although there are several different

    definitions. It is often described as the 'fitness for purpose' of a piece of software.

    Whereas quality of conformance is concerned with implementation (see SoftwareQuality Assurance), quality of design measures how valid the design andrequirements are in creating a worthwhile product.[2]

    Source code quality

    A computer has no concept of "well-written" source code. However, from a humanpoint of view source code can be written in a way that has an effect on the effortneeded to comprehend its behavior. Many source code programming style guides,which often stress readability and usually language-specific conventions are aimedat reducing the cost of source code maintenance. Some of the issues that affectcode quality include:

    Readability Ease ofmaintenance, testing, debugging, fixing, modification and portability Low complexity Low resource consumption: memory, CPU Number of compilation orlint warnings Robust input validation and error handling, established by software fault

    injection

    Methods to improve the quality:

    Refactoring Code Inspection orsoftware review

    Documenting code

    Page 8

    Geethanjali College Of Engineering and Technology

    http://en.wikipedia.org/wiki/Software_engineeringhttp://en.wikipedia.org/wiki/Softwarehttp://en.wikipedia.org/wiki/Software_quality#cite_note-Press746-0http://en.wikipedia.org/wiki/Software_Quality_Assurancehttp://en.wikipedia.org/wiki/Software_Quality_Assurancehttp://en.wikipedia.org/wiki/Requirementhttp://en.wikipedia.org/wiki/Product_(business)http://en.wikipedia.org/wiki/Software_quality#cite_note-1http://en.wikipedia.org/wiki/Source_codehttp://en.wikipedia.org/wiki/Programming_stylehttp://en.wikipedia.org/wiki/Readabilityhttp://en.wikipedia.org/wiki/Software_maintenancehttp://en.wikipedia.org/wiki/Software_testinghttp://en.wikipedia.org/wiki/Debugginghttp://en.wikipedia.org/wiki/Complexityhttp://en.wikipedia.org/wiki/Computer_storagehttp://en.wikipedia.org/wiki/Central_processing_unithttp://en.wikipedia.org/wiki/Lint_programming_toolhttp://en.wikipedia.org/wiki/Fault_injectionhttp://en.wikipedia.org/wiki/Fault_injectionhttp://en.wikipedia.org/wiki/Refactoringhttp://en.wikipedia.org/wiki/Software_reviewhttp://en.wikipedia.org/wiki/Software_engineeringhttp://en.wikipedia.org/wiki/Softwarehttp://en.wikipedia.org/wiki/Software_quality#cite_note-Press746-0http://en.wikipedia.org/wiki/Software_Quality_Assurancehttp://en.wikipedia.org/wiki/Software_Quality_Assurancehttp://en.wikipedia.org/wiki/Requirementhttp://en.wikipedia.org/wiki/Product_(business)http://en.wikipedia.org/wiki/Software_quality#cite_note-1http://en.wikipedia.org/wiki/Source_codehttp://en.wikipedia.org/wiki/Programming_stylehttp://en.wikipedia.org/wiki/Readabilityhttp://en.wikipedia.org/wiki/Software_maintenancehttp://en.wikipedia.org/wiki/Software_testinghttp://en.wikipedia.org/wiki/Debugginghttp://en.wikipedia.org/wiki/Complexityhttp://en.wikipedia.org/wiki/Computer_storagehttp://en.wikipedia.org/wiki/Central_processing_unithttp://en.wikipedia.org/wiki/Lint_programming_toolhttp://en.wikipedia.org/wiki/Fault_injectionhttp://en.wikipedia.org/wiki/Fault_injectionhttp://en.wikipedia.org/wiki/Refactoringhttp://en.wikipedia.org/wiki/Software_review
  • 8/7/2019 Notes of Add On Content

    9/68

    Geethanjali College Of Engineering and TechnologyDepartment Of CSE

    2)Software reliability

    Software reliability is an important facet of software quality. It is defined as"the probability of failure-free operation of a computer program in aspecified environment for a specified time".[6]

    One of reliability's distinguishing characteristics is that it is objective,measurable, and can be estimated, whereas much of software quality issubjective criteria.[7] This distinction is especially important in the disciplineofSoftware Quality Assurance. These measured criteria are typically calledsoftware metrics.

    History

    With software embedded into many devices today, software failure has causedmore than inconvenience. Software errors have even caused human fatalities. Thecauses have ranged from poorly designed user interfaces to direct programming

    errors. An example of a programming error that lead to multiple deaths isdiscussed in Dr. Leveson's paper[1] (PDF). This has resulted in requirements fordevelopment of some types software. In the United States, both the Food andDrug Administration (FDA) and Federal Aviation Administration (FAA) haverequirements for software development.

    The goal of reliability

    The need for a means to objectively determine software reliability comesfrom the desire to apply the techniques of contemporary engineering fieldsto the development of software. That desire is a result of the common

    Page 9

    Geethanjali College Of Engineering and Technology

    http://en.wikipedia.org/wiki/Software_quality#cite_note-5http://en.wikipedia.org/wiki/Software_quality#cite_note-6http://en.wikipedia.org/wiki/Software_Quality_Assurancehttp://en.wikipedia.org/wiki/Software_metrichttp://en.wikipedia.org/wiki/Embedded_systemhttp://en.wikipedia.org/wiki/Programming_errorhttp://en.wikipedia.org/wiki/Programming_errorhttp://sunnyday.mit.edu/papers/therac.pdfhttp://en.wikipedia.org/wiki/Food_and_Drug_Administrationhttp://en.wikipedia.org/wiki/Food_and_Drug_Administrationhttp://en.wikipedia.org/wiki/Federal_Aviation_Administrationhttp://en.wikipedia.org/wiki/Software_quality#cite_note-5http://en.wikipedia.org/wiki/Software_quality#cite_note-6http://en.wikipedia.org/wiki/Software_Quality_Assurancehttp://en.wikipedia.org/wiki/Software_metrichttp://en.wikipedia.org/wiki/Embedded_systemhttp://en.wikipedia.org/wiki/Programming_errorhttp://en.wikipedia.org/wiki/Programming_errorhttp://sunnyday.mit.edu/papers/therac.pdfhttp://en.wikipedia.org/wiki/Food_and_Drug_Administrationhttp://en.wikipedia.org/wiki/Food_and_Drug_Administrationhttp://en.wikipedia.org/wiki/Federal_Aviation_Administration
  • 8/7/2019 Notes of Add On Content

    10/68

    Gee a ja Co ege O g ee g a d ec o ogyDepartment Of CSE

    observation, by both lay-persons and specialists, that computer softwaredoes not work the way it ought to. In other words, software is seen to exhibitundesirable behaviour, up to and including outright failure, withconsequences for the data which is processed, the machinery on which the

    software runs, and by extension the people and materials which thosemachines might negatively affect. The more critical the application of thesoftware to economic and production processes, or to life-sustainingsystems, the more important is the need to assess the software's reliability.

    Regardless of the criticality of any single software application, it is alsomore and more frequently observed that software has penetrated deeplyinto most every aspect of modern life through the technology we use. It isonly expected that this infiltration will continue, along with an accompanyingdependency on the software by the systems which maintain our society. Assoftware becomes more and more crucial to the operation of the systemson which we depend, the argument goes, it only follows that the software

    should offer a concomitant level of dependability. In other words, thesoftware should behave in the way it is intended, or even better, in the wayit should.

    Page 10

    Geethanjali College Of Engineering and Technology

    http://en.wikipedia.org/w/index.php?title=Life-sustaining_system&action=edit&redlink=1http://en.wikipedia.org/w/index.php?title=Life-sustaining_system&action=edit&redlink=1http://en.wikipedia.org/w/index.php?title=Life-sustaining_system&action=edit&redlink=1http://en.wikipedia.org/w/index.php?title=Life-sustaining_system&action=edit&redlink=1
  • 8/7/2019 Notes of Add On Content

    11/68

    j g g g gyDepartment Of CSE

    SUB: Computer Organization

    Topic: 1) RAID Levels

    RAID 0:

    Diagram of a RAID 0 setup.

    A RAID 0 (also known as a stripe set orstriped volume) splits data evenlyacross two or more disks (striped) with no parity information for redundancy. RAID

    0 was not one of the original RAID levels and provides no data redundancy. RAID0 is normally used to increase performance, although it can also be used as a wayto create a small number of large virtual disks out of a large number of smallphysical ones.

    A RAID 0 can be created with disks of differing sizes, but the storage space addedto the array by each disk is limited to the size of the smallest disk. For example, if

    a 120 GB disk is striped together with a 100 GB disk, the size of the array will be200 GB.

    Page 11

    Geethanjali College Of Engineering and Technology

    http://en.wikipedia.org/wiki/Data_stripinghttp://en.wikipedia.org/wiki/Parity_bithttp://en.wikipedia.org/wiki/Data_redundancyhttp://en.wikipedia.org/wiki/File:RAID_0.svghttp://en.wikipedia.org/wiki/File:RAID_0.svghttp://en.wikipedia.org/wiki/Data_stripinghttp://en.wikipedia.org/wiki/Parity_bithttp://en.wikipedia.org/wiki/Data_redundancy
  • 8/7/2019 Notes of Add On Content

    12/68

    Department Of CSE[Although RAID 0 was not specified in the original RAID paper, an idealized

    implementation of RAID 0 would split I/O operations into equal-sizedblocks and spread them evenly across two disks. RAID 0implementations with more than two disks are also possible, though

    the group reliability decreases with member size.

    Reliability of a given RAID 0 set is equal to the average reliability of each diskdivided by the number of disks in the set:

    That is, reliability (as measured by mean time to failure (MTTF) ormean timebetween failures (MTBF) is roughly inversely proportional to the number ofmembers so a set of two disks is roughly half as reliable as a single disk. If therewere a probability of 5% that the disk would fail within three years, in a two diskarray, that probability would be upped to

    .

    The reason for this is that the file system is distributed across all disks. When adrive fails the file system cannot cope with such a large loss of data andcoherency since the data is "striped" across all drives (the data cannot berecovered without the missing disk). Data can be recovered using special tools,

    however, this data will be incomplete and most likely corrupt, and data recovery istypically very costly and not guaranteed.

    RAID 0 performance

    While the block size can technically be as small as a byte, it is almost always amultiple of the hard disk sector size of 512 bytes. This lets each drive seek

    independently when randomly reading or writing data on the disk. How much thedrives act independently depends on the access pattern from the file system level.For reads and writes that are larger than the stripe size, such as copying files orvideo playback, the disks will be seeking to the same position on each disk, so theseek time of the array will be the same as that of a single drive. For reads andwrites that are smaller than the stripe size, such as database access, the driveswill be able to seek independently. If the sectors accessed are spread evenly

    between the two drives, the apparent seek time of the array will be half that of asingle drive (assuming the disks in the array have identical access timecharacteristics). The transfer speed of the array will be the transfer speed of all the

    Page 12

    Geethanjali College Of Engineering and Technology

    http://en.wikipedia.org/wiki/Input/outputhttp://en.wikipedia.org/wiki/Failure_ratehttp://en.wikipedia.org/wiki/Failure_ratehttp://en.wikipedia.org/wiki/Failure_ratehttp://en.wikipedia.org/wiki/File_systemhttp://en.wikipedia.org/wiki/Input/outputhttp://en.wikipedia.org/wiki/Failure_ratehttp://en.wikipedia.org/wiki/Failure_ratehttp://en.wikipedia.org/wiki/Failure_ratehttp://en.wikipedia.org/wiki/File_system
  • 8/7/2019 Notes of Add On Content

    13/68

    Department Of CSEdisks added together, limited only by the speed of the RAID controller. Note thatthese performance scenarios are in the best case with optimal access patterns.

    RAID 0 is useful for setups such as large read-onlyNFSserverwhere mounting

    many disks is time-consuming or impossible and redundancy is irrelevant.

    RAID 0 is also used in some gaming systems where performance is desired anddata integrity is not very important. However, real-world tests with games haveshown that RAID-0 performance gains are minimal, although some desktopapplications will benefit.[1][2] Another article examined these claims and concludes:"Striping does not always increase performance (in certain situations it will actually

    be slower than a non-RAID setup), but in most situations it will yield a significantimprovement in performance." [3]

    RAID 1:

    Diagram of a RAID 1 setup

    A RAID 1 creates an exact copy (ormirror) of a set of data on two or more disks.

    This is useful when performance read or reliability is more important than datastorage capacity. Such an array can only be as big as the smallest member disk. Aclassic RAID 1 mirrored pair contains two disks (see diagram), which increasesreliability geometrically over a single disk. Since each member contains acomplete copy of the data, and can be addressed independently, ordinary wear-and-tear reliability is raised by the power of the number of self-contained copies.

    As a trivial example, consider a RAID 1 with two identical models of a disk drivewith a 5% probability that the disk would fail within three years. Provided that the

    Page 13

    Geethanjali College Of Engineering and TechnologyD t t Of CSE

    http://en.wikipedia.org/wiki/Read-onlyhttp://en.wikipedia.org/wiki/Network_File_System_(protocol)http://en.wikipedia.org/wiki/Server_(computing)http://en.wikipedia.org/wiki/Mount_(computing)http://en.wikipedia.org/wiki/RAID_levels#cite_note-0http://en.wikipedia.org/wiki/RAID_levels#cite_note-1http://en.wikipedia.org/wiki/RAID_levels#cite_note-2http://en.wikipedia.org/wiki/Geometric_growthhttp://en.wikipedia.org/wiki/File:RAID_1.svghttp://en.wikipedia.org/wiki/File:RAID_1.svghttp://en.wikipedia.org/wiki/Read-onlyhttp://en.wikipedia.org/wiki/Network_File_System_(protocol)http://en.wikipedia.org/wiki/Server_(computing)http://en.wikipedia.org/wiki/Mount_(computing)http://en.wikipedia.org/wiki/RAID_levels#cite_note-0http://en.wikipedia.org/wiki/RAID_levels#cite_note-1http://en.wikipedia.org/wiki/RAID_levels#cite_note-2http://en.wikipedia.org/wiki/Geometric_growth
  • 8/7/2019 Notes of Add On Content

    14/68

    Department Of CSEfailures are statistically independent, then the probability of both disks failingduring the three year lifetime is

    .bakwas

    Thus, the probability of losing all data is 0.25% over a three year period if nothingis done to the array. If the first disk fails and is never replaced, then there is a 5%chance the data will be lost. If only one of the disks fails, no data would be lost. Aslong as a failed disk is replaced before the second disk fails, the data is safe.

    Page 14

    Geethanjali College Of Engineering and TechnologyD t t Of CSE

    http://en.wikipedia.org/wiki/Statistical_independencehttp://en.wikipedia.org/wiki/Statistical_independence
  • 8/7/2019 Notes of Add On Content

    15/68

    Department Of CSE

    SUB: Database Management Systems

    Topic: Object oriented and object relational data bases

    These databases store detailed data about the operations of an organization.They are typically organized by subject matter, process relatively high volumes ofupdates using transactions. Essentially every major organization on earth usessuch databases. Examples include customer databases that record contact, credit,and demographic information about a business' customers, personnel databases

    that hold information such as salary, benefits, skills data about employees,manufacturing databases that record details about product components, partsinventory, and financial databases that keep track of the organization's money,accounting and financial dealings.

    Data warehouse

    Data warehouses archive modern data from operational databases and often fromexternal sources such as market research firms. Often operational data undergoestransformation on its way into the warehouse, getting summarized, anonymized,reclassified, etc. The warehouse becomes the central source of data for use bymanagers and other end-users who may not have access to operational data. Forexample, sales data might be aggregated to weekly totals and converted from

    internal product codes to use UPC codes so that it can be compared withACNielsen data.Some basic and essential components of data warehousinginclude retrieving and analyzing data, transforming,loading and managing data soas to make it available for further use.

    Analytical database

    Analysts may do their work directly against a data warehouse, or create aseparate analytic database forOnline Analytical Processing. For example, acompany might extract sales records for analyzing the effectiveness of advertisingand other sales promotions at an aggregate level.

    Distributed database

    These are databases of local work-groups and departments at regional offices,branch offices, manufacturing plants and other work sites. These databases can

    Page 15

    Geethanjali College Of Engineering and TechnologyDepartment Of CSE

    http://en.wikipedia.org/wiki/Transaction_(database)http://en.wikipedia.org/wiki/CRMhttp://en.wikipedia.org/wiki/Enterprise_resource_planninghttp://en.wikipedia.org/wiki/Data_warehousehttp://en.wikipedia.org/wiki/UPChttp://en.wikipedia.org/wiki/ACNielsenhttp://en.wikipedia.org/wiki/Online_Analytical_Processinghttp://en.wikipedia.org/wiki/Transaction_(database)http://en.wikipedia.org/wiki/CRMhttp://en.wikipedia.org/wiki/Enterprise_resource_planninghttp://en.wikipedia.org/wiki/Data_warehousehttp://en.wikipedia.org/wiki/UPChttp://en.wikipedia.org/wiki/ACNielsenhttp://en.wikipedia.org/wiki/Online_Analytical_Processing
  • 8/7/2019 Notes of Add On Content

    16/68

    Department Of CSEinclude segments of both common operational and common user databases, aswell as data generated and used only at a users own site.

    Page 16

    Geethanjali College Of Engineering and TechnologyDepartment Of CSE

  • 8/7/2019 Notes of Add On Content

    17/68

    Department Of CSE

    THIRD YEAR

    SUB:Formal Languages and Automata Theory

    Topic: Basic tools of compiler

    A diagram of the operation of a typical multi-language, multi-target compiler.

    A compileris a computer program (or set of programs) that transforms sourcecode written in a programming language (the source language) into anothercomputer language (the target language, often having a binary form known as

    Page 17

    Geethanjali College Of Engineering and TechnologyDepartment Of CSE

    http://en.wikipedia.org/wiki/Computer_programhttp://en.wikipedia.org/wiki/Source_codehttp://en.wikipedia.org/wiki/Source_codehttp://en.wikipedia.org/wiki/Programming_languagehttp://en.wikipedia.org/wiki/File:Compiler.svghttp://en.wikipedia.org/wiki/File:Compiler.svghttp://en.wikipedia.org/wiki/Computer_programhttp://en.wikipedia.org/wiki/Source_codehttp://en.wikipedia.org/wiki/Source_codehttp://en.wikipedia.org/wiki/Programming_language
  • 8/7/2019 Notes of Add On Content

    18/68

    Department Of CSEobject code). The most common reason for wanting to transform source code is tocreate an executable program.

    The name "compiler" is primarily used for programs that translate source code

    from a high-level programming language to a lower level language (e.g., assemblylanguage ormachine code). If the compiled program can only run on a computerwhose CPU oroperating system is different from the one on which the compilerruns the compiler is known as a cross-compiler. A program that translates from alow level language to a higher level one is a decompiler. A program that translatesbetween high-level languages is usually called a language translator, source tosource translator, orlanguage converter. A language rewriteris usually a program

    that translates the form of expressions without a change of language.

    A compiler is likely to perform many or all of the following operations: lexicalanalysis, preprocessing, parsing, semantic analysis, code generation, and codeoptimization.

    Program faults caused by incorrect compiler behavior can be very difficult to track

    down and work around and compiler implementors invest a lot of time ensuring thecorrectness of their software.

    The term compiler-compileris sometimes used to refer to a parser generator, atool often used to help create the lexerand parser.

    Page 18

    Geethanjali College Of Engineering and TechnologyDepartment Of CSE

    http://en.wikipedia.org/wiki/Object_codehttp://en.wikipedia.org/wiki/Executablehttp://en.wikipedia.org/wiki/High-level_programming_languagehttp://en.wikipedia.org/wiki/Assembly_languagehttp://en.wikipedia.org/wiki/Assembly_languagehttp://en.wikipedia.org/wiki/Machine_codehttp://en.wikipedia.org/wiki/CPUhttp://en.wikipedia.org/wiki/Operating_systemhttp://en.wikipedia.org/wiki/Decompilerhttp://en.wikipedia.org/wiki/Decompilerhttp://en.wikipedia.org/wiki/Translator_(computing)http://en.wikipedia.org/wiki/Rewritinghttp://en.wikipedia.org/wiki/Lexical_analysishttp://en.wikipedia.org/wiki/Lexical_analysishttp://en.wikipedia.org/wiki/Preprocessinghttp://en.wikipedia.org/wiki/Parsinghttp://en.wikipedia.org/wiki/Code_generation_(compiler)http://en.wikipedia.org/wiki/Code_optimizationhttp://en.wikipedia.org/wiki/Code_optimizationhttp://en.wikipedia.org/wiki/Compiler_correctnesshttp://en.wikipedia.org/wiki/Compiler-compilerhttp://en.wikipedia.org/wiki/Parser_generatorhttp://en.wikipedia.org/wiki/Lexical_analysishttp://en.wikipedia.org/wiki/Parserhttp://en.wikipedia.org/wiki/Object_codehttp://en.wikipedia.org/wiki/Executablehttp://en.wikipedia.org/wiki/High-level_programming_languagehttp://en.wikipedia.org/wiki/Assembly_languagehttp://en.wikipedia.org/wiki/Assembly_languagehttp://en.wikipedia.org/wiki/Machine_codehttp://en.wikipedia.org/wiki/CPUhttp://en.wikipedia.org/wiki/Operating_systemhttp://en.wikipedia.org/wiki/Decompilerhttp://en.wikipedia.org/wiki/Translator_(computing)http://en.wikipedia.org/wiki/Rewritinghttp://en.wikipedia.org/wiki/Lexical_analysishttp://en.wikipedia.org/wiki/Lexical_analysishttp://en.wikipedia.org/wiki/Preprocessinghttp://en.wikipedia.org/wiki/Parsinghttp://en.wikipedia.org/wiki/Code_generation_(compiler)http://en.wikipedia.org/wiki/Code_optimizationhttp://en.wikipedia.org/wiki/Code_optimizationhttp://en.wikipedia.org/wiki/Compiler_correctnesshttp://en.wikipedia.org/wiki/Compiler-compilerhttp://en.wikipedia.org/wiki/Parser_generatorhttp://en.wikipedia.org/wiki/Lexical_analysishttp://en.wikipedia.org/wiki/Parser
  • 8/7/2019 Notes of Add On Content

    19/68

    Department Of CSE

    SUB: Design and Analysis of Algorithms

    Topic: Optimal storage on tapes

    Types of storage

    Solid-state memory devices

    Digital computers, in particular, make use of two forms ofmemory known as RAMorROM and although the most common form today is RAM, designed to retaindata while the computer is powered on, this was not always the case. Nor is activememory the only form used;passive memory devices are now in common use indigital cameras.

    Magnetic, or ferrite core, data retention is dependent on the magneticproperties of iron and its compounds.

    PROM, orprogrammable read-only memory, stores data in a fixed formduring the manufacturing process, with data retention dependent on the lifeexpectancy of the device itself.

    EPROM, orerasable programmable read-only memory, is similar to PROMbut can be cleared by exposure to ultraviolet light.

    EEPROM, orelectrically erasable programmable read-only memory, is theformat used by flash memory devices and can be erased and rewrittenelectronically. These devices tend to be extraordinarily resilient; in a 2005destructive test, a USB key survived boiling in a custard pie, being run-overby a truck and fired from a mortar at a brick wall[3]. Although physicallydamaged after the final test, some deft soldering restored the device anddata was successfully retrieved.

    Magnetic media

    Magnetic tapes consist of narrow bands of a magnetic medium bonded in paper orplastic. The magnetic medium passes across a semi-fixed head which reads or

    writes data. Typically magnetic media has maximum lifetime of about 50 years[4]

    although this assumes optimal storage conditions; life expectancy can decrease

    Page 19

    Geethanjali College Of Engineering and TechnologyDepartment Of CSE

    http://en.wikipedia.org/wiki/Computer_memoryhttp://en.wikipedia.org/wiki/RAMhttp://en.wikipedia.org/wiki/Read-only_memoryhttp://en.wikipedia.org/wiki/PROMhttp://en.wikipedia.org/wiki/EPROMhttp://en.wikipedia.org/wiki/Ultraviolethttp://en.wikipedia.org/wiki/EEPROMhttp://en.wikipedia.org/wiki/Flash_memoryhttp://en.wikipedia.org/wiki/Digital_permanence#cite_note-USB-2http://en.wikipedia.org/wiki/Digital_permanence#cite_note-USB-2http://en.wikipedia.org/wiki/Magnetic_tapehttp://en.wikipedia.org/wiki/Digital_permanence#cite_note-Adelstein-3http://en.wikipedia.org/wiki/Computer_memoryhttp://en.wikipedia.org/wiki/RAMhttp://en.wikipedia.org/wiki/Read-only_memoryhttp://en.wikipedia.org/wiki/PROMhttp://en.wikipedia.org/wiki/EPROMhttp://en.wikipedia.org/wiki/Ultraviolethttp://en.wikipedia.org/wiki/EEPROMhttp://en.wikipedia.org/wiki/Flash_memoryhttp://en.wikipedia.org/wiki/Digital_permanence#cite_note-USB-2http://en.wikipedia.org/wiki/Magnetic_tapehttp://en.wikipedia.org/wiki/Digital_permanence#cite_note-Adelstein-3
  • 8/7/2019 Notes of Add On Content

    20/68

    prapidly depending on storage conditions and the resilience and reliability ofhardware components.

    magnetic tape reels

    magnetic stripe cards magnetic cards cassette tapes video cassette tapes

    Magnetic disks and drums include a rotating magnetic medium combined with amovable read/write head.

    floppy disks zip drives hard disks and drums

    Non-magnetic media

    punched paper-tape punched cards optical media (rotating media combined with a moveable read/write head

    comprising a laser), such as:o pressed CD-ROMso WORMs, CD-Ro DVDso multi-layer DVDs

    Printing technology

    Although not a digital storage medium in itself, printing hard-copies of documentsand images remains a popular means of representing digital data and possibly

    acquires the qualities associated with original documents especially their potentialfor endurance. More recent advances in printer technology have raised the qualityof photographic images in particular. Unfortunately the permanence of printeddocuments cannot be easily discerned from the documents themselves.

    wet-ribbon inked printers heat sensitive papers, such as FAX rolls

    Page 20

    Geethanjali College Of Engineering and TechnologyDepartment Of CSE

    http://en.wikipedia.org/wiki/Compact_audio_cassettehttp://en.wikipedia.org/wiki/Video_tapehttp://en.wikipedia.org/wiki/Floppy_diskhttp://en.wikipedia.org/wiki/Zip_drivehttp://en.wikipedia.org/wiki/Hard_diskhttp://en.wikipedia.org/wiki/Punched_tapehttp://en.wikipedia.org/wiki/Punched_cardshttp://en.wikipedia.org/wiki/CD-ROMhttp://en.wikipedia.org/wiki/DVDhttp://en.wikipedia.org/wiki/Compact_audio_cassettehttp://en.wikipedia.org/wiki/Video_tapehttp://en.wikipedia.org/wiki/Floppy_diskhttp://en.wikipedia.org/wiki/Zip_drivehttp://en.wikipedia.org/wiki/Hard_diskhttp://en.wikipedia.org/wiki/Punched_tapehttp://en.wikipedia.org/wiki/Punched_cardshttp://en.wikipedia.org/wiki/CD-ROMhttp://en.wikipedia.org/wiki/DVD
  • 8/7/2019 Notes of Add On Content

    21/68

    p

    SUB: Software Testing Methodologies

    Topic: Quality Assurance certifications

    Quality assurance, orQA for short, refers to a program for the systematicmonitoring and evaluation of the various aspects of a project, service, or facility to

    ensure that standards of quality are being met.

    It is important to realize also that quality is determined by the program sponsor.QA cannot absolutely guarantee the production ofqualityproducts, unfortunately,but makes this more likely.

    Two key principles characterise QA: "fit for purpose" (the product should be

    suitable for the intended purpose) and "right first time" (mistakes should beeliminated). QA includes regulation of the quality of raw materials, assemblies,products and components; services related to production; and management,production and inspection processes.

    It is important to realize also that qualityis determined by the intended users,clients or customers, not by society in general: it is not the same as 'expensive' or'high quality'. Even goods with low prices can be considered quality items if theymeet a market need. QA is more than just testing the quality of aspects of aproduct, service or facility, it analyzes the quality to make sure it conforms tospecific requirements and comply with established plans.

    Early efforts to control the quality of production

    Early civil engineering projects needed to be built from specifications, for examplethe four sides of the base of the Great Pyramid of Giza were required to beperpendicular to within 3.5 arcseconds.

    During the Middle Ages, guilds adopted responsibility for quality control of theirmembers, setting and maintaining certain standards for guild membership.

    Royal governments purchasing material were interested in quality control ascustomers. For this reason, King John of England appointed William Wrotham to

    Page 21

    Geethanjali College Of Engineering and TechnologyDepartment Of CSE

    http://en.wikipedia.org/wiki/Quality_(business)http://en.wikipedia.org/wiki/Civil_engineeringhttp://en.wikipedia.org/wiki/Specificationhttp://en.wikipedia.org/wiki/Great_Pyramid_of_Gizahttp://en.wikipedia.org/wiki/Arcsecondhttp://en.wikipedia.org/wiki/Middle_Ageshttp://en.wikipedia.org/wiki/Guildhttp://en.wikipedia.org/wiki/Materialhttp://en.wikipedia.org/wiki/John_of_Englandhttp://en.wikipedia.org/wiki/Quality_(business)http://en.wikipedia.org/wiki/Civil_engineeringhttp://en.wikipedia.org/wiki/Specificationhttp://en.wikipedia.org/wiki/Great_Pyramid_of_Gizahttp://en.wikipedia.org/wiki/Arcsecondhttp://en.wikipedia.org/wiki/Middle_Ageshttp://en.wikipedia.org/wiki/Guildhttp://en.wikipedia.org/wiki/Materialhttp://en.wikipedia.org/wiki/John_of_England
  • 8/7/2019 Notes of Add On Content

    22/68

    report about the construction and repair of ships. Centuries later, Samuel Pepys,Secretary to the British Admiralty, appointed multiple such overseers.

    Prior to the extensive division of laborand mechanization resulting from the

    Industrial Revolution, it was possible for workers to control the quality of their ownproducts. Working conditions then were arguably more conducive to professionalpride.

    Page 22

    Geethanjali College Of Engineering and TechnologyDepartment Of CSE

    http://en.wikipedia.org/wiki/Samuel_Pepyshttp://en.wikipedia.org/wiki/Admiraltyhttp://en.wikipedia.org/wiki/Division_of_laborhttp://en.wikipedia.org/wiki/Mechanizationhttp://en.wikipedia.org/wiki/Industrial_Revolutionhttp://en.wikipedia.org/wiki/Samuel_Pepyshttp://en.wikipedia.org/wiki/Admiraltyhttp://en.wikipedia.org/wiki/Division_of_laborhttp://en.wikipedia.org/wiki/Mechanizationhttp://en.wikipedia.org/wiki/Industrial_Revolution
  • 8/7/2019 Notes of Add On Content

    23/68

    SUB: Computer Graphics

    Topic: Color Models

    A color model is an abstract mathematical model describing the way colors canbe represented as tuples of numbers, typically as three or four values or colorcomponents. When this model is associated with a precise description of how thecomponents are to be interpreted (viewing conditions, etc.), the resulting set ofcolors is called color space. This section describes ways in which human color

    vision can be modeled

    [edit] Tristimulus color space

    3D representation of the human color space.

    One can picture this space as a region in three-dimensional Euclidean space ifone identifies thex, y, and zaxes with the stimuli for the long-wavelength (L),medium-wavelength (M), and short-wavelength (S) receptors. The origin, (S,M,L)= (0,0,0), corresponds to black. White has no definite position in this diagram;rather it is defined according to the color temperature or white balance as desiredor as available from ambient lighting. The human color space is a horse-shoe-

    shaped cone such as shown here (see also CIE chromaticity diagram below),extending from the origin to, in principle, infinity. In practice, the human colorreceptors will be saturated or even be damaged at extremely-high light intensities,

    Page 23

    Geethanjali College Of Engineering and TechnologyDepartment Of CSE

    http://en.wikipedia.org/wiki/Colorhttp://en.wikipedia.org/wiki/Tuplehttp://en.wikipedia.org/wiki/Color_spacehttp://en.wikipedia.org/wiki/Color_visionhttp://en.wikipedia.org/wiki/Color_visionhttp://en.wikipedia.org/w/index.php?title=Color_model&action=edit&section=1http://en.wikipedia.org/wiki/Euclidean_spacehttp://en.wikipedia.org/wiki/Color_temperaturehttp://en.wikipedia.org/wiki/Color_models#CIE_XYZ_color_spacehttp://en.wikipedia.org/wiki/File:Gamut_full.pnghttp://en.wikipedia.org/wiki/File:Gamut_full.pnghttp://en.wikipedia.org/wiki/Colorhttp://en.wikipedia.org/wiki/Tuplehttp://en.wikipedia.org/wiki/Color_spacehttp://en.wikipedia.org/wiki/Color_visionhttp://en.wikipedia.org/wiki/Color_visionhttp://en.wikipedia.org/w/index.php?title=Color_model&action=edit&section=1http://en.wikipedia.org/wiki/Euclidean_spacehttp://en.wikipedia.org/wiki/Color_temperaturehttp://en.wikipedia.org/wiki/Color_models#CIE_XYZ_color_spacehttp://en.wikipedia.org/wiki/International_Commission_on_Illuminationhttp://en.wikipedia.org/wiki/International_Commission_on_Illumination
  • 8/7/2019 Notes of Add On Content

    24/68

    but such behavior is not part of the CIE color space and neither is the changingcolor perception at low light levels (see: Kruithof curve).

    The most saturated colors are located at the outer rim of the region, with brighter

    colors farther removed from the origin. As far as the responses of the receptors inthe eye are concerned, there is no such thing as "brown" or "gray" light. The lattercolor names refer to orange and white light respectively, with an intensity that islower than the light from surrounding areas. One can observe this by watching thescreen of an overhead projector during a meeting: one sees black lettering on awhite background, even though the "black" has in fact not become darker than thewhite screen on which it is projected before the projector was turned on. The

    "black" areas have not actually become darker but appear "black" relative to thehigher intensity "white" projected onto the screen around it. See also colorconstancy.

    The human tristimulus space has the property that additive mixing of colorscorresponds to the adding of vectors in this space. This makes it easy to, forexample, describe the possible colors (gamut) that can be constructed from the

    red, green, and blue primaries in a computer display.

    [edit] CIE XYZ color space

    Main article:CIE 1931 color space

    CIE 1931 Standard Colorimetric Observer functions between 380 nm and 780 nm(at 5 nm intervals).

    One of the first mathematically defined color spaces is the CIE XYZ color space

    (also known as CIE 1931 color space), created by the International Commissionon Illumination in 1931. These data were measured for human observers and a 2-

    Page 24

    Geethanjali College Of Engineering and TechnologyDepartment Of CSE

    d fi ld f i I 1964 l t l d t f 10 d fi ld f i

    http://en.wikipedia.org/wiki/International_Commission_on_Illuminationhttp://en.wikipedia.org/wiki/Kruithof_curvehttp://en.wikipedia.org/wiki/Color#Color_constancyhttp://en.wikipedia.org/wiki/Color#Color_constancyhttp://en.wikipedia.org/wiki/Gamuthttp://en.wikipedia.org/w/index.php?title=Color_model&action=edit&section=2http://en.wikipedia.org/wiki/CIE_1931_color_spacehttp://www.cie.co.at/framepublications.htmlhttp://en.wikipedia.org/wiki/International_Commission_on_Illuminationhttp://en.wikipedia.org/wiki/International_Commission_on_Illuminationhttp://en.wikipedia.org/wiki/File:CIE_1931_XYZ_Color_Matching_Functions.svghttp://en.wikipedia.org/wiki/File:CIE_1931_XYZ_Color_Matching_Functions.svghttp://en.wikipedia.org/wiki/International_Commission_on_Illuminationhttp://en.wikipedia.org/wiki/Kruithof_curvehttp://en.wikipedia.org/wiki/Color#Color_constancyhttp://en.wikipedia.org/wiki/Color#Color_constancyhttp://en.wikipedia.org/wiki/Gamuthttp://en.wikipedia.org/w/index.php?title=Color_model&action=edit&section=2http://en.wikipedia.org/wiki/CIE_1931_color_spacehttp://www.cie.co.at/framepublications.htmlhttp://en.wikipedia.org/wiki/International_Commission_on_Illuminationhttp://en.wikipedia.org/wiki/International_Commission_on_Illumination
  • 8/7/2019 Notes of Add On Content

    25/68

    degree field of view. In 1964, supplemental data for a 10-degree field of view werepublished.

    Note that the tabulated sensitivity curves have a certain amount of arbitrariness in

    them. The shapes of the individual X, Y and Z sensitivity curves can be measuredwith a reasonable accuracy. However, the overall luminosity curve (which in fact isa weighted sum of these three curves) is subjective, since it involves asking a testperson whether two light sources have the same brightness, even if they are incompletely different colors. Along the same lines, the relative magnitudes of the X,Y, and Z curves are arbitrary. One could as well define a valid color space with anX sensitivity curve that has twice the amplitude. This new color space would have

    a different shape. The sensitivity curves in the CIE 1931 and 1964 xyz color spaceare scaled to have equal areas under the curves.

    The figure on the right shows the related chromaticity diagram with wavelengths innanometers.

    In this diagram,xand yare related to theX, Y, and Ztristimulus values underHuman tristimulus color space above according to:

    x=X/(X+ Y+ Z),y= Y/(X+ Y+ Z).

    Mathematically,xand yare projective coordinates and the colors of the

    chromaticity diagram occupy a region of the real projective plane. Because theCIE sensitivity curves have equal areas under the curves, light with a flat energyspectrum corresponds to the point (x,y) = (0.333,0.333).

    The values forX, Y, and Zare obtained by integrating the product of the spectrumof a light beam and the published color-matching functions. Blue and redwavelengths do not contribute strongly to the luminosity, which is illustrated by thefollowing example:

    redgreen

    blue

    red+green

    green+blue

    red+blue

    red+green+blue

    zerolight

    For someone with normal color vision, green is brighter than red, which is brighter

    than blue. Even though the pure blue appears to be very dark and hardlydiscernible from black when observed from a distance, blue has a strong coloringpower when mixed with green or red.

    Page 25

    Geethanjali College Of Engineering and TechnologyDepartment Of CSE

    With some forms of "red green color blindness" the green is very slightly brighter

    http://en.wikipedia.org/wiki/Colorhttp://en.wikipedia.org/wiki/Projective_planehttp://en.wikipedia.org/wiki/Colorhttp://en.wikipedia.org/wiki/Projective_planehttp://en.wikipedia.org/wiki/Color_blindnesshttp://en.wikipedia.org/wiki/Color_blindness
  • 8/7/2019 Notes of Add On Content

    26/68

    With some forms of "red-green color blindness" the green is very slightly brighterthan the blue, and the red is so dark it can barely be made out. Red traffic lights inbright daylight appear broken (no light). The green traffic light appears dirty whiteand hard to distinguish from night street lights.

    The CIE-xyz color space is a prism, as opposed to the cone-shaped tristimulusspace above. In the two-dimensionalxyrepresentation, all possible additivemixtures of two colorsA and B form a straight line. However, the additive mixtureof two colors does generally not lie on the mid-point of this line.

    [edit] RGB color model

    Main article: RGB color model

    Media that transmit light (such as television) use additive colormixing with primary

    colors ofred, green, and blue, each of which stimulates one of the three types ofthe eye's color receptors with as little stimulation as possible of the other two. Thisis called "RGB" color space. Mixtures of light of these primary colors cover a largepart of the human color space and thus produce a large part of human colorexperiences. This is why color television sets or color computer monitors needonly produce mixtures of red, green and blue light. See Additive color.

    Other primary colors could in principle be used, but with red, green and blue thelargest portion of the human color space can be captured. Unfortunately there isno exact consensus as to what loci in the chromaticity diagram the red, green, andblue colors should have, so the same RGB values can give rise to slightly differentcolors on different screens.

    [edit] HSV and HSL representations

    Main article: HSL and HSV

    Page 26

    Geethanjali College Of Engineering and TechnologyDepartment Of CSE

    http://en.wikipedia.org/wiki/Color_blindnesshttp://en.wikipedia.org/wiki/Prism_(geometry)http://en.wikipedia.org/wiki/Cone_(geometry)http://en.wikipedia.org/w/index.php?title=Color_model&action=edit&section=3http://en.wikipedia.org/wiki/RGB_color_modelhttp://en.wikipedia.org/wiki/Additive_colorhttp://en.wikipedia.org/wiki/Primary_colorhttp://en.wikipedia.org/wiki/Primary_colorhttp://en.wikipedia.org/wiki/Redhttp://en.wikipedia.org/wiki/Greenhttp://en.wikipedia.org/wiki/Bluehttp://en.wikipedia.org/wiki/RGBhttp://en.wikipedia.org/wiki/Color_televisionhttp://en.wikipedia.org/wiki/Additive_colorhttp://en.wikipedia.org/w/index.php?title=Human_color_space&action=edit&redlink=1http://en.wikipedia.org/wiki/Chromaticity_diagramhttp://en.wikipedia.org/w/index.php?title=Color_model&action=edit&section=4http://en.wikipedia.org/wiki/HSL_and_HSVhttp://en.wikipedia.org/wiki/File:RGBCube_b.svghttp://en.wikipedia.org/wiki/File:RGBCube_b.svghttp://en.wikipedia.org/wiki/Color_blindnesshttp://en.wikipedia.org/wiki/Prism_(geometry)http://en.wikipedia.org/wiki/Cone_(geometry)http://en.wikipedia.org/w/index.php?title=Color_model&action=edit&section=3http://en.wikipedia.org/wiki/RGB_color_modelhttp://en.wikipedia.org/wiki/Additive_colorhttp://en.wikipedia.org/wiki/Primary_colorhttp://en.wikipedia.org/wiki/Primary_colorhttp://en.wikipedia.org/wiki/Redhttp://en.wikipedia.org/wiki/Greenhttp://en.wikipedia.org/wiki/Bluehttp://en.wikipedia.org/wiki/RGBhttp://en.wikipedia.org/wiki/Color_televisionhttp://en.wikipedia.org/wiki/Additive_colorhttp://en.wikipedia.org/w/index.php?title=Human_color_space&action=edit&redlink=1http://en.wikipedia.org/wiki/Chromaticity_diagramhttp://en.wikipedia.org/w/index.php?title=Color_model&action=edit&section=4http://en.wikipedia.org/wiki/HSL_and_HSVhttp://en.wikipedia.org/wiki/File:Hsl-hsv_models.svg
  • 8/7/2019 Notes of Add On Content

    27/68

    Recognizing that the geometry of the RGB model is poorly aligned with the color-making attributes recognized by human vision, computer graphics researchersdeveloped two alternate representations of RGB, HSV and HSL (hue, saturation,value and hue, saturation, lightness), in the late 1970s. HSV and HSL improve onthe color cube representation of RGB by arranging colors of each hue in a radialslice, around a central axis of neutral colors which ranges from black at the bottomto white at the top. The fully saturated colors of each hue then lie in a circle, a

    color wheel.

    HSV models itself on paint mixture, with its saturation and value dimensionsresembling mixtures of a brightly colored paint with, respectively, white and black.HSL tries to resemble more perceptual color models such as NCS or Munsell. Itplaces the fully saturated colors in a circle of lightness , so that lightness 1always implies white, and lightness 0 always implies black.

    Page 27

    Geethanjali College Of Engineering and TechnologyDepartment Of CSE

    SUB: Digital Logic Design

    http://en.wikipedia.org/wiki/Color_wheelhttp://en.wikipedia.org/wiki/File:Hsl-hsv_models.svghttp://en.wikipedia.org/wiki/File:Hsl-hsv_models.svghttp://en.wikipedia.org/wiki/Color_wheel
  • 8/7/2019 Notes of Add On Content

    28/68

    SUB: Digital Logic Design

    Simple Programmable Logic Devices

    Simple Programmable LogicDevices (SPLDs)

    Developed 1970s (thus, pre-datesFPGAs)

    Prefabricated IC with large AND- OR structure

    Connections can be "programmed" to create custom circuit

    Circuit shown can implement any3-input function of up to 3 terms

    e.g., F = abc + a'c

    Fuse based "blown" fuse removes connection

    Memory based 1 creates connection

    Unblown Fuse Blown Fuse

    Page 28

    Geethanjali College Of Engineering and TechnologyDepartment Of CSE

    Finite-State Machine (FSM)

  • 8/7/2019 Notes of Add On Content

    29/68

    Finite-State Machine (FSM)

    Finite-State Machine (FSM)

    A way to describe desired behavior of sequential circuit

    Use state diagram to list states, and transitions among states

    Example: Make x change Two states: Off (x=0), and

    On (x=1)

    Transition from Off to On, or On to Off, on rising clock edge Arrow with no starting state points to initial state (when circuit first starts by

    asynchronoust reset toggle (0 to 1, or 1 to 0) every clock cycle

    Page 29

    Geethanjali College Of Engineering and TechnologyDepartment Of CSE

    Sub: MFCS

  • 8/7/2019 Notes of Add On Content

    30/68

    The Mersenne primes

    The mersenne primes are, by far, the largest primes known. An efficient

    algorithm, based on the exponent, demonstrates primality.

    Let k be the exponent. Thus n = 2k-1, and we're wondering if n is prime.Remember that k must be prime for n to be prime.

    Let e1 e2 e3 etc be the sequence where e1 = 4, and ei+1 = ei2 - 2 mod n. Thenumber n is prime iff ek-1 = 0. This is the mersenne prime test.

    Suppose k is even (and greater than 2). Since k is not prime, n is not prime; andeach ei beyond e1 = 2 mod 3, so ek-1 is not 0. Hereinafter, we can assume k isodd.

    Let z = 2(k+1)/2, and note that z is a square root of 2 mod n. Let R be the ring ofpolynomials mod n over the quadratic x2-zx-1. Let a and b be the roots of the

    quadratic. These lie in Zn iff the quadratic splits. In either case, a+b = z, and a*b= -1.

    Evaluate 2 = z2 = (a+b)2. The 2ab becomes -2, so a2+b2 = 4 = e1.

    Prove by induction that ei = a2i+b2i.

    The condition ek-1 = 0 becomes a2k-1 = - b2k-1. Multiply through by anappropriate power of a and get a2k = -1. The order of a is 2k+1.

    Get ready to apply the nst prime test. The ring R has n2-1 nonzero elements,which factors into n-1 times n+1. Let s = 2(n+1), which is certainly larger than thesquare root of n. It is also easily factored, as it is a power of 2. Set u = a, and us= 1, while us/2-1 = -2, which is a unit in Zn. Looks like we're on the right track.

    Remember that a2k = -1, and divide by a, giving an = b. The polynomial with rootsa and an is the polynomial with roots a and b. This is the aforementionedquadratic, which has integer coefficients. The conditions of the theorem aresatisfied, and n is prime. Technically we need to run one trial division, but it's ninto n, so we can skip that step.

    Conversely, let n be prime. the quadratic has discriminant 6, which is not aresidue mod n. First, 2 is a square mod n. To deal with 3, we need k to be odd.

    Page 30

    Geethanjali College Of Engineering and TechnologyDepartment Of CSE

    Thus n is 1 mod 3, and by reciprocity, 3 is not a square mod n. Since 6 is not a

    http://www.mathreference.com/num,mers.htmlhttp://www.mathreference.com/num,mers.htmlhttp://www.mathreference.com/num-pfac,nstpt.htmlhttp://www.mathreference.com/num-mod,qr12.htmlhttp://www.mathreference.com/num,mers.htmlhttp://www.mathreference.com/num,mers.htmlhttp://www.mathreference.com/num-pfac,nstpt.htmlhttp://www.mathreference.com/num-mod,qr12.htmlhttp://www.mathreference.com/num-mod,qrp.htmlhttp://www.mathreference.com/num-mod,qrp.html
  • 8/7/2019 Notes of Add On Content

    31/68

    y p y qsquare the quadratic is irreducible, giving a finite field of order n2.

    Every finite field extension is galois, so there is but one nontrivial field

    automorphism, which can be expressed as conjugation, i.e. swapping the roots aand b, or as the frobenius automorphism, i.e. raising to the nth power. Thus, anhas to be a conjugate of a, namely b. Similarly, bn = a.

    With this in mind, consider the square of ek-1. This is 0 iff ek-1 is 0. Rememberthat ab = -1.

    ek-12 =a2k + b2k + 2 =ana + bnb + 2 =ba + ab + 2 =0

    Procedure

    Given an exponent k, derive n = 2k-1, and run the strong pseudoprime test to seeif n is prime. If it is, evaluate ek-1 toprove n is prime. This entails k iterations of asquare mod n. The mod is a simple operation, given the structure of n. Assumingthe numbers are in binary, as one would expect from a computer, chop thenumber into two pieces and add them together. By analogy, reducing a decimalnumber mod 999 is easy. For example, 292,681 becomes 292+681 = 973 mod999. So the only difficult step is the square. When k is in the millions, and n is

    millions of bits long, computers use the fft multiplication algorithm, which runsmuch faster than k2. Using this, the algorithm has complexity k2log(k).

    Page 31

    Geethanjali College Of Engineering and TechnologyDepartment Of CSE

    THE FIBONACCI AND LUCAS NUMBERS

    http://www.mathreference.com/num-mod,qrp.htmlhttp://www.mathreference.com/num-mod,qrp.html
  • 8/7/2019 Notes of Add On Content

    32/68

    THE FIBONACCI AND LUCAS NUMBERSThe great Italian mathematician, Leonardo of Pisa (c. 1170-1250), who is knowntoday asFibonacci (an abbreviation of filius Bonacci), expanded on the Arabic algebra ofNorth Africa and introduced algebra into Europe. The solution of a problem in hisbook Liber Abacciuses the sequence(F) 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55,

    One of the many applications of this Fibonacci sequence is a theorem about thenumber of steps in an algorithm for finding the greatest common divisor of a pair oflarge integers. We study the sequence here because it provides a wonderfulopportunity for discovering mathematical patterns.

    The numbers shown in (F) are just the beginning of the unending Fibonaccisequence. The rule for obtaining more terms is as follows: RECURSIVE

    PROPERTY.The sum of two consecutive terms in (F) is the term immediately after them.For example,the term after 55 in (F) is 34 + 55 = 89 andthe term after that is 55 + 89 = 144.To aid in stating properties of the Fibonacci sequence, we use the customarynotation

    F0, F1, F2, F3, for the integers of the Fibonacci sequence.That is, F0 = 0, F1 = 1, F2 = F0 + F1 = 1, F3 = F1 + F2 =2, F4 = F2 + F3 = 3, F5 = F3 + F4 = 5, F6 = F4 + F5 = 8, and so on. When Fnstands for some term of the sequence, the term just afterFn is represented byFn+1, the term afterFn+1 is Fn+2, and so on. Also, theterm just before Fn is Fn-1, the term just before Fn-1 is Fn-2 and so on.We now can define the Fibonacci numbers formally as the sequence F0, F1,

    having the two following properties.INITIAL CONDITIONS F0 = 0 and F1 = 1.RECURSION RULE Fn + Fn+1 = Fn+2 forn = 0, 1, 2, .Next let Sn stand for the sum of the Fibonacci numbers from F0 through Fn. Thatis,S0 = F0 = 0S1 = F0 + F1 = 0 + 1 = 1

    S2 = F0 + F1 + F2 = 0 + 1 + 1 = 2S3 = F0 + F1 + F2 + F3 = S2 + F3 = 2 + 2 = 4

    Page 32

    Geethanjali College Of Engineering and TechnologyDepartment Of CSE

    and in general, Sn = F0 + F1 + F2 + + Fn = Sn-1 + Fn.W t b l t f th l d l k f tt

  • 8/7/2019 Notes of Add On Content

    33/68

    We tabulate some of the values and look for a pattern.

    Page 33

    Geethanjali College Of Engineering and TechnologyDepartment Of CSE

    Sub: Advanced Data StructuresR f ti t i t

  • 8/7/2019 Notes of Add On Content

    34/68

    Reference cou nting smart pointers

    Reference counting is a powerful and often used strateg y. In the firstpart of this section a reference counting impleme ntation will beintroduced. In the second part some issues that arise are discussed.

    Reference cou nting impleme ntation

    The target of the section is a simplyfied lightweight version of a referencecounting smart pointer. There are two things that are shared between theinstances of smart pointers that reference the same data: The data

    pointer and the reference counter for that data. That is because incre-mentation ordecreme ntation of the counter in one pointer must be visiblein all pointers forthe appropriate data.

    Figure 1: Smart pointerstructure

    To indicate a pointer with no target (a null pointer) the shared counter

    pointer and data pointerare set to null. There are only two possible cases:Data and counter pointer are both null orboth not null.

    Figure 2: Null smartpointer

    increment() anddecrement()

    The following member functions define code for increme nting anddecreme nting the shared counter. The member count is oftypeint *.

    void ref_ptr::increment (void){

    Page 34

    Geethanjali College Of Engineering and TechnologyDepartment Of CSE

    if (ptr == 0) return;++(*count);

  • 8/7/2019 Notes of Add On Content

    35/68

    ++(*count);

    }

    void ref_ptr::decrement (void){

    if (ptr == 0) return;if (--(*count) == 0)

    {delete count;delete ptr;

    }}

    Page 35

    Geethanjali College Of Engineering and TechnologyDepartment Of CSE

    The Boost Library

  • 8/7/2019 Notes of Add On Content

    36/68

    The Boost Library comes with several smart pointers which will be part offuture versions oftheC++ Standard

    Librar y.

    scoped pt r: The scoped pointer is a lightweight and simple pointer forsole ownership ofsingle objects.

    The scoped pointer stares a pointer to a dynamically allocated object, whichis reclaimed either on destuction of the smart pointer on via explicit

    reset( ). It has no shared ownership orownership tranfer semantics andis non-copyable. The scoped pointer is safer and faster for objects thatshould not be copied.

    The scoped pointer does not meet the CopyConstructible and Assignablerequireme nts forSTLcontainers. There is also a version called scoped array which is forsole ownership ofarrays.

    shared pt r: The shared pointer is an external reference counting pointerwith ownership shared among multiple pointers.

    The shared pointer does meet the requireme nts for STL containers. Thereis also a version calledshared array which is for array ownership among

    muliple pointers.

    weak pt r: The weak pointer is a non-owning observer of a shared pt r-owned object. There is no need for an appropriate weak array variantbecause weak pointers never reclaim the data.

    The weak pointer does meet the requireme nts for

    STL containers.

    intrusive pt r: The intrusive pointer is a shared ownership pointer (likeshared pointer) with embedded reference count. It is a lightweight sharedpointer for objects which already have internal reference counting. Thus,the intrusive pointer is smaller and faster than the shared pointer.increment() and decrement() operations are forwarded to user defined

    member functions.

    The intrusive pointer does meet requireme nts for STL containers

    Page 36

    Geethanjali College Of Engineering and TechnologyDepartment Of CSE

    SUB: Microprocessors and Interfacing

  • 8/7/2019 Notes of Add On Content

    37/68

    Working of microprocessor

    Microprocessor Progression: Intel

    The first microprocessor to make it into a home computerwas the Intel 8080, a complete 8-bit computer on one chip,introduced in 1974. The first microprocessor to make a realsplash in the market was the Intel 8088, introduced in 1979and incorporated into the IBM PC (which first appearedaround 1982). If you are familiar with the PC market and its

    history, you know that the PC market moved from the 8088to the 80286 to the 80386 to the 80486 to the Pentium to thePentium II to the Pentium III to the Pentium 4. All of thesemicroprocessors are made by Intel and all of them areimprovements on the basic design of the 8088. The Pentium4 can execute any piece of code that ran on the original8088, but it does it about 5,000 times faster!

    The following table helps you to understand the differences between the differentprocessors that Intel has introduced over the years.

    Name Date Transistors MicronsClockspeed

    Datawidth

    MIPS

    8080 1974 6,000 6 2 MHz 8 bits 0.64

    8088 1979 29,000 3 5 MHz

    16bits8-bitbus

    0.33

    80286 1982 134,000 1.5 6 MHz16

    bits

    1

    80386 1985 275,000 1.516

    MHz32bits

    5

    80486 1989 1,200,000 125

    MHz32bits

    20

    Pentium 1993 3,100,000 0.8 60

    MHz

    32

    bits64-bit

    100

    Page 37

    The Intel 8080 wasthe first

    microprocessor ina home computer.

    Geethanjali College Of Engineering and TechnologyDepartment Of CSE

    bus

  • 8/7/2019 Notes of Add On Content

    38/68

    Pentium II 1997 7,500,000 0.35233MHz

    32bits

    64-bit

    bus

    ~300

    PentiumIII

    1999 9,500,000 0.25450MHz

    32bits

    64-bitbus

    ~510

    Pentium 4 2000 42,000,000 0.18 1.5GHz

    32bits

    64-bitbus

    ~1,700

    Pentium 4"Prescott"

    2004 125,000,000 0.093.6

    GHz

    32bits

    64-bit

    bus

    ~7,000

    Compiled from The Intel Microprocessor Quick Reference Guide and TSCPBenchmark Scores

    Information about this table:

    The date is the year that the processor was first introduced. Manyprocessors are re-introduced at higher clock speeds for many years afterthe original release date.

    Transistors is the number of transistors on the chip. You can see that thenumber of transistors on a single chip has risen steadily over the years.

    Microns is the width, in microns, of the smallest wire on the chip. Forcomparison, a human hair is 100 microns thick. As the feature size on thechip goes down, the number of transistors rises.

    Clock speed is the maximum rate that the chip can be clocked at. Clockspeed will make more sense in the next section.

    Data Width is the width of the ALU. An 8-bit ALU can

    add/subtract/multiply/etc. two 8-bit numbers, while a 32-bit ALU canmanipulate 32-bit numbers. An 8-bit ALU would have to execute fourinstructions to add two 32-bit numbers, while a 32-bit ALU can do it in one

    Page 38

    Geethanjali College Of Engineering and TechnologyDepartment Of CSE

    instruction. In many cases, the external data bus is the same width as theALU, but not always. The 8088 had a 16-bit ALU and an 8-bit bus, while the

    http://computer.howstuffworks.com/framed.htm?parent=microprocessor.htm&url=http://www.intel.com/pressroom/kits/quickref.htmhttp://computer.howstuffworks.com/framed.htm?parent=microprocessor.htm&url=http://home.comcast.net/~tckerrigan/bench.htmlhttp://computer.howstuffworks.com/framed.htm?parent=microprocessor.htm&url=http://home.comcast.net/~tckerrigan/bench.htmlhttp://computer.howstuffworks.com/framed.htm?parent=microprocessor.htm&url=http://www.intel.com/pressroom/kits/quickref.htmhttp://computer.howstuffworks.com/framed.htm?parent=microprocessor.htm&url=http://home.comcast.net/~tckerrigan/bench.htmlhttp://computer.howstuffworks.com/framed.htm?parent=microprocessor.htm&url=http://home.comcast.net/~tckerrigan/bench.htmlhttp://computer.howstuffworks.com/framed.htm?parent=microprocessor.htm&url=http://home.comcast.net/~tckerrigan/bench.html
  • 8/7/2019 Notes of Add On Content

    39/68

    , y ,modern Pentiums fetch data 64 bits at a time for their 32-bit ALUs.

    MIPS stands for "millions of instructions per second" and is a roughmeasure of the performance of a CPU. Modern CPUs can do so manydifferent things that MIPS ratings lose a lot of their meaning, but you canget a general sense of the relative power of the CPUs from this column.

    Page 39

    Geethanjali College Of Engineering and TechnologyDepartment Of CSE

    SUB: Operating systemsDistributed process scheduling

  • 8/7/2019 Notes of Add On Content

    40/68

    The primary objective of scheduling is to enhance overallsystem performance metrics such as process completion time andprocessor utilization. The existence of multiple processing nodesin distributed systems present a challenging problem for schedulingprocesses onto processors and vice versa.A system performance modelPartitioning a task into multiple processes for execution canresult in a speedup of the total task completion time. The

    speedup factorSis a functionS= F(Algorithm; System; Schedule)Scan be written as:S=OSPT/CPT=OSPT/OCPTidealOCPTideal/CPT= Si Sdwhere OSPT= optimal sequential processing time CPT= concurrent processing time

    OCPTideal= optimal concurrent processing time Si= the ideal speedup Sd= the degradation of the system due to actualimplementation compared to an ideal systemSican be rewritten as:Si=RC/RP n

    whereRP=Pmi=1 Pi/OSPTandRC=Pmi=1 Pi/OCPTideal nand n is the number of processors. The term Pm

    i=1 Piis the total computation of the concurrent algorithm where m is thenumber of tasks in the algorithm. Sdcan be rewritten as:Sd=1/1 + where =CPT OCPTidealOCPTideal2RPis Relative Processing: how much loss of of speedup is due to the substitution

    of the best sequential algorithm by an algorithm better adapted for concurrent

    Page 40

    Geethanjali College Of Engineering and TechnologyDepartment Of CSE

    implementation. RCis the Relative Concurrency which measures how far fromoptimal the usage of the n-processor is. It reects how well adapted

  • 8/7/2019 Notes of Add On Content

    41/68

    the given problem and its algorithm are to the ideal n-processorsystem. The nalexpression for speedup SisS=RC/RP1/1 + nThe term is called efficiency loss. It is a function of scheduling and the systemarchitecture. It would be decomposed into two independent terms: = sched+syst, but this is not easy to do since scheduling and the architecture areinterdependent. The best possible schedule on a given system hides the

    communication overhead (overlapping with other computations).The untied speedup model integrates three major componentsalgorithm developmentsystem architecturescheduling policy

    Page 41

    Geethanjali College Of Engineering and TechnologyDepartment Of CSE

    Distributed computing

    http://en.wikipedia.org/wiki/Computer_science
  • 8/7/2019 Notes of Add On Content

    42/68

    It is a field ofcomputer science that studies distributed systems. A distributed

    system consists of multiple autonomous computers that communicate through

    a computer network. The computers interact with each other in order to achieve a

    common goal. A computer program that runs in a distributed system is called

    a distributed program, and distributed programming is the process of writing

    such programs.

    Distributed computing also refers to the use of distributed systems to solve

    computational problems. In distributed computing, a problem is divided into many

    tasks, each of which is solved by one computer.

    The word distributedin terms such as "distributed system", "distributed

    programming", and "distributed algorithm" originally referred to computer networks

    where individual computers were physically distributed within some geographical

    area.[3] The terms are nowadays used in a much wider sense, even referring to

    autonomous processes that run on the same physical computer and interact with

    each other by message passing.

    While there is no single definition of a distributed system, the following defining

    properties are commonly used:

    There are several autonomous computational entities, each of which has its

    own local memory.

    The entities communicate with each other by message passing.

    In this article, the computational entities are called computers ornodes.

    A distributed system may have a common goal, such as solving a large

    computational problem. Alternatively, each computer may have its own user with

    individual needs, and the purpose of the distributed system is to coordinate the

    use of shared resources or provide communication services to the users.

    Other typical properties of distributed systems include the following:

    Page 42

    Geethanjali College Of Engineering and TechnologyDepartment Of CSE

    The system has to tolerate failures in individual computers.

    The structure of the system (network topology network latency number of

    http://en.wikipedia.org/wiki/Computer_sciencehttp://en.wikipedia.org/wiki/Computerhttp://en.wikipedia.org/wiki/Computer_networkhttp://en.wikipedia.org/wiki/Computer_programhttp://en.wikipedia.org/wiki/Distributed_algorithmhttp://en.wikipedia.org/wiki/Distributed_computing#cite_note-2http://en.wikipedia.org/wiki/Process_(computing)http://en.wikipedia.org/wiki/Memory_(computers)http://en.wikipedia.org/wiki/Message_passinghttp://en.wikipedia.org/wiki/Node_(networking)http://en.wikipedia.org/wiki/Computer_sciencehttp://en.wikipedia.org/wiki/Computerhttp://en.wikipedia.org/wiki/Computer_networkhttp://en.wikipedia.org/wiki/Computer_programhttp://en.wikipedia.org/wiki/Distributed_algorithmhttp://en.wikipedia.org/wiki/Distributed_computing#cite_note-2http://en.wikipedia.org/wiki/Process_(computing)http://en.wikipedia.org/wiki/Memory_(computers)http://en.wikipedia.org/wiki/Message_passinghttp://en.wikipedia.org/wiki/Node_(networking)http://en.wikipedia.org/wiki/Fault-tolerancehttp://en.wikipedia.org/wiki/Fault-tolerance
  • 8/7/2019 Notes of Add On Content

    43/68

    The structure of the system (network topology, network latency, number of

    computers) is not known in advance, the system may consist of different kinds

    of computers and network links, and the system may change during theexecution of a distributed program.

    Each computer has only a limited, incomplete view of the system. Each

    computer may know only one part of the input.

    Page 43

    Geethanjali College Of Engineering and TechnologyDepartment Of CSE

  • 8/7/2019 Notes of Add On Content

    44/68

    Page 44

    Geethanjali College Of Engineering and TechnologyDepartment Of CSE

    SUB: Compiler Design

    R i D t P i

  • 8/7/2019 Notes of Add On Content

    45/68

    Recursive Descent Parsing

    The manufacturing of an abstract syntax tree (AST) for the above grammar can bethought of a factory method, makeAST(), of some abstract factory, IASTFactory.How the AST is