This is default featured post 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured post 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured post 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured post 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured post 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

Sunday, 31 March 2013

What Is Edge Triggered Interrupt and Level Triggered Interrupt?

Triggered


This mean making a circuit active,making a circuit active means allowing the circuit to take input and give output,Like for example supposed we have a flip-flop when the circuit is not triggered ,even if you give some input data, it will not change the data stored inside the flip-flop nor will it change the output .

They are basically two types of Triggering interrupt . The triggering is given in form of a clock pulse or gating signal depending upon the type of triggering mechanism used the circuit will become active at specific states of the clock pulse.

Level triggered interrupt

In level triggered interrupt the circuit will become active ,when the gating or clock pulse is on a particular level, this level is decided by the designer .We can have a negative level triggering in which, the circuit is active when the clock signal is low or a positive level triggering in when the circuit is active when the signal is high.

Edge triggered interrupt


Edge triggered interrupt edge triggering ,the circuit becomes active at negative or positive edge of  the clock signal.

For example if the circuit is positive edge triggered , it will take input at exactly the time in which the clock signal goes from low to high.

Similarly input is taken at exactly the time in which the clock signal goes from high to low in negative edge triggering . But keep in mind after the input , it can be processed in all the time till the next input is taken.

Saturday, 30 March 2013

What Is Interrupt Sevice Routine or Interrupt Handler Interrupt?

An interrupt service routine (ISR) or interrupt handle is a piece of code that code that should be executed when an interrupt is triggered. usually each enabled interrupt has it own ISR. in AVR assemble language each ISR must end with the RETI instruction which indicates the end of the ISR.

Interrupt can be categorized into Mask-able interrupt,non-mask-able interrupt,inter-processor interrupt(IPI),software interrupt, and superiors interrupt.

1.Maskable interrupt is a hardware interrupt that may be ignored by setting a bit in an interrupt mask register's bit-mask.

2. Non-mask-able interrupt is a hardware interrupt that locks an associate bit-mask , sot that it can never be ignored Non-mask-able interrupt are often used for timers ,specially watchdog timers.

3. Inter-processor interrupt(IPI) is a special case of interrupt that is generated by one processor to interrupt another processor in a multiprocessor system.

4. software interrupt is an interrupt generated within processor by executing an instruction.

5.spurious interrupt is a hardware interrupt that is unwanted. they are typically generated by system conditions such as electrical interference.

what Is Interrupt?

Interrupts are basically event that require immediate attention by the micro-controller.

When an interrupt event occurs the CPU pause its current task and attend the interrupt by executing an interrupt serve routine(ISR) at the end of the ISR. the CPU return to the task it had pause and continue its normal operation.

In order for the micro-controller to respond to an interrupt event the interrupt feature of the micron-controller must be enabled along with the specific event. This is done by setting the global interrupt enable bit & interrupt enable.


Friday, 29 March 2013

what Is Meaning of the Declaration Const Volatile Int a=6

value of variable cannot be changed by programmer (due to const) but it value can be changed by external device or hardware interrupt (due to volatile).



Example:

#include<stdio.h>
const volatile int a=6;// HERE variable int a is constant so that it can't change by the programmer but it   
                                                   can  change external because of volatile
int main()
{

  printf("canst volatile %d",a);

}


output: canst volatile 6

Thursday, 28 March 2013

What Is Verification and Validation?


In software project management ,software testing ,and software engines verification and validation is the process of checking that a software systems meets specification and that it fulfill its intended purpose.

What Is Unit and White Box Testing

What is unit testing?

In unit testing is a method by which individuals units of source codes are tested to determine if they are for  use or not.

What is white-box-testing?

white-box testing is a method of testing software that tests internal structures or working of an application as opposed to its functionality.

In white box testing an internal perspective of the system as well as programming skills are used to design test case.

Wednesday, 27 March 2013

What Is integration Testing?

Integration testing (sometimes called integration and testing) is the phase in software testing in which individual software modules are combined and tested as a group. It Occurs after a unit testing and before validation testing.

