Why it occur overflow??

I modeled simulink for hdl coder conversion and i used a fixed point tool box. But it occur overflow like a below figure. You can see the below figure, fixed point tool has simulation result from 0 minimum to 32.958984375 maximum value. But i applyed data fixdt(0,16,9). It can cover sufficient range from 0 to 32.958984375. But it occured overflow when i run for pressing button of 'simulate with embedded types'. So i applied it on a trial about range fixdt(0,20,10) (I thinked that it very sufficient range). However, it more increased overflow. why it occur overflow??

Respuestas (1)

Kiran Kintali
Kiran Kintali el 10 de Jul. de 2020

1 voto

The overflow behavior is based on what kinds of operations are happening on the variable. Is it in a feedback look like a for-loop where there error is accumulating and causing overflows etc., Please share your code (design and testbench) if possible for better guidance. It would hard to diagnose from just a screenshot.

3 comentarios

Ki Hyeon Jang
Ki Hyeon Jang el 10 de Jul. de 2020
Editada: Ki Hyeon Jang el 10 de Jul. de 2020
Always very thanks ~
This is my simulink code for hdl conversion. I just applied a data type of fixed point tool as a default word length 16 and proposed fraction length. And test bench data is using 'image from file' block. Because 'from multimedia file' is not supported fixed point. But i want a various input image for simulation range.
So i wonder another thing. That is 'is there method of various input image for simulation range?'
Kiran Kintali
Kiran Kintali el 10 de Jul. de 2020
Hi Ki, bmp file is missing; it will be hard to figure out ranges without a proper testbench. Thanks
Ki Hyeon Jang
Ki Hyeon Jang el 11 de Jul. de 2020
oh~ sorry. I upload a bmp file. Ok I agree your opinion. So i tried various things because i want to figure out range(i think that image should input 'all white', 'all black', and 'general image'), but i don't find proper method. you have any idea of testbench for extract various range??

Iniciar sesión para comentar.

Preguntada:

el 10 de Jul. de 2020

Comentada:

el 11 de Jul. de 2020

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by