Offset binary in Simulink HDL

조회 수: 1 (최근 30일)
Ho
Ho 2023년 8월 6일
답변: Kiran Kintali 2023년 8월 7일
i want to convert a 2's complement number to binary offset in simulink, how do i do the design? can anyone help me? Theoretically, I just need to take the inverse of the MSB to get the binary offset. However I don't know how to do it in simulink

답변 (1개)

Kiran Kintali
Kiran Kintali 2023년 8월 7일
a = fi(-pi, 1, 6, 0);
msb = getmsb(a);
c = bitcmp(msb);
You can write a MATLAB function block with getmsb and bitcmp functions.

카테고리

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