views:

144

answers:

4

Hi,

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"?

+6  A: 

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.

Tomas
I think you're probably right (though it'd be interesting to hear a definitive answer). Having a look on Wikipedia suggests 24-bits is a more natural size based on processing speed and/or relation to frequency of input signal which is sufficient for high-end audio sampling.
Paolo
Good point. I kind of forgot that it might also be interesting WHY digital audio uses 24-bits the most :)
Tomas
The manual says that it is a 32bit with the most 8 bits will always be zero..working with 32 bits is easier, because the general purpose registers is 32 bit. For example, when you read value from 24bit register into a variable. Operations done on this variable will happen in 32bit.This will imply extra code to handle overflows.
Yousf
A: 

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.

Robert
A: 

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.

e8johan
The 18 bit PIC (or 12, 14..) are simply because the memory (all on-die) is smaller that way (register size does not match). PDPs simply used multiples of 6 (the character size) and 3 (the digit size when using octal). Nowadays multiples of 8 are more common, which is exactly why 24 bits is convenient. Addresses on the 8086 were in fact 20 bit; but since that didn't fit in any register, they used segment registers - compare them to the page selection registers on PIC. 32-bit processors tend to have wide enough registers that such extensions of address space are not needed.
Yann Vernier
A: 

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.

starblue