can you tell me what is the use of Pack Data IP --> Pack vector and how is it working?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Piyush
am 20 Jun. 2023
Beantwortet: Bharath Venkataraman
am 20 Jun. 2023
FOllwing is the Matlab Function code under Pack Vector, I want to understand it and what acctually it is doing?
function y = pack_vector(u)
%#codegen
assert(isreal(u),'Expected input to be real');
N = coder.const(numel(u));
temp = coder.nullcopy((cast_to_fi(zeros([N 1],'like',u))));
% Interleave real/imag
coder.unroll();
for ii=N:-1:1
temp(N-ii+1) = u(ii);
end
y = bitconcat(temp);
0 Kommentare
Akzeptierte Antwort
Bharath Venkataraman
am 20 Jun. 2023
I believe this code uses bitconcat to concatenate all the elements of the vector into a single unsigned value.
u(1) becomes the MSB, while u(4) is the LSB (this is as a result of how the for loop index is used toa ccess the values of u into temp).
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu FPGA, ASIC, and SoC Development finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!