Machine word, what is its size?

There is a concept of "machine word", I read about it, but everywhere they write differently, as far as I understand one machine word is 2 bytes, and a double machine word is 4 bytes, but where does it come from, why 2 bytes and not one? That is, as I understand it, if the processor is 32-bit, it can receive and process 32 bits of information from RAM in one clock cycle, and this is 4 bytes, so it should have one word of 4 bytes, but a 64-bit one is 2 times larger and its word will be larger?

Author: Deleted, 2013-09-07

2 answers

I think all the confusion arose from the fact that when the Intel developers (I think so) called two bytes-a word (word) - then 16-bit processors were a breakthrough. Accordingly, 4 bytes is a double word. (DWORD, double word). This has been preserved in many programming languages (including c / c++). Why are two bytes a word? yes, apparently from the fact that a byte is like a letter. And two letters are already a word. (Although now philologists will resort and say that this is more likely a syllable than a word). wikipedia has a good phrase "* For 32-bit x86 processors: historically, the machine word is considered 16 bits, in reality-32 bits. "

But the phrase "double machine word" I have never heard. Even Google doesn't find many articles with this combination. But "double word" or "machine word" is normal.

That is, as I understand it, if the processor is 32-bit, it can receive and process 32 bits of information from RAM in one clock cycle

It's not that simple. Far from the fact that it can even accept 32 bits. Modern processors are complex, have a cache. They have complex commands that can process up to 16 bytes of memory (all sorts of mmx and sse) at a time (not just once).

Usually, the machine word is called "processor bit rate", since the bit rate usually shows the optimal size of data inside the processor (the registers of a 32-bit processor are 32-bit and with 32-bit data, basically all commands work). In some processors the word was 60 bits:)

In any case, I recommend always looking into the context. If the" word " is spoken by a programmer in C/C++ - this is 16 bits, if a programmer in assembly language for 32-bit ARM processors-then most likely the word is 32 bits.

 8
Author: KoVadim, 2013-09-07 12:53:55

By definition, the size of a machine word is equal to the bit depth of the processor registers and / or the bit depth of the data bus. That is, for processors that support the x64 instruction system, it is 8 bytes.

But in the Windows API, for example, the WORD type is commonly used as a synonym for 2 bytes. I think it came from the 16-bit versions of Windows - after the 32-bit versions, it was more profitable for Microsoft to use the wrong name than to use the right one and get big compatibility problems when compilations for Windows.

In general, do not bother much and look at the context :)

 5
Author: Михаил М, 2013-09-09 09:35:02