The purpose of integration testing is to verify functional performance and reliability required placed on major design item(groups of units).

Tuesday, 26 March 2013

What is Reset Vector ?

Reset vector is a computing term used to describe the default location a center processing unit will go to find the first instruction it will execute after a reset . That is to say  the reset vector is a pointer or address where the CPU should always begin as soon as it is able to execute instruction.



Monday, 25 March 2013

What Is #Progma Directive?

Progma is implementation specific directive that is each progma directive has different implementation rule and use. There are the many type of progma directive and varies from one compiler to another compiler. If compiler doesn't recognize particular progma. Than it ignore the progma statement without showing any error or warning message and execute.


                                      
#progma Startup
#progma exit
#progma warn
#progma inline
#progma argused
#progma hdrfile
#progma hdrstup
#progma saverage


#progma inline only tells the compiler that source code of program contain inline assembly language code.In C we can write assembly language program with help of asm keyword.

#progma warn  In C there are many warning message which can be ON or OFF with help of #progma warn

Syntax:-

                                      
#progma warn +XXX
#progma warn -XXX
#progam warn .XXX


Where
             +   mean ON
             -   mean OFF
             .   mean on/off toggle

XXX indicate particular warning code in three alphabet

                                     
 #progam Startup[priority]
  #progam exit[priority]

        

Where Priority Is Optional Integer Number.-

Progma startup always execute the function before the main function.#progam exit always execute the Function after the main function for user priority varies from 64 to 255.

 For C library priority varies from 0 to 63 Default priority is 100


          
void india();
void usa();

#progma startup india 105
#progma startup start usa
#progma exit Usa
#progma exit india 105

void main()
{

     printf("\n i am in main");
     getch();
}

void india()
{
    printf("\n i am in india");
    getch();
}

void usa()
{
           printf("\n i am in usa");
           getch();
}

                                                                                                



Output:-

                                      
i am in usa
i am in india
i am in main
i am in india
i am in usa



Sunday, 24 March 2013

Far Pointer in C Programming

The Pointer which can point or access whole the residence memory of RAM i.e. which can access all 16 segments is known as far Pointer.

Far Pointer:-

(If you don’t know what is segment the click here)
Size of far Pointer is 4 byte or 32 bit.

Examples:

(1) What will be output of following c program?



            
#include<stdio.h>
int main()
{
   int x=10;
   int far *ptr;
   ptr=&x;
   printf("%d",sizeof ptr);
   return 0;
}
                                                                                             


 Output:- 4


(2)What will be output of following c program?



 #include<stdio.h>
int main()
{
     int far *near*ptr;
    printf("%d %d",sizeof(ptr) ,sizeof(*ptr));
    return 0;
}
                                                                                                
 


                                  
Output:- 4 2


Explanation: ptr is far pointer while *ptr is near pointer.

(3)What will be output of following c program?



          
#include<stdio.h>
int main()
{
    int far *p,far *q;
   printf("%d %d",sizeof(p) ,sizeof(q));
   return 0;

}
                                                                                                



              
Output:- 4 4                   
First 16 bit stores: Segment number
Next 16 bit stores: Offset address

What is segment number and offset address?

Example:-



   
#include<stdio.h>
int main()
{
     int x=100;
     int far *ptr;
     ptr=&x;
     printf("%Fp",ptr);
    return 0;
}
                                                                                                       


                                    
Output: -8FD8:FFF4


Here 8FD8 is segment address and FFF4 is offset address in hexadecimal number format. %Fp is used for print offset and segment address of pointer in printf function in hexadecimal number format.In the header file dos.h there are three macro functions to get the offset address and segment address from far pointer and vice versa.

1. FP_OFF(): To get offset address from far address.

2. FP_SEG(): To get segment address from far address.

3. MK_FP(): To make far address from segment and offset address.

Examples:

(1)What will be output of following c program?



