About Me

My photo
santrampur, gujarat, India
i am a hunger of knowledge

Wednesday, December 29, 2010

the different types of hazards

There are three types of hazards.

                              [1]  Structural hazards
                              [2]  Data hazards
                              [3]  Control hazards

                  [1] STRUCTURAL HAZARDS

                                    When a machine is pipelined the overlapped execution of instructions requires pipelining of functional units and duplication of resources to allow all possible combinations of instructions in the pipeline. If some combinations of instructions cannot be accommodated because of resource conflicts, the machine is said to have a structural hazard. The most common instances of structural hazards a lies when some functional units is not fully pipelined Then a sequence of instructions using that not pipelined unit cannot proceed at the rate of one per clock cycle. Another common way that structural hazards appear is when some resource has not been duplicated enough to allow all combinations of instructions in the pipeline to execute.  
                        For Example
                                    A machine may have only one register. File write part but under certain circumstances the pipeline might want to perform two writes in a clock cycle.
                                   

                  [2] DATA HAZARDS
                                   
                                    A major effect of pipelining is to change the relative timing of instructions by overlapping their execution. This introduces data and control hazards. Data hazards occur when the pipeline changes the order or read/ write accesses to operands. So, that the order differs from the order seen by sequentially executing instructions on not pipelined machine.
                 
                  [3] CONTROL HAZARDS
                                               
                                    Control hazards can cause a greater performance loss than the data hazards when a branch is executed. It may or may not change the PC to something other than its current value recall that if a branch changes the PC to its forget address, it is a taken branch, if it falls through. It is not taken branch then the PC is normally not until the end of MEM, after the completion of the address calculation and comparison.

                                    The simplest method of dealing with branches is to stall the pipeline as soon as we detect the branch until we reach the MEM stage, which determines the new PC of course. We do not want to saw the pipeline until we know that the instruction is a branch.

What is Pipelining? Explain the principles of pipelining

Pipelining is an implementation technique where by multiple instructions are overlapped in execution. Today pipeline is the key implementation technique used to make fast scopes.
                 
                  PRINCIPLES OF PIPLINING
                                    Assembly lines have been widely used in automated industrial plenty in order to increase productivity their original form is a flow line of assembly stations where items are assembled continuously from separate parts along a moving conveyor belt. Ideally all the assembly stations should have equaled processing speed otherwise the slowest station becomes the bottleneck of the entire pipe. This bottleneck problem plus the congestion caused by improper buffering may result in many idle stations waiting for new parts. The a proper sequence of subtasks becomes a crucial factor in determining the performance of the pipeline.


                                    The precedence relation of a set of subtasks [ T1, T2, … TK] for a given task T implies that some task Tj cannot start until some earlier task Ti [Kj] finishes the inter dependencies of all substasks form the precedence graph with a line precedence relation. Task Tj cannot start until all easies subtasks {Ti, for all K=J} finish a liner pipeline can process a succession of subtasks with a inter precedence graph. The stages are pure combinational circuits performing arithmetic or logic operations over the data stream flowing through the pipe. The stages are separated high-speed interface latches separate the stages. The latches are fast registers for holding the intermediate results between the stages. 

Addressing Modes


(A)        REGISTER MODE
                 
                     The operand is the contents of a processor register the name (address) of the register is given in the instruction processor register are used as temporally storage locations. Where the data in a register are accessed using the register mode.

(B)       ABSOLUTE MODE
                 
                     The operand is in a memory location the address of this location is given explicitly in the instruction. The absolute mode can represent global variables in program a declaration such as integer A.B; in a high level language program will cause the complier to allocate a memory location to each of the variables A and B.

(C)       IMMEDIATE MODE
                 
                     The operand is given explicitly in the instruction address and data constants can be represented in assembly language using the immediate mode.

