norm() block in Simulink HDL coder
显示 更早的评论
Hi, Does anyone know if there is a norm() block in HDL coder. I want to find the norm() of dt = norm(min(diff(t))); and I cant seem to find a Simulink HDL coder compatible block for this and not sure if I write a user defined function block for it whether norm() is supported, doesn't look like it from the documentation unless I'm missing something. I suppose one can probably code up the Euclidian distance formula, but I would have thought there is already something as simple as this in place. Thanks in advance.
回答(1 个)
Tim McBrayer
2016-7-20
0 个投票
The short answer is no, HDL Coder does not support norm().
From the hardware perspective, the norm() function is a complicated function. It can involve taking a reciprocal, exponentiation, and absolute value, all on matrix values that could be real or complex numbers. Each of these operations involves tradeoffs (typically speed vs. area tradeoffs) when designing hardware to implement the function. HDL Coder customers typically will want control over the implementation of each of these sub-algorithms, so these sort of complicated algorithmic functions are not directly supported.
It appears straightforward to implement norm() in MATLAB code or in Simulink using basic blocks. This will give the designer full control over the hardware implementation of the algorithm.
类别
在 帮助中心 和 File Exchange 中查找有关 Speed Optimization 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!