The question simply says that if 'h' (coded as $h_3h_2h_1h_0$) is the 4-bit gray code of n then 'g' (coded as $g_3g_2g_1g_0$) is the gray code of (n+1) mod 16.
So, write the gray code as:
|
function h |
function g |
$n$ |
$h_3$ |
$h_2$ |
$h_1$ |
$h_0$ |
$g_3$ |
$g_2$ |
$g_1$ |
$g_0$ |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
1 |
1 |
0 |
0 |
0 |
1 |
0 |
0 |
1 |
1 |
2 |
0 |
0 |
1 |
1 |
0 |
0 |
1 |
0 |
3 |
0 |
0 |
1 |
0 |
0 |
1 |
1 |
0 |
4 |
0 |
1 |
1 |
0 |
0 |
1 |
1 |
1 |
5 |
0 |
1 |
1 |
1 |
0 |
1 |
0 |
1 |
6 |
0 |
1 |
0 |
1 |
0 |
1 |
0 |
0 |
7 |
0 |
1 |
0 |
0 |
1 |
1 |
0 |
0 |
8 |
1 |
1 |
0 |
0 |
1 |
1 |
0 |
1 |
9 |
1 |
1 |
0 |
1 |
1 |
1 |
1 |
1 |
10 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
0 |
11 |
1 |
1 |
1 |
0 |
1 |
0 |
1 |
0 |
12 |
1 |
0 |
1 |
0 |
1 |
0 |
1 |
1 |
13 |
1 |
0 |
1 |
1 |
1 |
0 |
0 |
1 |
14 |
1 |
0 |
0 |
1 |
1 |
0 |
0 |
0 |
15 |
1 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
Now, we just have to write $g_2$ as a function of $h$ i.e $g_2(h_3h_2h_1h_0)=\sum(minterms \ of\ g_2) $
To get minterms, convert h to decimal wherever you get '1' in $g_2$.
$\therefore g_2=\sum (2,4,5,6,7,12,13,15) $
Hence, Correct Answer: C.