DNA2683
Advanced Member level 4
- Joined
- Sep 3, 2012
- Messages
- 106
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,296
- Activity points
- 2,290
My bad, I thought it could be directly copied.
can you explain me something that i don't understand:
if i get 2 numbers that can be positive or negative (not a integer->number 16 bit fraction 16 bit fixed point- i dont know if the input is positive or negative )for example:
situation 1:
Q_in=266.7244=> 010AB972(hex)
W_in=0.7071 =>B505(hex)
out= Q_in+W_in=010B6E77(hex) =>17526391(dec) /2^16 = 267.4315 (thats a correct answer)
situation 2:
Q_in=266.7244=> 010AB972(hex)
W_in=(-0.7071) =>4AFC(hex)
out= Q_in+W_in=010B046E(hex) =>17499246(dec) /2^16 = 267.0173 (thats a correct answer)
now the problem begin :-? :
situation 3:
Q_in=(-266.7244)=> FEF5468E(hex)
W_in=0.7071 =>B505(hex)
out= Q_in+W_in=FEF5FB93(hex) =>4277533587(dec) /2^16 = 65269.9287 (thats a wrong answer....i suppose to get (-266.0173) )
situation 4:
Q_in=(-266.7244)=> FEF5468E(hex)
W_in=(-0.7071) =>4AFC(hex)
out= Q_in+W_in=FEF5DC86(hex) =>4277525638(dec) /2^16 = 65269.8614 (thats a wrong answer....i suppose to get (-267.4315) )
what i'm doing wrong it the calculation?
thanks