필터 지우기
필터 지우기

How to use Bit Set block in Simulink?

조회 수: 26 (최근 30일)
Ahmad
Ahmad 2012년 7월 23일
How do I use multiple "Bit Set" blocks in simulink to set bits of the same integer individually? For example, if I have a set of conditions and one integer (say x). Each condition if satisfied will set a certain bit of x on. For instance, if condition 1 is satisfied (bit 0 will be set) x will take the value 1. If conditions 1 AND 2 are satisfied (bits 0 and 1 are on) x will take the value 3, and so on.
  댓글 수: 1
C.J. Harris
C.J. Harris 2012년 7월 24일
Why don't you just use a bitwise OR on the output from the two 'Bit Set' blocks?

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

답변 (1개)

Ryan G
Ryan G 2012년 7월 24일
See this demo image for a rough example of how you can convert each binary digit independently based on a conditional operator.

카테고리

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

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by