Answered Questions

  • sum 0f 2 64 bits using 32 bits

    Hi,the question is you have cpu that knows to docomputations on 32 bits(unsigned integer).write a function that find the sum of 2 64 bits numbers using this cpu?there is a struct:typedef struct{ int low;(32 bits) int high;(32 bits)}64bit;

    devendra

    • Aug 17th, 2011

    well this can be done in any number of ways... One simple way is to use asm keyword and write assembly instructions if you are familiar with assembly language.. Because through assembly language we ca...

    amodiahs

    • Jul 24th, 2008

    Hello friends, Here we need to use a linked list. See, it is already known that CPU doesnot support one single 64bit number hence, first thing is that using normal data types will be useless. So here ...

  • Where is the function declared as static stored in memory?

    The usage of static with a function or variable restricts their scope.Is this behaviour memory related?

    jbode

    • Jun 5th, 2019

    The static keyword does not affect where or how a function is stored in memory. It only affects whether the function *name* is visible to code outside of the current translation unit (source file).

    Harsha

    • Mar 27th, 2019

    You have to specify where you are going to place it. You can do this in the linker file(.lsl or .ld file). If you place it in the .text section, it goes into the Flash, else by default a static function is placed in the RAM(.data).

  • output of the following programvoid main(){unsigned i;i=100*400;printf(\

    brijux

    • Jul 1st, 2008

    The integer size on 16 bit machine is 2 bytes.2 bytes = 16 bits.2^16 = 65536So for unsigned int range is 0 to 65536for signed int, range is -32768 to 32767And here unsigned int is used, and 40000 is within range, so it will print 40000 without any error.(Provided that the code is complete :) )

    santhoshkumar

    • Oct 7th, 2006

    tes sucheta you r absolutely righteven unsigned never takes -ve values and it doubles the memory by adding the whole memory capacity

  • What is page thrashing?

    Some operating systems (such as UNIX or Windows in enhanced mode) use virtual memory. Virtual memory is a technique for making a machine behave as if it had more memory than it really has, by using disk space to simulate RAM (random-access memory). In the 80386 and higher Intel CPU chips, and in most other modern microprocessors (such as the Motorola 68030, Sparc, and Power PC), exists a piece of...

    kranthi tadisetty

    • Oct 20th, 2013

    Thrashing means "high pagefaultservice time ",bcoz of that reason the operating system can applying pagereplacement algorithms are very highly,i.e(processor busy with executing pagereplacement algorithms rather than executing userinstructions

    amit1220

    • Dec 13th, 2012

    Thrashing is caused by under allocation of the minimum number of pages required by a process, forcing it to continuously page fault. The system can detect thrashing by evaluating the level of CPU util...