字,是处理器架构层面的一个概念:
In computing, a word is the natural unit of data used by a particular processor design. The number of bits in a word (the word size, word width, or word length) is an important characteristic of any specific processor design or computer architecture.
字是处理器处理数据的一个基本单元
字影响什么?
-
the majority of the registers in a processor are usually word sized
-
the largest piece of data that can be transferred to and from the working memory in a single operation is a word in many (not all) architectures.
-
The largest possible address size, used to designate a location in memory, is typically a hardware word (here, "hardware word" means the full-sized natural word of the processor, as opposed to any other definition used). Thus,the max word size of a 32-bit CPU is 32bits, and the same as a 64-bit CPU
如何确定字长:
considerations of economy in processor architecture design strongly push for one word size, or a very few sizes related by multiples or fractions (submultiples) to a primary size. That preferred size becomes the word size of the architecture.
Character size was in the past (pre-variable-sized character encoding) one of the influences on unit of address resolution and the choice of word size. 处理器希望一次能够读取完整的一个character,因此character的长度经常作为CPU字长
Or in another aspect, the smallest memory unit that can be designated by an address, has often been chosen to be the word
一个内存地址可以指定的最小单位,经常被选为字,通常就是8-bit
历史小tip:
在之前,具有固定字长(fixed word size)的计算机的文档通常以字而不是字节来表示内存大小。通常使用诸如千字 (KW) 表示 1024 word和兆字 (MW) 表示 1,048,576 个word,以前的计算机叫做word-addressable machine,基于字进行寻址。随着 8 位字节和基于字节的寻址能力的标准化,以字节、千字节和兆字节表示内存大小已成为常态
一般来说,处理器的字长需要兼容之前的处理器,如果多个处理器(如一个处理器系列)共享一个共同的架构和指令集,它们的字长应当相同。但更新式的处理器,可以支持double word、quarter word,从而支持更丰富的指令、更少次数的数据读取等
网友评论