#include <dos.h>
#include<stdio.h>
int main()
{
    int i=25;
   int far*ptr=&i;
   printf("%X %X",FP_SEG(ptr),FP_OFF(ptr));
   return 0;
}
                                                                                                     




Output: Any segment and offset address in hexadecimal number format respectively.                       

(2)What will be output of following c program?



                 
#include <dos.h>
#include<stdio.h>
int main()
{
     int i=25;
    int far*ptr=&i;
    unsigned int s,o;
    s=FP_SEG(ptr);
    o=FP_OFF(ptr);
    printf("%Fp",MK_FP(s,o));
    return 0;

}
                                                                                      




Output: 8FD9:FFF4 (Assume)                        

We cannot guess what will offset address, segment address and far address of any far pointer. These address are decided by operating system.

Limitation of the far pointers:

We cannot change or modify the segment address of given far address by applying any arithmetic operation on it. That is by using arithmetic operator we cannot jump from one segment to other segments. If you will increment the far address beyond the maximum value of its offset address instead of incrementing segment address, it will repeat its offset address in cyclic order.

What Is Huge Pointer



 Huge Pointer

The Pointer which can pointer total 16 segment of memory is called Huge pointer.
the size of the huge pointer is 4bytes ie 32 bits.

Example:


  1. void main()
  2. {
  3.   int*p;
  4.   int near *np;
  5.   int far *fp;
  6.   int huge *hp;
  7.   printf("\n %d %d %d %d ", sizeof(p),sizeof(np),sizeof(fp),sizeof(hp));
  8. }




Output:- 2 2 4 4





Thursday, 21 March 2013

What Is Pointer?

A Pointer is a derive data type in C, which is built from the fundamental data type in c a Pointer is a variable which stores always an address of another variable.




Advantage of Pointer:

By using Pointer we can use access a variable which is defined outside the function

By using Pointer, we can handle we can handle the database like graph, trees and linked list more efficiently.

Pointer can increase the execution speed.

In Pointer, we using two operators

& address of operator
 * object \value of address \indirection operator \deference operator




  1. void main()
  2. {
  3.    int i;
  4.     int* ptr;
  5.    ptr=&i;
  6. }

    Here i is a variable of type integer.ptr is a variable of type int* and it is an address type.ptr can hold an address of an integer variable.

    Wednesday, 20 March 2013

    What Is Wild Pointer

      Wild pointer:

               A pointer in C which has not been initialized is known as wild pointer.

        Example:

       What will be output of following c program?



    1. #include<stdio.h>
    2.  int main()
    3.  {
    4.     int *ptr;
    5.     printf("%u\n",ptr);
    6.     printf("%d",*ptr);
    7.     return 0;
    8.    }
                                                                                             


             Output:


      Any address

    Garbage value


    Here ptr is wild pointer because it has not been initialized.

    Tuesday, 19 March 2013

    What Is Null Pointer in C Language?

    It is always a good practice to assign a NULL value to a Pointer variable in case you do not have an exact address to be assigned. This is done at the time of variable declaration. A Pointer that is assigned NULL is called a null Pointer. The NULL Pointer is a constant at a value of zero defined in several standard libraries.
    Consider the following program:



    1. #include <stdio.h>
    2. int main ()
    3. {
    4.    int  *ptr = NULL;
    5.    printf("The value of  ptr is : %x\n", &ptr  );
    6.    return 0;
    7. }

      When the above code is compiled and executed, it produces following result:

      The value of ptr is 0. On most of the operating systems, programs are not permitted to access memory at address 0 because that memory is reserved by the operating system. However, the memory address 0 has special significance; it signals that the Pointer is not intended to point to an accessible memory location. However, by convention, if a pointer contains the null (zero) value, it is assumed to point to nothing.
      To check for a null pointer you can use an if statement as follows:



      if(ptr)     /* succeeds if p is not null */
      if(!ptr)    /* succeeds if p is null */
                                            




      Twitter Delicious Facebook Digg Stumbleupon Favorites More