フィルターのクリア

How to deal with math functions like tan,atan in matlab code while converting them to verilog using hdlcoder?

1 回表示 (過去 30 日間)
I need to convert matlab code to verilog. I tried using hdlcoder,but in my code I have math functions like tan,atan,log etc. which are causing errors during Hdl conversion.It says "The MATLAB design contains constructs that are unsupported for HDL code generation."
Also they are giving errors during fixed point conversion. I tried setting "Keep original types" but still the above error is coming.
Waiting for any help.
Thanks, Susmitha.

採用された回答

Walter Roberson
Walter Roberson 2016 年 7 月 5 日
  3 件のコメント
Susmitha  S
Susmitha S 2016 年 7 月 6 日
I am new to matlab.
The reference you gave me for cordic algorithm shows an example of sin , cosine functional blocks and I am able to run the particular code and generate Verilog code.
But I am clueless on how to create my own functional block and add it to the remaining matlab code. For example: If I need to implement a functional block for: a1*tan(b1*n); how should I proceed?
(a1, b1 , n are parameters I am passing to a function where the tan,atan functions are present) Please help.
Thanks, Susmitha

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

その他の回答 (1 件)

Tim McBrayer
Tim McBrayer 2016 年 7 月 5 日
An alternative approach is to use a lookup-table based function substitution. This works better for sin or cos than it does for tan, due to the limited range of the function input and output. Nonetheless, dependent upon your system requirements and input ranges to these functions you can get quite good results at your desired precision using lookup tables as well.

カテゴリ

Help Center および File ExchangeHDL Coder についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by