geeksystems
BAN USER
Employee at None
Comments (4)
Reputation 10
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
0
of 0 vote
#include <stdio.h>
int main() {
unsigned num = 8;
unsigned int a = 4;
unsigned int b = 7;
unsigned int k = 5;
unsigned int mask;
int r =0;
mask = ((unsigned int)~0<<a) & ((unsigned int)~0>>(31-b));
k = ((unsigned int)k<<a);
printf("%d\n",k);
// printf("%d %d\n",k,mask);
r = (num & ~mask) | k;
printf("%x",r);
Comment hidden because of low score. Click to expand.
0
of 0 vote
#include <stdio.h>
int main(int argc,char **argv){
int i = 1;
char *ptr = (char*)&i;
if(*ptr == 1){
printf("Little Endian");
}else{
printf("Big Endian");
}
Comment hidden because of low score. Click to expand.
0
of 0 vote
Check out the answers at msdn.microsoft.com/en-us/library/ms858616.aspx. The idea is similar and implementation varies according the system in consideration
- geeksystems February 09, 2014Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
Maximum burst 80 wordsf followd by 20 idle cycles
- geeksystems June 17, 2014clock period write: 250Mhz
clock period read: 200Mhz
1) The write takes 320ns to write 80 words followed by 20 idle cycles.
2) The read takes 400ns to read 80 words.
3) 400-320-=80 write overtakes read by this magnitude.
4) Then we have 80/5 = 16 cycles for read to catch up. --> Depth needed so write does not over run read