Forum Discussion
Altera_Forum
Honored Contributor
14 years agoThe LUTs are signed 2's complement. If your DAC device that reads these LUTs isn't signed 2's complement then you need to match the number system. Possibly your DAC might be offset binary which is different from 2's complement as follows:
binary 2'sc offset sign&mag unsigned
0000 0 -8 0 0
0001 +1 -7 +1 1
0010 +2 -6 +2 2
0011 +3 -5 +3 3
0100 +4 -4 +4 4
0101 +5 -3 +5 5
0110 +6 -2 +6 6
0111 +7 -1 +7 7
1000 -8 0 0 8
1001 -7 +1 -1 9
1010 -6 +2 -2 10
1011 -5 +3 -3 11
1100 -4 +4 -4 12
1101 -3 +5 -5 13
1110 -2 +6 -6 14
1111 -1 +7 -7 15
The sign and magnitude is not much in use as it makes signed multiplication weird relative to 2sc which makes it similar to unsigned. offset is favoured by some DAC/ADC vendors as it makes their design easier since there is natural binary transitio of negative numbers just like positive numbers. The designer needs just to invert the sign bit to convert between offst and 2sc. notice it is the interpretation of binary strings that differs e.g. when DAC looks at 1011 string then it uses it to mean -5 if it uses 2'sc or +3 if it uses offset or -3 if it uses s&m or 11 if it uses unsigned. Hence given binary string 1011 in offset system (+3) then it should map to +3 of 2'sc list i.e. 0011 thus just needs sign bit inversion.