How do you pad zeros to a discrete element-based input?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Daniel Yang
le 4 Sep 2017
Modifié(e) : Kiran Kintali
le 8 Sep 2017
Hello, For my Simulink code, I am attempting to pad my input data with zeroes. The format should be as follows:
0000000data0000000data...
However, the data is not taken in by frame, and I cannot convert it since I want to use HDL generation. How is this achieved?
0 commentaires
Réponse acceptée
Kiran Kintali
le 8 Sep 2017
Modifié(e) : Kiran Kintali
le 8 Sep 2017
you may want to try using bitconcat function supported by HDLCoder.
z = fi(0, 0,7,0); % create 7-bit zero word
y = bitconcat(z,u,z) % u in the input word in fixed-point format
0 commentaires
Plus de réponses (1)
Bharath Venkataraman
le 4 Sep 2017
If your input data is a frame, you can pad zeros and then use the To Sample block for the HDL input.
If you are dealing with samples, I suggest using a counter block followed by a switch block. When the counter is < specified length, pass in zeroes, otherwise send in the data.
Voir également
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!