Double to fixpoint conversion of Sum and Discrete transfer function block

조회 수: 1 (최근 30일)
Safiya
Safiya 2015년 6월 13일
댓글: Safiya 2015년 6월 17일
Hi, this model works fine with data types shown
for summer (input1 : ufix6_En7, input2: ufixe6_En6, output : double) and
Discrete TF.. (output: double)
but when i change the sum block output to any fix point it does not give the correct results. what should be the correct method So that I can convert all these to fixed point so that HDL code can be generated.
- Do we need to insert ZOH block prior to conversion , or some fix point tool will insert where necessary.
- what should be the fix point settings for Discrete TF block
- what does the wire color shows,,, when I update diagram it turns to red
- for above both blocks ,, how to set the Accumulator/ ouput data type settings..
Thank you

답변 (1개)

Andrew Schenk
Andrew Schenk 2015년 6월 15일
It is best practice to insert a ZOH block after the input port to the model as it will convert an input signal with continuous sample time to an output signal with a discrete sample time.
The reason you are getting incorrect results is likely because the fixed point data type has not been selected correctly for your specific signal data range. If you use the Simulink Menu Bar -> Analysis -> Fixed Point Tool utility, this will simulate your model, derive signal ranges, and automatically propose data types that prevent over/underflow errors while maximizing resolution.
Finally, the blocks are colored red to indicate the particular sample time. This can be changed by clicking: Display -> Sample Time -> Off. Also, click Display -> Sample Time -> Display Sample Time Legend will pop-up a window describing the meaning of each color.
  댓글 수: 1
Safiya
Safiya 2015년 6월 17일
Thank you for your reply. one more thing whether ZOH block should be included in HDL code generation subsystem or it could be outside the subsystem. what is difference if code is generated with or without ZOH block. does it be synthesizable to cadence layout etc.. if code is generated including ZOH. thanks

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 HDL Coder에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by