Binary to Gray Code Conversion
Gray code enables safe clock domain crossing in asynchronous FIFOs by ensuring only one bit changes state during any transition. Standard binary counters cannot be used across clock domains because multiple bits flipping simultaneously can cause unpredictable sampling errors due to routing delays.
A 4-bit binary input B[3:0] is converted to a 4-bit Gray code output G[3:0]. The most significant bit B[3] connects directly to G[3]. Each subsequent Gray code bit is generated using a two-input XOR gate.
Determine the Boolean expressions for each output bit and trace the conversion for specific binary values.
Constraints
- The most significant bit (MSB) is index 3.
- All Boolean expressions must use the
^operator for XOR without extra spaces. - Binary and Gray code values must be written as 4-bit strings (e.g.,
0101).
Topics
Solve this problem
Place the gates, wire them up and watch the signals settle. Every submission runs on the same simulation engine that grades it.
This problem is part of Codiode Pro. The statement above is free to read.
The circuit builder and code editor need a desktop screen. On a phone, read the problem here and open it on a laptop to solve.