precision errors. microblaze vs matlab single precision... huh?

Hi all embedded gurus out there, I am working on an embedded platform using microblaze. I am trying to implement an algo, which does a inverse matrix function on the microblaze (via C) and then port the results back to matlab. so this is the scenario.

1) matlab generates some numbers, passes them to microblaze via the UART (ie. PC to UART) 2) microblaze will then generate the matrix, and then calculate its inverse and do other stuff (dot product of matrices etc etc). 3) microblaze will then send the result back to PC via UART.

Ok..so here's the problem. the result obtained differs from matlab's result (I coded the same implementation also in matlab). the result obtained varies up to an error of 1 decimal place!!!

How I tried to debug

1) step through the C code using the debugger for microblaze. (this is very cool tool). 2) at each step of the way, look at how the variables change for each operation in the C code running on microblaze...and also observe how the variables change in matlab

this is what I noticed thinking it was due to matlab processing it in double precision, i type cast the whole matlab routine in single precision. then I tried to verify it again in the same way. And I get the same problem :(

can anyone help? As a result of this precision errors, the whole algo fails to work. I am really not sure which one to trust now.

Would appreciate if anyone can help me on the same. The current microblaze platform is using hardware FPU.

Chris

Reply to
chriskoh
Loading thread data ...

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.