Error while conversion from Matlab to VHDL

This is my Matlab Code
%#codegen
function y = neha(data)
Persistent hMod hDemod;
if isempty(hMOd)
hMod = comm.BPSKModulator;
hDemod = comm.BPSKDemodulator;
end
modSignal = step(hMod, data);
y = step(hDemod, modSignal);
end
This is my Test Bench
clear neha;
x=[1 0 1 0 1 0 1 1 0 0 1 ]
len=size(x)
y=zeros(1,len);
for ii=1:len
data =x(ii);
y(ii) = neha(data);
end
I have validate the code. But while conversion into VHDL I am getting this error
neha FixPt:15 - error - Single and Double Data Types are not supported in HDL conversion

3 件のコメント

Walter Roberson
Walter Roberson 2013 年 10 月 14 日
Are you trying to do logical indexing? You cannot index an array at 0 unless the 0 is logical(0) -- but if it was then neha(data) would be empty and you would be trying to assign the empty array to yy(ii)
Neha
Neha 2013 年 10 月 14 日
Sir, I am not indexing the array by 0. Its starting from 1 till length. As mentioned, the error is related to Single and Double Data Types. Pls. give your valuable suggestions.
Walter Roberson
Walter Roberson 2013 年 10 月 14 日
Ah I was getting function calls and indexing confused. In any case see the Answer I gave.

回答 (1 件)

Walter Roberson
Walter Roberson 2013 年 10 月 14 日

0 投票

x = uint8([1 0 1 0 1 0 1 1 0 0 1 ]);
and
y = zeros(1, len, class(x));

この質問は閉じられています。

質問済み:

2013 年 10 月 14 日

閉鎖済み:

2021 年 8 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by