math - 执行以下 1 的补码定点整数算术运算

这个问题来 self 的数字逻辑课,但我不明白。请帮助我理解它在问我什么。

假设 A1 和 A2 是八进制简写。

Perform the following 1's complement fixed-point integer arithmetic operations and note whether magnitude overflow has occurred in each case: (Hint: Use 7's complement arithmetic on the other octal shorthand),

i) A3= A1+A2
ii) A3= A1-A2

我以为你只在想做减法时取补码。我不能只做八进制形式的减法吗?有人可以帮助我理解所问的问题吗?

最佳答案

这是一个技巧问题;或者你错误地引用了它。我怀疑你的导师会问前者;所以一定是后者。

回想一下,1 的补码和是两个操作数(这里是 A1 和 A2)的异或。并且没有进位,因此在 1 补码世界中没有大小溢出这样的事情。

https://stackoverflow.com/questions/9145324/

相关文章:

emacs - 在 emacs(或 DDD)中使用 gdb 时无法设置断点

maven - 使用 build-helper-maven-plugin 和 multi modul

encryption - Microsoft CNG BCryptEncrypt 返回密文 == 明

python - 如何使用 setuptools 和 setup.py 从包中排除单个文件

asp.net - 签署网络表格 - 数字签名选项

oracle - 创建实体化 View 比创建表慢得多

vb.net - 创建后如何释放 MS Access LDB 锁定文件

image-processing - 使用小波和曲波进行特征提取

ruby-on-rails - 使用设计在 Rails 3.1 和 2.3.12 之间共享 sess

google-maps - 在 Google Maps Static 上呈现比例尺