Adsense

Write Embedded C code to find maximum minimum from given list of 32 bit data stored from memory location 0x1FFFF138 onwards. No of data elements will be stored on memory location 0x1FFFF134.

 #include<MKL25Z4.h>

int main()
{
volatile unsigned int size,i,k=0xFFFFFFFF,t=0; // t stores max number , k store min number
volatile unsigned int z[]={0x04,0x0A,0x01,0x02,0x0F}; // data taken in array

size = z[0];    // take size from first location

            for (i=1;i<=size;i++)
            {    
            if (t<z[i])    {    t=z[i];    } // find maximum
            if (k>z[i]) {    k=z[i];    } // find minimum
            }    
}

Input:

 

Result:


 

No comments:

Post a Comment

Write a ARM cortex M0+ assembly language code based on arithmatc and logical instructions.

 Problem 1: Implement following code conversions to convert binary no 0x89ABCDEF(32-bits) into a) BCD (64-bits)   b) Gray (32-bits) Problem...