为什么是24位寄存器?
在我的工作中,我处理不同的微控制器、微处理器和 DSP 处理器。其中许多都有 24 位寄存器和计数器。
我知道如何使用它们,这不是我的问题。
我的问题是为什么他们有 24 位寄存器!为什么不把它做成32位的呢? 据我所知,这不是大小的问题,因为寄存器已经是32位,但最大为0xFFFFFF。
这是否可以更轻松地实现硬件?计算速度更快? 或者只是“嗯,让我们放置 24 位寄存器,让程序员的工作变得更加困难”?
In my work I deal with different micro-controllers, micro-processors and DSP processors. Many of them have 24-bits registers and counters.
I know how to use them, this is not my question.
My question is why do they have 24-bits register! why not make it 32 bit?
and as I know, it is not a problem of size, because the registers are already 32bits, but have maximum of 0xFFFFFF.
Do this provide easier HW implementation? Faster calculations?
Or it is just "hmmm, lets put 24-bits registers to make the job of programmers more hard"?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我的猜测是,大多数 DSP 应用根本不需要 32 位。数字音频最多使用 24 位保真度。实施 32 位需要更多晶体管,因此会导致更高的成本。
为什么 32 位对程序员来说更容易?
另外,您声明寄存器的最大值为 0xFFFFFF,这使得它们根据定义为 24 位,而不是您建议的 32 位。
My guess is that most DSP applications simply don't need 32-bits. Digital audio uses 24-bits fidelity the most. Implementing 32-bits would require more transistors thus would result in higher costs.
Why would 32 bits be easier for the programmer?
Also, you state that the registers have a maximum of 0xFFFFFF, which makes them 24-bits by definition, not 32-bits as you suggest.
8/16/32/64 位没有特殊原因。有 24 位 DSP、18 位 PIC、36 位 PDP……每一位都需要时间、金钱和电力,因此拥有足够的位就足够了。没必要做得太过分。看看最初的 PC,有 20 条地址线,尽管内存指针可以达到 32 位。
There is no particular reason for 8/16/32/64 bits. There are 24 bit DSPs, 18 bit PICs, 36 bit PDP... Each bit costs time, money and power so having enough bits is good enough. No need to over do it. Just look at the original PCs with 20 adress lines, even though the memory pointers could be up to 32 bits.
根据 Tomas 的回答,一些 DSP 具有寄存器模式,其中溢出将值锁定在最高状态。如果数据是 24 位并且翻转到第 25 位,则它应该锁定在那里,而不是在 32 位翻转时锁定。
Tagging onto Tomas' answer, some DSPs have a register mode where overflowing locks the value at the highest state. If the data is 24-bit and it rolls over to the 25th bit, it should lock there, not at the 32-bit rollover.
对于音频,您通常需要 16 位输出。由于在处理过程中会损失一些精度,因此它们会选择一个比 16 位稍大的合理大小,而 16 位恰好是 24 位。
不采用完整 32 位的原因是,这将需要更多的硬件,尤其是乘法。
For audio you would typically want 16 bit output. Since you lose some precision during processing they pick a reasonable size that is somewhat bigger than 16 bit, which happens to be 24 bit.
The reason not to go to full 32 bits is that that would need substantially more hardware, especially for multiplication.