有符号和无符号 16 位 BCD 之间的区别?

发布于 2024-10-02 07:51:40 字数 80 浏览 1 评论 0原文

你如何区分? 例如,假设您有 0110 0101 1001 0011。 无符号BCD码是6593,那么有符号值是多少呢?

How do you tell the difference?
For example, say you have 0110 0101 1001 0011.
The unsigned BCD is 6593, but what is the signed value?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

我是男神闪亮亮 2024-10-09 07:51:40

通常,您可以通过显式存储符号来区分。

基数补语 (en.wikipedia.org/wiki/Method_of_complements)

Usually, you tell the difference by explicitly storing the sign.

Radix complement (en.wikipedia.org/wiki/Method_of_complements)

笛声青案梦长安 2024-10-09 07:51:40

在正常的二进制系统中,带符号的数字使用MSB(最高有效位)来确定数字的符号,数字的其余部分是实际值。

与 Packed BCD 不同,4 个 LSb(最低有效位)代表符号,数字的其余部分(左边)代表实际值。

in normal binary system, signed numbers uses the MSB (most significant bit) to determine the sign of the number, the rest of the number is the actual value.

Unlike that in Packed BCD, the 4 LSb (least significant bits) represent the sign, and the rest (to the left) of the number represents the actual value.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文