Skip to content

GATE CS 2006 Q40 — Number Representations (Fixed and Floating Point)

Explain with AI

Consider numbers represented in 4-bit Gray code. Let h3h2h1h0h_{3}h_{2}h_{1}h_{0}  be the Gray code  representation of a number nn and let g3g2g1g0g_{3}g_{2}g_{1}g_{0} be the Gray code of (n+1)(modulo16)(n+1)(modulo 16)  value of the number. Which one of the following functions is correct?

Choose one option
View worked solution

Answer: C

To find the correct function, we map each decimal value n∈[0,15]n \in [0, 15] to its 4-bit Gray code representation H(n)=h3h2h1h0H(n) = h_3h_2h_1h_0. The decimal value of this Gray code (interpreted as a standard binary number) represents the minterm index DD. We then find the Gray code of (n+1)(mod16)(n+1) \pmod{16}, which is G(n)=g3g2g1g0G(n) = g_3g_2g_1g_0.

The mapping table for all 16 values is as follows:

nn H(n)=h3h2h1h0H(n) = h_3h_2h_1h_0 Minterm Index DD G(n)=g3g2g1g0G(n) = g_3g_2g_1g_0
0000000001
1000110011
2001130010
3001020110
4011060111
5011170101
6010150100
7010041100
81100121101
91101131111
101111151110
111110141010
121010101011
131011111001
14100191000
15100080000

Now, we collect the minterm indices DD where each output bit gig_i is 11:

  • For g2g_2, the bit is 11 at D∈{2,4,5,6,7,12,13,15}D \in \{2, 4, 5, 6, 7, 12, 13, 15\}.

This matches Option C: g2(h3h2h1h0)=∑(2,4,5,6,7,12,13,15)g_{2}(h_{3}h_{2}h_{1}h_{0})=\sum (2, 4, 5, 6, 7, 12, 13, 15).

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Number Representations (Fixed and Floating Point) questions