1 votes 1 votes PLS EXPLAIN how will gray code work over here? Gate Fever asked Sep 21, 2018 Gate Fever 932 views answer comment Share Follow See all 20 Comments See all 20 20 Comments reply Magma commented Sep 21, 2018 reply Follow Share it's simple brother X1 X-OR X2 = 01010101 apply gray code on : 01010101 and get = 01111111 = 127 I think you know how gray code work right ??? 0 votes 0 votes Gate Fever commented Sep 21, 2018 reply Follow Share @Magma In Gray code only one bit is changed at a time. How u changed 3 bit together? 0 votes 0 votes Shaik Masthan commented Sep 21, 2018 reply Follow Share @Gate Fever let x is a gray code, then x+1 is also gray code ∴ x and x+1 are exactly 1 bit differ. But Binary to Gray need not to be 1-bit differ @Magma How gray code (01111111)2 = (127)10 ? Gray code ---> Binary ----> Decimal right? 1 votes 1 votes Magma commented Sep 21, 2018 reply Follow Share hmmmm then what is the answer ??? 0 votes 0 votes Shaik Masthan commented Sep 21, 2018 reply Follow Share as per my knowledge, X1 X-OR X2 = 01010101 convert into Decimal. ( I know options are not matching. ) 1 votes 1 votes Magma commented Sep 21, 2018 reply Follow Share then options given here is wrong correct ans is 85 0 votes 0 votes sakharam commented Sep 22, 2018 reply Follow Share @Gate Fever Source of this question? 0 votes 0 votes Gate Fever commented Sep 22, 2018 reply Follow Share I am getting till here X1 xor X2 = 01010101 But I'm unable to solve it further,not getting the meaning:- let x is a gray code, then x+1 is also gray code ∴ x and x+1 are exactly 1 bit differ. But Binary to Gray need not to be 1-bit differ After xor I got 85 but how are u converting binary to gray and getting again answer 85 am not getting. @Shaik Masthan @Magma 0 votes 0 votes Shaik Masthan commented Sep 22, 2018 i edited by Shaik Masthan Sep 22, 2018 reply Follow Share Gray Codes:- 0 000 1 001 2 011 3 010 4 110 5 111 6 101 7 100 This codes are differ by 1 bit let take 110 in binary code , it's equivalent gray code is 101 (110)Binary = (101)Gray .====> This two codes need not to differ by 1 bit After xor I got 85 but how are u converting binary to gray and getting again answer 85 am not getting. covert 85 of Binary code in to Gray code, But you can't equate with decimal with Gray Therefore again convert into Binary 2 votes 2 votes Gate Fever commented Sep 22, 2018 reply Follow Share let take 110 in binary code , it's equivalent gray code is 101 okay i got this, but..... (101)Binary = (101)Gray .====> This two codes need not to differ by 1 bit but shouldn't this be (110)binary=(101)gray?? 0 votes 0 votes Gate Fever commented Sep 22, 2018 reply Follow Share covert 85 of Binary code in to Gray code, But you can't equate with decimal with Gray Therefore again convert into Binary i didnt even get this 0 votes 0 votes Shaik Masthan commented Sep 22, 2018 reply Follow Share @Gate Fever Gray Codes:- 0 000 1 001 2 011 3 010 4 110 5 111 6 101 7 100 Now i given (100)gray = (X)10. then what is X? how you find it by seeing gray code? (101)Binary = (101)Gray .====> This two codes need not to differ by 1 bit but shouldn't this be (110)binary=(101)gray?? yes, it's typing mistake, i will update it. 0 votes 0 votes Gate Fever commented Sep 24, 2018 reply Follow Share okay!pls chk this whether i am correct or not see 100 has equivalent gray code 110 right, now as per the ques, i have to convert gray code to decimal and since u are saying that we cant convert it directly so, i need to conert it into binary and then to decimal, i already have binary of 110 so i will directly take out its decimal notation right! now coming to question after XOR i got (01010101)2 then it will go the gay code part and then i need to take the decimal notation of it and since we cant take decimal notation from gray code , we will convert gray code representation to binary and then take decimal notation for it! so the answer is 85 only; (01010101)2 -------->(********)gray------>(01010101)2---------->(85)10 0 votes 0 votes Shaik Masthan commented Sep 24, 2018 reply Follow Share yes, that exactly what i want to convey ! 0 votes 0 votes Gate Fever commented Jan 8, 2019 reply Follow Share @Shaik Masthan sir i think 127 is correct answer, this is the property of gray that i've studied in my 3rd semester!! while taking gray code from a decimal number ; just copy the MSB as it is and then do XOR on 2 consecutive bits!! 1 votes 1 votes Shaik Masthan commented Jan 8, 2019 reply Follow Share https://www.edaboard.com/showthread.php?55468-How-to-convert-GrayCode-to-decimal http://www.toolmenow.com/76/Decimal-To-Gray-Code 0 votes 0 votes Gate Fever commented Jan 8, 2019 reply Follow Share http://www.toolmenow.com/76/Decimal-To-Gray-Code this is giving gray code of 85 as 127 that means 127 is correct answer! 0 votes 0 votes Shaik Masthan commented Jan 8, 2019 reply Follow Share i mean to say, don't say it in decimal ! it is 1111111 only 0 votes 0 votes Gate Fever commented Jan 8, 2019 reply Follow Share still it is 127; isnt it 0 votes 0 votes Shaik Masthan commented Jan 8, 2019 reply Follow Share it's upto you ! 0 votes 0 votes Please log in or register to add a comment.