6.2k views

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

1. $g_{0}(h_{3}h_{2}h_{1}h_{0})=\sum (1,2,3,6,10,13,14,15)$
2. $g_{1}(h_{3}h_{2}h_{1}h_{0})=\sum (4, 9,10,11,12,13,14,15)$
3. $g_{2}(h_{3}h_{2}h_{1}h_{0})=\sum (2, 4,5,6,7,12,13,15)$
4. $g_{3}(h_{3}h_{2}h_{1}h_{0})=\sum (0,1,6,7,10,11,12,13)$
| 6.2k views
0
can someone plz help ? i understood the solution but my doubt is why ?  we have map this with the corresponding grey code number  like ( 0110 with 0010 (2) ) as while design the grey code circuit (kmap) we get the minterms by checking the corresposding decimal no like 0110 is grey code of 3(0011) so here  g2 bit is 1 so its mean minterm should be 3, like in this way ? is just for making my concept more clear , bcoz this question can be further modified so, kindly clear this doubt n thanks in advance .
+5

As we know grey codes are not weighted code means there is no pattern to generate grey code and also grey code are reflected code,,I m going to see you how to get grey code ,that may help you

Decimal n Binary n H(x) = gray(n) G(x) = gray[(n+1) mod16]
0 $0000$ $0000 (00)$ $0001$
1 $0001$ $0001 (01)$ $0011$
2 $0010$ $0011 (03)$ $0010$
3 $0011$ $0010 (02)$ $0110$
4 $0100$ $0110 (06)$ $0111$
5 $0101$ $0111 (07)$ $0101$
6 $0110$ $0101 (05)$ $0100$
7 $0111$ $0100 (04)$ $1100$
8 $1000$ $1100 (12)$ $1101$
9 $1001$ $1101 (13)$ $1111$
10 $1010$ $1111 (15)$ $1110$
11 $1011$ $1110 (14)$ $1010$
12 $1100$ $1010 (10)$ $1011$
13 $1101$ $1011 (11)$ $1001$
14 $1110$ $1001 (09)$ $1000$
15 $1111$ $1000 (08)$ $0000$

We need to map min terms of $g_3g_2g_1g_0$ w.r.t $h_3h_2h_1h_0$.

Hence as highlighted $g_2$ matches with option C.

Edit :
We have to map $h(x)$ with $g(x)$. Mod 16 is used in $g(x)$ only because since we have $4$ bits, mamximum possible no that can be represented is $15$, so after $15$ we shouldn't get $16$ and go back to $0$. thats why.
Now, mapping is simple.We just have to map such that h(x)---->g(x+1)
Means if h represents gray code of 0 then g will represent gray code of 1
If h represents gray code of 1 then g will represent for 2 and so on.
For last number h(15), mod $16$ actually comes into picture which will make it to represent as g(0)
So, draw table as mentioned above.
Now, write $g$ as a function of $f$. Simply how we do minimisation. See the min terms.
Be careful only in one thing here.
Example for 2 gray code representation is 0011 meaning 3 in decimal.So, if we select this row as a min term(just an Example) then we have selected 3 and not 2, means row numbers are not representing min terms. Rest everything is fine!

by Active (3.6k points)
edited
+2
how are you doing matching ...?? whats the exact meaning of g(h1h2h3h4) ??
+1
Yeah explain pls how are you doing matching with respect to g(h3h2h1h0) ?
+3

I got this solution in gatementor. But Dont know how the matching happens ?

+6
@prasanna, h3h2h1h0 is taken as an 4-bit input and g3g2g1g0 is taken as 4-bit output. so, output from g2 will be the sum of the minterms where it is high.
0
Thank you
+2
+1
i have added some more explanation...now it should be clear fr everyone!!
0
@sudhso

not getting thiz