For example

         The instruction move 200 immediate, replaces the value 200 in register or clearly the immediate mode is only used to specify the value of a source operand.

                     Using a subscript to denote the immediate mode is not appropriate in assembly languages. A common collection is to use the sharp Sign (#) in front of the value to indicate that this value is to be used as an immediate operand.

(D)       INDIRECT MODE
                 
                     The effective address of the opened is the contents of register or memory location whose address appears in the instruction we denote indirection by pacing the name of the register or the memory address.

the function of functional units of computer

Following figure shows the functional units of a computer it consists of five main parts.

(1)               INPUT UNIT
(2)               OUTPUT UNIT
(3)               MEMORY
(4)               ARITHMETIC AND LOGIC UNIT
(5)               CONTROL UNIT

            The input unit accepts the coded information from the keyboard of a video terminal or from other computer over digital communication line. ALU and control unit together called as CPU or simply a processor.

(1)               INPUT UNIT

Computer accepts the coded information through the input unit. It has the capability or reading the instructions and data to be processed the most commonly used input devices are keyboard of a video terminal. This is electronically connected to the processing part of a computer. The keyboard is wired such that whenever a key is pressed the corresponding letter or digit is automatically translated into its corresponding code and is directly sent either to memory the processor.

(2)               OUTPUT UNIT

Output unit displays the processed result. Examples are video terminals and graphic displays. Input and output unit is usually combined under the term I/O unit for example considers the keyboard of a video terminal. This consists of keyboard for input and a cathode ray tube display for output. I/O devices do not alter the information. Content or meaning of the data some devices can be used as output only.

(3)               MEMORY UNIT

Memory unit is an integral part of a computer system. Main function of a memory unit is to store the information needed by the system. Typically it stores programs and data. The system performance is largely dependent on the organization. Storage capacity and speed of operation of the memory system can be broadly classified into four groups.

                                                                                             I.      Internal memory
                                                                                           II.      Primary memory
                                                                                          III.      Secondary memory
                                                                                       IV.      Cache memory

(4)               ARITHMETIC AND LOGIC UNIT

The arithmetic and logic unit is the ‘CORE’ of any processor its unit that performs the calculations. A typical ALU will have two inputs ports and a result port. It will also have a control input telling it which operation to perform and additional outputs for condition codes. 
Arithmetic unit
           
            The arithmetic unit performs typical arithmetic operations such as addition subtraction. Increment and decrement usually by unity. This unit includes the necessary hardware required for operation on signed and unsigned integers. Floating point numbers and BCD numbers etc. this multiplayer selects either Y OR X depending on the selection line so which is also the carry-in input of the addle.
           
            If so = 0 output is f = x + y
            If so = 1 output is f = x + y + 1 were y + 1 is 5
Hence the output is f = x – y
            (Compliment of Y)






Consider a simple logic unit which can perform two logic operation AND or EX- OR here also multiplexer selects either or these operations depending on the state of so.

If so = o output G = X AND Y
If so = 1 output G = X CD Y

Some additional hardware can be added to the above basic logic unit perform the Boolean operations.
For example
            X = X + 1
            Y + Y + Y * Y = X OR Y

Arithmetic and logic units are combined together to form ca complete ALU. Outputs F and G are multiplexed with a nibble multiplexer to get a single output depending on the selection lines of the nibble multiplexer the selection line is sometime known as mode selection line since it selects the desired mode either arithmetic or logic.

(5)               CONTROL UNIT

The purpose of control unit is to control the system operations by routing the selected data items to the selected processing hardware at the original time control unit acts as nerve centre for the other units. This unit decodes and translators each instruction and generates the necessary enable signals for ALU and other units. Control unit has two responsibilities. I.e. Instructions interpretation and instruction sequencing
The operation of the computer can be summarized as below.
v     The computer accepts in formation through the input unit and transfers it to the memory.
v     Information stored in the memory is fetched into arithmetic and logic unit to perform the desired operations.
v     Processed information is transferred to the output unit.
v     All activities inside the machine are controlled by a control unit.

Why .NET

Despite its substantial popularity, com suffers from a numbers of limitations.
                       
*      .Com itself offered for binary code reuse; it did not offer a model for source code reuse. An implication of this is that, although com offered interfaced-based inheritance. It did not support code-based inheritance.

*      Although .com offered the promise of a language independent architecture, reality often fulfill short of the premise. The root of the problem was the fact that seamless interoperability with com presupposed that each language was able to create and manipulate common automation compatible data types. This however was not the case. As a result although com made some real advances in the area of language independence it also had some real weaker ness.

*       .Com was extremely complex and for the most part only c++ programmers were able to work with com directly for VB programmers the visual basic failed to give the developer full control over com when it was needed and many visual basic programmers often locked sufficient even of those features that they were able to control.

In addition .com did not offer an integrated class library comparable to the .net FCL. Instead the developers of each application or operating system service were free to implement whatever object model made sense to extend their application. As a result, there are major gaps in the functionality made available through .com automation and there is not a good deal of consistency across object models.

The .NET platform and the .NET framework class library were developed in an effort to address these weaknesses of.com.

polymorphism

In computer science, polymorphism is a programming language feature that allows values of different data types to be handled using a uniform interface. The concept of parametric polymorphism applies to both data types and functions. A function that can evaluate to or be applied to values of different types is known as a polymorphic function. A data type that can appear to be of a generalized type (e.g., a list with elements of arbitrary type) is designated polymorphic data type like the generalized type from which such specializations are made.

*      The calling of a variety of operations using the same interface.

*      For example, a sub class can refine the implementation of a method or property inherited from its super class.

*      The property or method is there by redefined even if the super class is used as the interface class.

*      Thus, the logical device class can define the variable status as a string and can return the values “on” or “off”.

*      The modern sub class of logical device can redefine status by returning “on” or “off” and “connected”.

*      If all logical devices are enumerated any logical device that happens to be a modem can return the value “connected” for the status property.

*      Polymorphism enables a single method to exhibit different behaviors when used with different objects.

*      Method overloading is one form of polymorphism which a lows us to have two or more method declaration.

Example of overloading
Public overloads function find data (by val, name as srn as Array list find data and return result end function
Can be overloaded as shown below

Public overloads function find data (by val age as integer)
As array list find data and return result end function
Overloading constructers:
                  A constructor performs various. Tasks those are not visible to you as the programmer even if you were no code for the constructer. These tasks are all associated with building a complex.

Example
Public overloads sub new ()
      Initialize object here
End sub
Public overloads sub new (by Val ID as integer)
      Use the ID value to initialize the object
End sub

Explain event and event handlers

*      The control classes such as buttons and edit boxes expose standard windows events such as click, key press, mouse move, drag drop and others.

*      You can work with an event in your application using delegates.

*      You do not have to understand delegates in great detail to work event handless in an application.

*      However, understanding how to create and use delegates is useful if you are building controls. Working with other application that trigger events or are using there ads with WFC components.

*      It is also interesting if you want to understand the details of the java code created by the forms designer

*      This section provides some background on delegates and then addresses the practical aspects of handling events.

If you want to handle events for multiple controls or multiple events for the same control, you request a separate notification for each control event combination you can use the source object passed to the event handler to get detail about.

Which button was clicked

ü      Event driven programming

WINDOW APPLICATION

            Allows you to create the windows, dialog boxes and controls in your application you draw and view controls on a form. While you are designing a form
           
   Each form window has maximized, minimize and close button.

ü      You can create either fixed or movable forms. The form you design will have the same features at designs time and as run time unless you specify otherwise in the forms properties.

ü      Use the buttons in the toolbox to draw controls on the form.

ü      Use the form layout window command from the view menu to preview the layout of your form on a screen.

ü      The basic unit of the windows application is the form.

Artificial intelligence? Discuss briefly the history of artificial intelligence.

Artificial intelligence (AI) is the intelligence of machines and the branch of computer science that aims to create it. AI textbooks define the field as "the study and design of intelligent agents" where an intelligent agent is a system that perceives its environment and takes actions that maximize its chances of success. John McCarthy, who coined the term in 1956 in organized the workshop at Dartmouth College. Defines, it as "the science and engineering of making intelligent machines." Where researches are interested in the field of automata theory, neural nets and study of intelligence proposed and adopted the name artificial intelligence for the field.

                  HISTORY OF ARTIFICAL INTELLIGENCE:
                 
v     In fact it is the different disciplines like philosophy, mathematics, economics, neuroscience, psychology, computer engineering, control theory and cybernetics and linguistics have contributed ideas, viewpoints and techniques to AI.

v     It is Alan Turing who first proposed theory of computation.

v     He proposed for the possibility of a computational machine that could behave in a way that could be perceived as intelligent.

v     He developed a simple, universal and non numeric computing model which is capable of computing any computable function.

v     Alan Twing (1936) is called the father of AI.

v     Some of the diverse ideas / works that gave momentum to evolution of AI are listed below.

ü      Allen’s theory of computation (1936)
ü      Russel and whitehead’s principia mathematic
ü      Wieners book on “cybernetics” (1948)

v     AI has emerged as a separate field rather than a branch of other areas like mathematics operation research or decision theory.

v     AI is the only field that laid emphasis on the methodology i.e. to build machines that can work in complex changing environment in an intelligent manner.

v     Since 1956 researchers, industry people and scientists are succeeding in applying as in different areas like spacecrafts. Computer vision, media diagnosis, robotics, computer games, structural engineering, chemical and geological data analysis.

logical channel in groupe special mobile (GSM)

Logical channels in GSM (groupe special mobile)

All the common channels are embedded in different traffic channels. They are grouped by the same cycle (51*8 BP). Where BP stands for burst period which is 517 rs 


                       
                                    1).        DOWN LINK COMMON CHANNELS
                 
                                    2).        UP LINK COMMON CHANNELS

