$$
\frac { 7 6 \mathrm { h } } { 9 9 \mathrm { h } }
$$
得到相同的结果99D7h。因此,如果我们把两个16位的数用这种方式保存在存储器中,就像下面这样:
$$
\begin{array} { r l } & { \begin{array} { r l } & { \mathrm { i t s i g } } \\ & { \mathrm { 0 0 0 0 } \mathrm { h : } } \\ & { [ \begin{array} { l l l } { \mathrm { 1 0 h } } & { \mathrm { l o a d } } & { \mathrm { 0 0 0 0 h : } } \\ { \mathrm { 2 0 h } } & { \mathrm { A d d } } & { \mathrm { 2 C h } } \\ { \mathrm { 1 1 h } } & { \mathrm { l o t e r e } } & { \mathrm { 2 C h } } \end{array} ] } \end{array} } \\ & { \begin{array} { r l } & { [ \begin{array} { l } { 1 0 \mathrm { h } } \\ { \mathrm { 1 0 h } } \end{array} ] \mathrm { ~ L o a d } } \\ & { [ \begin{array} { l } { 1 0 \mathrm { h } } \\ { \mathrm { 2 0 h } } \end{array} ] \mathrm { ~ L o a d } } \\ & { [ \begin{array} { l } { 1 0 \mathrm { h } } \\ { \mathrm { 1 1 h } } \end{array} ] \mathrm { ~ A d d } } \\ & { [ \begin{array} { l } { 1 1 \mathrm { h } } \\ { \mathrm { 1 1 h } } \end{array} ] \mathrm { ~ H o r e } } \end{array} } \end{array} \begin{array} { r l } & { \mathrm { 2 0 h } } \\ & { [ \begin{array} { l } { 1 0 \mathrm { h } } \\ { \mathrm { 2 0 h } } \end{array} ] \times } \\ & { [ \begin{array} { l } { 1 0 \mathrm { \overline { { ~ 7 } } t r } } \\ { \mathrm { 4 1 h } } \end{array} ] \times } \\ & { [ \begin{array} { l } { 1 0 \mathrm { h } } \\ { \mathrm { 4 1 h } } \end{array} ] \times } \end{array} \begin{array} { r l } & { \mathrm { 2 0 h } } \\ & { [ \begin{array} { l } { 1 0 \mathrm { h } } \\ { \mathrm { 2 0 h } } \end{array} ] \times } \\ & [ \begin{array} { l } 1 0 \mathrm { \overline { { ~ 7 } } t r } \mathrm { \overline { { ~ 9 } } t r } \mathrm { \overline { { ~ 1 0 } } } \mathrm { ~ \overline { { ~ 8 } } t r } \mathrm { \overline { { ~ 1 0 } } } \mathrm ~ \end{array} \end{array}
$$
运算结果 D7h 将被保存到地址 0002h,而结果99h将被保存到地址0005h。
当然并非所有的情况都是这样处理,只是上面的例子中用到了这种方法。如果要把76ABh和236Ch这两个16位的数相加该怎么做呢?在这个例子中,对两个数的低字节求和时将会产生一个进位:
$$
\frac { \mathbf { A B h } } { \mathbf { 1 1 7 h } }
$$
产生的这个进位必须与两个数的高字节的和再相加:
$$
\begin{array} { r } { \mathbf { l h } } \\ { + 7 6 \mathbf { h } } \\ { \frac { + 2 3 \mathbf { h } } { 9 \mathbf { A } \mathbf { h } } } \end{array}
$$
最后的计算结果为9A17h。
我们能够改进自动加法器的电路,使它可以正确地进行16位数的加法操作吗?答案是肯定的,我们需要做的仅仅是在第一步运算时保存低字节数运算的进位输出,并把它作为下一步高字节数运算的进位输入。如何保存1位呢?1位锁存器就是最好的选择了,该锁存器应该被称为进位锁存器(Carrylatch)。
编码隐匿在计算机软硬件背后的语言
228