HDMI Error - tmds_encoder.luc bug?


I am working through the HDMI shield demo and I’ve followed the instructions. However, I receive an error with the included tmds_encoder.luc file.

data9[i] = xor_flag ? data9[i-1] ~^ din.q[i] : data9[i-1] ^ din.q[i];

This code causes the following error:

I was able to get it working by making an editable copy of the file and switching the ~ and ^ operators on the true branch of the ternary operator like so:

data9[i] = xor_flag ? data9[i-1] ^ ~ din.q[i] : data9[i-1] ^ din.q[i];

Since I really don’t know what a tmds encoder is actually supposed to do, the only way I’ve been able to debug my change is to place the design on my mojo and plug it into my monitor. It seems to be working, but I want to make sure I fixed the bug correctly and didn’t introduce a bigger problem.

Thanks for your time.

Hey Michael,

Thanks for the catch. The ~^ as a single operator was removed since it doesn’t really add anything. Instead it should be

data9[i] = xor_flag ? ~(data9[i-1] ^ din.q[i]) : data9[i-1] ^ din.q[i];

Your change is also correct as inverting either input to an XOR inverts the output.