summaryrefslogtreecommitdiff
path: root/src/hal/components/bin2gray.comp
blob: 6c8b22474496553733b2e2e98ca30bee26b90499 (plain)
1
2
3
4
5
6
7
8
9
component bin2gray "convert a number to the gray-code representation";
description """Converts a number into gray-code""";
pin in unsigned in "binary code in";
pin out unsigned out "gray code out";
license "GPL";
author "andy pugh";
function _ nofp;
;;
out = (in >> 1) ^ in;