필터 지우기
필터 지우기

HDL implementation for bit to integer conversion block

조회 수: 3 (최근 30일)
Mohamed-Helmi
Mohamed-Helmi 2012년 11월 7일
답변: Dr. ghada farouk 2023년 7월 4일
I had to use a design where an fsm treats a vector of bits and as an output of the fsm i had to convert it into an integer to be used in the DUT. I had found the bit to integer conversion block under the communication block set, but this block is not supported by the hdl coder. Is there any equivalent block or a trick getting the vector of bits reinterpreted as an other datatype (ufix).
Thanks.

채택된 답변

Kiran Kintali
Kiran Kintali 2012년 11월 7일
Hi Mohamed,
MATLAB function block can help develop customer routines like these very easily.
check out the library of helper examples that show how to convert int2bits, bytes2tupe, swappingnibbles using Simulink and MATLAB function block
>> eml_hdl_design_patterns (under Word Twiddlers subsystem)
the example model links in the subsystem should generate HDL.
HTH,
Thanks.
  댓글 수: 1
Mohamed-Helmi
Mohamed-Helmi 2012년 11월 12일
Thank you Kiran for the answer.
Initially I was only using the hdllib command which produce the library of compliant blocks with hdlcoder, and I found it a litlle restrictive.
It's interesting to have these patterns coded in matlab and being familiarized with generation directly from matlab code.
Meanwhile I have another question concerning the use of such code into a chart intended for hdl generation. Does it work? Or should we just use these embedded matlab blocks into the chart design?
Thanks again.

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

추가 답변 (1개)

Dr. ghada farouk
Dr. ghada farouk 2023년 7월 4일
My advice to you while using hdl coder, first, keep using the type fi. This type is fixed point signed/unsigned numbers integer/fraction numbers. Second, use the bitsliceget function in which you can select one bit or range of bits.

카테고리

Help CenterFile Exchange에서 Code Generation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by