フィルターのクリア

HDL code generation of simple Discrete Transfer Function Block

5 ビュー (過去 30 日間)
Safiya
Safiya 2015 年 6 月 23 日
回答済み: Bharath Venkataraman 2015 年 6 月 25 日
Hi, when I use the TF block and generate the HDL code with double type input data and making all parameters of TF to default / inherited, it works fine.
On the other hand it gives the following error if we choose input data type to fixdt(1,16,0) etc. Error:
Error: "When input of Discrete Transfer Fcn block is floating point, all the internal data-type should be inherited to support HDL code generation. Change data-type setting of 'Discrete Transfer Fcn '"
input block Const : fixdt(1,16,0)
next block : Discrete Block with default settings
Thank You,

回答 (2 件)

Bharath Venkataraman
Bharath Venkataraman 2015 年 6 月 23 日
Is it possible to attach your model? With floating point inputs, the Inherit via Internal Rule setting is required, but it appears that you meet this requirement.
  1 件のコメント
Safiya
Safiya 2015 年 6 月 24 日
I have attached model here.
yes, settings are inherited. but as long as input is double it is ok, when the input const block output is changed to fixpoint it gives errors.

サインインしてコメントする。


Bharath Venkataraman
Bharath Venkataraman 2015 年 6 月 25 日
When you change the data to fixed-point, each of the settings on the Discrete Transfer Function block needs to be specified. I suggest figuring out what your coefficient and product settings are, and then the output data type. All the settings should be specified as fixdt(1,WL<FL), where WL is the number of total bits and FL is the number of fraction bits.
One other suggestion I have is not to specify data types a number of times in the ports and in the blocks. You can remove the data type conversions in the ports of the subsystem as well as immediately after inside the Subsystem Data type conversion blocks. Just keep one outside the Subsystem input ports.
With these changes, I was able to generate HDL code for both the floating and fixed point versions.

Community Treasure Hunt

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

Start Hunting!

Translated by