R2020b Embedded Coder uses De Morgan's laws for NAND and NOR blocks

조회 수: 7 (최근 30일)
I noticed R2020b Embedded Coder uses De Morgan's laws when generating C-code for NAND and NOR Logical Operator blocks.
Is there an option please to switch the new behavior off?
Example of older Matlabs C-code: NAND = !(In1 && In2); NOR = !(In3 || In4);
Example of R2020b EC C-code: NAND = ((!In1) || (!In2)); NOR = ((!In3) && (!In4));

채택된 답변

Shubham Rawat
Shubham Rawat 2021년 2월 6일
Hi Martin,
In my information we cannot change this behaviour to old version.
Even if we use basic AND and OR gates and create that logic with your own. It is showing the same results, i.e. after applying De Morgans laws.
So you may change your working according to it, OR you may use older versions of Simulink.
Hope this Helps!
  댓글 수: 1
Martin Hlavacek
Martin Hlavacek 2021년 2월 8일
Thank you for you answer. What is please the reason for such a strict application of De Morgans laws, is it done to comply with some standards, like MISRA?

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Deployment, Integration, and Supported Hardware에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by