Reputation: 11044
As of now we are using 32 bits and 64 bits types of CPU. I know the concept of these architectures. But why it is designed as 16,32 or 64 respectively. Why can't we design the architecture like 10,20,30 or any other multiples of numbers. What is the problem we will face if we design like this ?
Upvotes: 0
Views: 97
Reputation: 44066
This has little to do with powers of two.
It is mostly a historical artefact.
We have/had architecture with 36-bit, 24-bit for example.
Wikipedia has a whole table with architectures and their word size.
The use of quantities like 16, 32 and 64 in mainstream processors comes from the fact that they are multiple of 8 more than powers of two.
8-bit is one of the adopted sizes for the byte, and the byte is usually the smallest quantity large enough to hold a character and that must be handled efficiently by the processor.
Quantities like 18, 24, 36-bit arise because in the middle of the 20th-century computers used 6 bits per character and to spare some wire the designers used fewer but wider registers.
Each register was as wide as a multiple of the character size, this is still true today where the character size is 8-bit (due to the diffusion, at the time, of the EBCDIC from IBM).
The trend to double the register size (that produces powers of two if you start with a power of two) is due to the advancements in the integration process, allowing denser chips.
It has the advantage that the largest quantity (say 64) is always an integral multiple of every smallest quantity (e.g. 64 = 2*32 = 4*16 = 8*8).
This turns out to be particularly good when it comes to parallel/vector processing.
For example, a 128-bit register can be seen as holding 16 bytes or 4 32-bit single precision floats, if the register size was 120-bit then it would still hold an integral number of bytes (15) but only 3 FP with a waste of 24 bits.
If IBM had stuck with 6-bit bytes, today we would have 6, 12, 24, 48-bits architectures.
Powers of two are very handy in CS, but in this case, they are just a side effect.
Upvotes: 2