PLC中数学函数中的进位是什么?
“Carrey”在数学教学中起什么作用?
举个例子:两个二进制文件相加,除了结果值之外,还会产生额外的东西,称为CY。那么,1+2=3+一些进位?
文档只是简单地说:“如果加法导致进位,则进位标志将变为 O”,但没有解释什么是进位以及什么是进位标志。它们是什么?如果我在有或没有进位的情况下执行加法指令,有什么区别?
What does "Carrey" do in a Math instruction?
Take the following as an example: summation of two binaries give birth to something extra call CY besides the result value. So, 1+ 2 = 3 + some Carry?
The documentation simply says: "If the addition results in a carry, the Carry Flag will turn O" given no explanation of what is a carry, and what is a Carry Flag. What are they and what are the difference if I perform an addition instruction with or without a Carry?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
进位是表示加法的完整结果所需的额外位。
例如,如果您将两个 16 位值相加,则结果需要为 17 位才能表示每种可能的结果。
当对大于寄存器大小的值进行链式加法时,也会使用进位标志。如果您有 32 位值并且只能进行 16 位加法,则首先将值的下半部分相加,然后将带有第一次加法进位的高半部分相加:
下半部分将作为无符号值添加,而较高的半部分将作为无符号值添加一半将通过使用进位标志的指令作为有符号或无符号值相加。
Carry is the extra bit that is needed to represent the full result of the addition.
If you for example add two 16 bit values, the result needs to be 17 bits to represent every possible outcome.
The carry flag is also used when you chain additions of values larger than the register size. If you have 32 bit values and you can only do 16 bit additions, you add the lower halves of the values first, then the higher halves with the carry from the first addition:
The lower halves would be added as unsigned values, and the higher halves would be added as signed or unsigned values with an instruction that uses the carry flag.