How do you pad zeros to a discrete element-based input?

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?

 채택된 답변

Kiran Kintali
Kiran Kintali 2017년 9월 8일
편집: Kiran Kintali 2017년 9월 8일
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

추가 답변 (1개)

Bharath Venkataraman
Bharath Venkataraman 2017년 9월 4일

0 개 추천

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.

댓글 수: 1

Can you provide a more tangible explanation for method 1? It is possible to force the input data as a frame, but in order to use the data for HDL code, it needs to be unbuffered, rather than simply converted to the sample mode, right?

댓글을 달려면 로그인하십시오.

카테고리

제품

질문:

2017년 9월 4일

편집:

2017년 9월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by