(1)       DOWN LINK COMMON CHANNELS:
                 
There are five downlink unidirectional channels shared or grouped by a TCH.

Ø      Frequency collection channels (FCCH) repeats once every 51*8 BPS; used to identify a beacon frequency.

Ø      Synchronization channels (SCH) follows each FCCH slot by 8 BPS.

Ø      Broadcast control channels (BCCH) is broadcast regularly in each cell and received by all the mobile stations in the idle mode.

Ø      Paging and access grant channel (PAGCH) issued for the incoming call received at the mobile station. The access grant channel is answered. From the base station and allocates a channel during the access procedure of setting up a call.

Ø       Cell broadcast channel (CECH) each cell broadcasts a short message for 2 sec’s from the network to the mobile station in idle mode. Half a down link TCH 18 is used and special BCH design constraints exist because of the need for sending two channels is parallel.

Ø      The mobile station (MS) finds the FCCH bursts then looks for an SCH burst on the same frequency to achieve synchronization. The MS then receive BCCH on several time slots and select a proper cell, remaining for a period in the idle mode.                            


(2)       UP LINK COMMON CHANNELS:
                 
The random-access channel (RACH) is the only common up link channel. RACH is the channel that the mobile station chooses to access the calls.

Ø      Signaling channels:

All the signaling channels have one of the physical channels and the logical channels names are based on their logical functions.
Ø      Slow associated control channel (SACCH)

A slow rate TCH used for signaling transport and used for non-urgent procedures mainly hand over decisions. It uses the eighth rate.

Ø      Fast associated control channel (FACCH)

Indicator cell establishment authenticates subscribers or commands a hand over.

Ø      Stand alone dedicated control channel (SDCCH)

Occasionally the connection between a mobile and the network is used slowly for passing signaling information and not for calls.

Ø      Voice/ data channel

Each time slot of a voice channel contains 260 bits per block. The entire block contains 316 bits. Each time slot of a data channel contains 120 of 240 bits per block.