Extract bits function not working as expected

조회 수: 3 (최근 30일)
randome
randome 2018년 9월 10일
답변: randome 2018년 9월 10일
I'm new to Simulink/Matlab. Currently trying to model a behavior of a ADC and having issues getting the extract bits function to work based on my expectations.
The output from the integer to bit converter is 2bits and I'm using 2 extract blocks to split them each to separate bits before performing more operations on them. However I realize that the top block [1 1] does not extract anything but instead both bits are extracted in the [0 0] block as shown in the results. I'm quite puzzled with this behaviour and hoping that someone could help me out.
  댓글 수: 2
Walter Roberson
Walter Roberson 2018년 9월 10일
Is it possible that the value is considered a signed integer? If so then the minimum number of bits to extract is 2.
randome
randome 2018년 9월 10일
Thanks for the quick help. Is there anything that I missed?

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

답변 (1개)

randome
randome 2018년 9월 10일
Somehow I made it work. I took out the int to bin converter and wired the bit extractors straight to the adder block (which outputs integer sums).
I'm not sure why this works now, perhaps some experts would be able to help.

카테고리

Help CenterFile Exchange에서 General Applications에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by