now write g as a function of f ? what does it signify ?not getting any sense .
+2
see for g0 , g1 ,g2 ,g3 are separate functions of h(x) in themselves..its like the same thing designing one flip flop from other kind
if we need to find g0 see where it is 1 for h(x)
like it is one at row no 0,1,4,5,8,9,12,13..these are row nos not min terms...so for those rows find out the min terms and represent...like see row 0..min term there is 0...see row 1 min term is 1...now see row 4 min term is 0110 means 6 and so on...do this for all and then match with options.
0

g0(h3h2h1h0) what is meant tell that ?

g0 is lsb of G(x) ?

and h3 h2 h1 h0 are position of four digits?

if it than we take g0 of which means there are 15 g0 at respective column and how do match ?

0
to find g0 see what are its min terms inform of (h3 h2 h1 h0)
same thing do fr all
0

@bikram sir

We need to map min terms of g3g2g1g0 w.r.t h3h2h1h0

what does it mean?...plz elaborate this procedure .

0
I think 14 is missing in C option ?
0

But gray code id non-weighted ..so

(0011) In gray means (0010) in binary and hence 2 in decimal.

how it is 3 ..

0

@jatin khachane 1 check the mapping given in the question don't do conversion here.

Step 1: 4 bits hence 16 combinations. Write down all 16 combinations of gray code for each of binary (0-15)

Step 2 : it says a gray code combination of a binary number n will map to gray code of binary number n+1. Check value for each code is mapped to value below it.

Continuing to your answer. gray code of 2(0010) will be (0011) and now this (0011) will be mapped to gray code of 3 which is 0010.

0

I'm getting g2(h3h2h1h0)=∑(2,4,5,6,7,12,14,15)

But in the options it is g2(h3h2h1h0)=∑(2,4,5,6,7,12,13,15)

Anyone on the same boat with me?

0
bro it's not saying (h+1)(modulo 16) it's saying (n+1)(modulo 16). you might be considering h at last.

For each gi, we need to find the 4-bit sequences whose next code gives a 1 for bit position i. So, based on the Gray code sequence (in below link) we get (C) as true. (Just convert the Gray code to decimal, and we get the minterm).

http://electrical4u.com/gray-code-binary-to-gray-code-and-that-to-binary-conversion/

by Veteran (431k points)
0
Can u jus elaborate wat does g(h1h2h3h4) mean l??
0
not getting the answer . How to map ? (Else conversion other thing are clear )
+1
g2(h3h2h1h0) means the values of h3h2h1h0 where g2 is 1. ($\sum$ means the sum of combinations in truth table where the output is 1)
0
little more describe buddy i think i will get it.
+6
Think of how you get the canonical sum of products ∑ form from the truth table. It's the rows in truth table for which the output is 1, we consider them as 'minterms' and write something like ABC + A'BC + A'B'C' and so on as SOP.
So, in this question they are asking ..does function for g1 taking in the input variables h0,h1,h2,h3 has the following minterms?
They have given decimal equivalents of the minterm. So, in the table check where g1 is 1 and the decimal equivalent of gray code h3h2h1h0 is the minterm.
Do this for all g0,g1,g2,g3 and match with options.
0

atlast got it..tie buddy .

god fill ur account with black money . tie lot.

now come on following question

https://gateoverflow.in/1056/gate2004-61

+1

g2(h3h2h1h0)

1) see the value of 1  corresponding g2 in all 0 to 15 number

2) write value in decimal for given h3h2h1h0 in the form of minterms

by Active (2.4k points)
0
Can you please explain g2 is not 1 at 0010 why is that included in the min term?

Rest everywhere g2 is 1.

g0 (h3h2h1h0) = ∑ (1,2,3,6,10,13,14,15)

These 1,2,3,6,10... numbers are not in decimal. They're in Gray Code.

Minterms of g2 would be: 3,4,5,6,7,8,9,10.

In Gray code, it'll be: 2,4,5,6,7,12,13,15 (not respectively)

Hence, Option C.

by Loyal (6.3k points)