Verilog practice / Problem 18
Gray code back to binary
Convert the 4-bit Gray code g back to binary b. The top bit stays the same. Each lower binary bit is the XOR of the Gray bit at that position and the binary bit just above it.
Ports
| Name | Direction | Bits |
|---|---|---|
g | input | 4 |
b | output | 4 |
How it's checked
The test tries the input combinations and checks every output for each one.
Stuck? Read the lesson Gray code pointers.
gray2bin.vCtrl + Enter runs