Home computickets Machine word, What is its size?

Machine word, What is its size?




is the concept of “machine word”, I read about it, but everywhere they write in different ways, as far as I understand one machine word is 2 bytes, and the 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 a 32-bit processor, it can take and process and process 32 bit information from RAM, and this 4 byte means it must have one word 4 bytes, but a 64-bit 2 times more and its Will the word will be more?

Answer 1, Authority 100%

I think the whole confusion arose due to the fact that when the developers of Intel (I think) called two bytes – in Word (Word) – then 16 bit processors were a breakthrough. Accordingly, 4 bytes – double words. (DWORD, DOUBLE WORD). It has been preserved in many programming languages ​​(including C / C++). Why two bytes are the word? Yes, apparently, the byte is like a letter. And two letters are already the word. (Although philologists will be resorted and say that it is most likely a syllable than the word). Wikipedia has a good phrase “* for 32-bit X86 processors: 16 bits are considered historically machine word, real – 32 bits.”

But the phrase “double machine word” I never heard. Even Google finds little articles with such a combination. But the “double word” or “machine word” is normal.

That is, as I understand it if a 32-bit processor, it can take and process with RAM 32 bits of information

Not everything is so simple. It is far from the fact that it can even take 32 bits. Modern processors are complex, have a cache. Have complex commands that are at a time (not so, namely) can handle up to 16 memory bytes (all sorts of MMX and SSE).

Usually, a machine word is called “CPU bit”, since the bit is usually indicated by the optimal size of the data inside the processor (registers of a 32bit processor 32 bit and with 32bit data, mostly all commands and work). In Some processors The word was 60 bits 🙂

In any case, I recommend always pepper in context. If about “Word” says a C / C++ programmer – this is 16 bits, if a programmer on an assembler under 32 bit ARM processors – then most likely the word is 32 bits.

Answer 2, Authority 56%

By definition, the size of the machine word is equal to the category of processor registers and / or bit data bus. Those. For processors that support the X64 command system is 8 bytes.

But in Windows API, for example, type Word is used everywhere as synonym 2 bytes. I think it went from 16-bit versions of Windows – after the appearance of 32-bit versions, Microsoft was more profitable to use the wrong name than to use the correct and get large compilation problems under Windows.

in general, do not bother hard and look at the context 🙂

Previous articlesql script cycle
Next articleHow to delay JavaScript?

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions