For faster navigation, this Iframe is preloading the Wikiwand page for 累加器.

累加器

中央處理器中,累加器 (accumulator) 是一種寄存器,用來儲存計算產生的中間結果。如果沒有像累加器這樣的寄存器,那麼在每次計算 (加法,乘法,移位等等) 後就必須要把結果寫回到 記憶體,也許马上就得讀回來。然而存取主存的速度是比從算术逻辑单元到有直接路徑的累加器存取更慢。

標準的例子就是把一列的數字加起來。一開始累加器設定為零,每個數字依序地被加到累加器中,當所有的數字都被加入後,結果才寫回到主存中。

現今的 CPU 通常有很多寄存器,所有或多數都可以被用來當作累加器。因為這個原因,"累加器" 這名詞就顯得有些老舊。這個名詞已經幾乎不在 微處理器 寄存器中使用,例如,運算寄存器的名稱中的符號以 "A" 開頭的表示是從 "accumulator" 這個歷史因素得來的 (有時候認為並非 "arithmetic")。也可能混淆的是寄存器的名字前置 "A" 也表示 "address",比如說像是 Motorola 68000 家族。

早期的 4 位、8 位微处理器,典型具有单个累加器。8051 微控制器有两个累加器:主累加器与从累加器,其中的从累加器只用于乘法(MUL AB)与除法(DIV AB)。乘法的 16 位结果放入两个 8 位累加器中。除法时,商放入主累加器,余数放入从累加器。8008 的直接后继产品——80808086,开创了 x86 指令集体系结构,仍然使用两个累加器:主累加器 EAX 与从累加器 EDX 用于乘法与除法的大数运算。例如,MUL ECX 将把两个 32 位寄存器 ECX 与 EAX 相乘,64 位结果放入 EAX 与 EDX。但是 MUL 与 DIV 之外的其他算术——逻辑指令(ADD、SUB、CMP、AND、OR、XOR、TEST)可以使用 8 个寄存器:EAX、ECX、EDX、EBX、ESP、EBP、ESI、EDI 作为目的操作数(即存储结果的位置)。

參考

[编辑]

本條目部分或全部内容出自以GFDL授權發佈的《自由線上電腦詞典》(FOLDOC)。

{{bottomLinkPreText}} {{bottomLinkText}}
累加器
Listen to this article

This browser is not supported by Wikiwand :(
Wikiwand requires a browser with modern capabilities in order to provide you with the best reading experience.
Please download and use one of the following browsers:

This article was just edited, click to reload
This article has been deleted on Wikipedia (Why?)

Back to homepage

Please click Add in the dialog above
Please click Allow in the top-left corner,
then click Install Now in the dialog
Please click Open in the download dialog,
then click Install
Please click the "Downloads" icon in the Safari toolbar, open the first download in the list,
then click Install
{{::$root.activation.text}}

Install Wikiwand

Install on Chrome Install on Firefox
Don't forget to rate us

Tell your friends about Wikiwand!

Gmail Facebook Twitter Link

Enjoying Wikiwand?

Tell your friends and spread the love:
Share on Gmail Share on Facebook Share on Twitter Share on Buffer

Our magic isn't perfect

You can help our automatic cover photo selection by reporting an unsuitable photo.

This photo is visually disturbing This photo is not a good choice

Thank you for helping!


Your input will affect cover photo selection, along with input from other users.

X

Get ready for Wikiwand 2.0 🎉! the new version arrives on September 1st! Don't want to wait?