retagged by
1,363 views
5 votes
5 votes

Consider the function:

int fun(int n)
{
    if (n==4)
        return n;
    else return 2*fun(n+1);
}


A MOD-16 ripple counter is holding the count $(1001)_2.$ What will be the count after "$(\text{fun}(2)+15)_{10}$" clock pulses?

  1. $(1000)_2$
  2. $(1010)_2$
  3. $(1011)_2$
  4. $(1101)_2$
retagged by

2 Answers

4 votes
4 votes
It is mod 16 so after 16 pulses it returns to 9

Then after 15 more pulses it will 1 step behind 9 that is 8 (1000)
0 votes
0 votes
after solving, function returns 31

and now have to find out what will be count after 31 clock pulses more.

So, for that, first of all have to check current position of counter,

currently counter on 9, now 6 more pulses left to reach to 15 (as it’s MOD-16 so 0-15)

31-6= 25 , now current position 0 and 25 still left

25-16 = 9

so…..current position is 8 (as 0 there) which is 1000 !!!!
Answer:

Related questions

0 votes
0 votes
2 answers
1
9 votes
9 votes
1 answer
4