CMP EMBEDDED.COM

Login | Register     Welcome Guest  
HOME DESIGN PRODUCTS COLUMNS E-LEARNING CONFERENCES CODE FORUMS/BLOGS NEWSLETTERS CONTACT FEATURES RSS RSS

Listing 6: Multiplication and division on different granularity Listing 6: Multiplication and division on different granularity

void Test11_21(FIXED11_21 a, FIXED7_9 b)
{
FIXED11_21 temp;
printf("\nResults of multiply and divide on 11_21 and 7_9 variables.\n");
temp.full = b.full << 12;
temp.full = MULT11_21(a,temp);
printf("Multiply result is %d.%2.2d\n", temp.part.integer,
(temp.part.fraction*100+1048576)/2097152);
temp.full = b.full << 12;
temp.full = DIV11_21(a,temp);
printf("Divide result is %d.%2.2d\n", temp.part.integer,
(temp.part.fraction*100+1048576)/2097152);
}
Embedded.com Career Center
Looking for a new job?
SEARCH JOBS

Browse all jobs

SPONSOR
RECENT JOB POSTINGS





 :