Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- component gray2bin "convert a gray-code input to binary";
- pin in unsigned in "gray code in";
- pin out unsigned out "gray code out";
- license "GPL";
- author "andy pugh";
- function _;
- ;;
- u32 mask;
- for(mask = in >> 1 ; mask != 0 ; mask = mask >> 1){
- out ^= mask;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement