Gray code, named after Frank Gray, a Bell Labs researcher who originally called it "reflected binary code", is used to help correct errors in digital communications. It was developed as a response to preventing desynchronized switching actions, requiring only one switch be flipped to increment or decrement a binary value represented by a hardware-based switch array.
The simplest method, without using a whole lot of CPU or brain power, is to create an array of Gray code values that correspond to their binary representation. For example, a 2-bit Gray code array would consist of the following values:
int gray2bit[]={0, 1, 3, 2};
A 3-bit Gray code array would be declared and initialized as follows:
int gray3bit[]={0, 1, 3, 2, 6, 7, 5, 4};
To find the Gray code for a particular value, simply reference that offset in the desired array:
int n=gray2bit[2]; /* results in 3 */
int m=gray3bit[6]; /* results in 5 */
See the related links for more information on Gray codes as well as sample source code that will assist you further.
write a c++ program to convert binary number to decimal number by using while statement
write a c program that takes a binary file as input and finds error check using different mechanisms.
This is not a question.
Write algorithms and draw a corresponding flow chart to convert a decimal number to binary equivalent?
To convert from binary to octal, bitwise AND the binary value with 0x8 (00000111 in binary) and push the value onto a stack. Right-shift (>>) the binary value by 3 bits and repeat until the binary value is zero. Pop the stack to build the left-to-right digits of the octal value. Using 10110100 as an example: 10110100 & 00000111 = 00000100 10110100 >> 3 = 00010110 00010110 & 00000111 = 00000110 00010110 >> 3 = 00000010 00000010 & 00000111 = 00000010 00000010 >> 3 = 00000000 Popping the values in order reveals 00000010, 00000110 and 00000100 (decimal 2, 6 and 4 respectively). Thus 10110100 binary is 0264 octal.
write a c++ program to convert binary number to decimal number by using while statement
write a c program that takes a binary file as input and finds error check using different mechanisms.
How is this a question? Sounds like you should do more of your homework offline.
networking
This is not a question.
In order to write a program to convert stack into queue using c language you must be able to identify the proper program. Having a special certification in programing will be beneficial as well to make sure you recognize the proper queues for the programs.
Write algorithms and draw a corresponding flow chart to convert a decimal number to binary equivalent?
Write a program to convert a 2-digit BCD number into hexadecimal
to implement operations on binary heap in c
You can use a table to convert binary to decimal & back:MSBBinary DigitLSB2827262524232221202561286432168421Figure out the greatest power that will fit into the number you want to convert to binary. Move to the next lower power of two. If you can fit into the next lower number write down a "1", if it can't put down "0". Put together the binary answer.
WRITE A PROGRAM TO CONVERT A 2-DIGIT bcd NUMBER INTO HEXADECIMAL
It can be implemented very easily .... Suppose the Binary word is X7X6X5.... X0 then the corresponding Gray code is G7G6G5....G0 where G7=X7 G6=X7 XOR X6 G5=X6 XOR X5 ..... G0=X1 XOR X0 Now implement the above algorithm