📄 4-7.htm
字号:
<td width="88" height="18">
<p align="center"><font color="#000000" size="4">0010</font></td>
<td width="84" height="18">
<p align="center"><font color="#000000" size="4">0001 1100</font></td>
</tr>
</center>
<tr>
<td width="247" height="16">
<p align="left"><font color="#000000" size="4">2: Rem=Rem-Div</font></td>
<center>
<td width="82" height="16">
<p align="center"><font color="#000000" size="4">0000</font></td>
<td width="88" height="16">
<p align="center"><font color="#000000" size="4">0010</font></td>
<td width="84" height="16">
<p align="center"><font color="#000000" size="4">1111
1100</font></td>
</tr>
</center>
<tr>
<td width="247" height="13">
<p align="left"><font color="#000000" size="4">3b:Rem<0 =>+Div ,sll Q,Q0=0</font></td>
<center>
<td width="82" height="13">
<p align="center"><font color="#000000" size="4">0000</font></td>
<td width="88" height="13">
<p align="center"><font color="#000000" size="4">0010</font></td>
<td width="84" height="13">
<p align="center"><font color="#000000" size="4">0001 1100</font></td>
</tr>
<tr>
<td width="72" height="47" rowspan="3">
<p align="center"><font color="#000000" size="4">3</font></td>
</center>
<td width="247" height="15">
<p align="left"><font color="#000000" size="4">1: shift Rem left</font></td>
<center>
<td width="82" height="15">
<p align="center"><font color="#000000" size="4">0000</font></td>
<td width="88" height="15">
<p align="center"><font color="#000000" size="4">0010</font></td>
<td width="84" height="15">
<p align="center"><font color="#000000" size="4">0011 1000</font></td>
</tr>
</center>
<tr>
<td width="247" height="18">
<p align="left"><font color="#000000" size="4">2: Rem=Rem-Div</font></td>
<center>
<td width="82" height="18">
<p align="center"><font color="#000000" size="4">0000</font></td>
<td width="88" height="18">
<p align="center"><font color="#000000" size="4">0010</font></td>
<td width="84" height="18">
<p align="center"><font color="#000000" size="4">0001
1000</font></td>
</tr>
</center>
<tr>
<td width="247" height="14">
<p align="left"><font color="#000000" size="4">3a:Rem 0 => sll Q ,Q0=1</font></td>
<center>
<td width="82" height="14">
<p align="center"><font color="#000000" size="4">0001</font></td>
<td width="88" height="14">
<p align="center"><font color="#000000" size="4">0010</font></td>
<td width="84" height="14">
<p align="center"><font color="#000000" size="4">0001 1000</font></td>
</tr>
<tr>
<td width="72" height="21" rowspan="3">
<p align="center"><font color="#000000" size="4">4</font></td>
</center>
<td width="247" height="7">
<p align="left"><font color="#000000" size="4">1: Shift Rem left</font></td>
<center>
<td width="82" height="7">
<p align="center"><font color="#000000" size="4">0001</font></td>
<td width="88" height="7">
<p align="center"><font color="#000000" size="4">0010</font></td>
<td width="84" height="7">
<p align="center"><font color="#000000" size="4">0011 0000</font></td>
</tr>
</center>
<tr>
<td width="247" height="8">
<p align="left"><font color="#000000" size="4">2: Rem=Rem-Div</font></td>
<center>
<td width="82" height="8">
<p align="center"><font color="#000000" size="4">0001</font></td>
<td width="88" height="8">
<p align="center"><font color="#000000" size="4">0010</font></td>
<td width="84" height="8">
<p align="center"><font color="#000000" size="4">0001
0000</font></td>
</tr>
</center>
<tr>
<td width="247" height="6">
<p align="left"><font color="#000000" size="4">3a:Rem 0 => sll Q ,Q0=1</font></td>
<center>
<td width="82" height="6">
<p align="center"><font color="#000000" size="4">0011</font></td>
<td width="88" height="6">
<p align="center"><font color="#000000" size="4">0010</font></td>
<td width="84" height="6">
<p align="center"><font color="#000000" size="4">0001 0000</font></td>
</tr>
</table>
</center>
</div>
<p align="left"> <font color="#000000" size="4"> 最后,Quotient=0011,Remainder=0001.</font></p>
<p align="left"><font color="#000000" size="4">四:<a name="第三代除法算法和硬件设计">第三代除法算法和硬件设计</a></font></p>
<p align="left"><font color="#000000" size="4">
在这个算法中,我们可以去掉Quotient register,然后在运行时将Quotient放入Remainder的左半边,这样就可以节省硬件了。在这个算法里,每一个循环里只需要两个步骤,因为我们在左移Remainder的时候Quotient也随着左移存入Remainder的右半部分中。但是由于两个register的合并,导致我们将Remainder多左移一次,最后还要将Remainder的左半部分向右移动一位,这样才能将Remainder
和Quotient准确放入Remainder register
之中。具体算法和硬件设计实现如下图:</font></p>
<p align="center"><font color="#000000" size="4"><img border="0" src="images/4-7-pic3.gif" width="716" height="391"></font></p>
<p align="left"><font color="#000000" size="4"> Example: Use the
third version of the algorithm to divide 0000 0111<sub>two</sub> by 0010<sub>two</sub>.<br>
<sub> </sub>Answer: 如下表格</font></p>
<div align="center">
<center>
<table border="1" cellpadding="0" cellspacing="0" width="506" height="123" bordercolordark="#CC9966" bordercolorlight="#FFCC66">
<tr>
<td width="76" height="15" bgcolor="#CCFF99">
<p align="center"><font color="#000000" size="4">Iteration</font></td>
<td width="240" height="15" bgcolor="#CCFF99">
<p align="center"><font color="#000000" size="4">Step</font></td>
<td width="70" height="15" bgcolor="#CCFF99">
<p align="center"><font color="#000000" size="4">Divisor</font></td>
<td width="110" height="15" bgcolor="#CCFF99">
<p align="center"><font color="#000000" size="4">Remainder</font></td>
</tr>
<tr>
<td width="76" height="35" rowspan="2">
<p align="center"><font color="#000000" size="4">0</font></td>
<td width="240" height="19"><font color="#000000" size="4">Initial Values</font></td>
<td width="70" height="19">
<p align="center"><font color="#000000" size="4">0010</font></td>
<td width="110" height="19">
<p align="center"><font color="#000000" size="4">0000 0111</font></td>
</tr>
<tr>
<td width="240" height="16"><font color="#000000" size="4">Shift Rem left 1</font></td>
<td width="70" height="16">
<p align="center"><font color="#000000" size="4">0010</font></td>
<td width="110" height="16">
<p align="center"><font color="#000000" size="4">0000 1110</font></td>
</tr>
<tr>
<td width="76" height="29" rowspan="2">
<p align="center"><font color="#000000" size="4">1</font></td>
<td width="240" height="21"><font color="#000000" size="4">1: Rem=Rem-Div</font></td>
<td width="70" height="21">
<p align="center"><font color="#000000" size="4">0010</font></td>
<td width="110" height="21">
<p align="center"><font color="#000000" size="4">1110
1110</font></td>
</tr>
<tr>
<td width="240" height="8"><font color="#000000" size="4">2b:Rem<0 => +Div,sll
R,R0=0</font></td>
<td width="70" height="8">
<p align="center"><font color="#000000" size="4">0010</font></td>
<td width="110" height="8">
<p align="center"><font color="#000000" size="4">0001 1100</font></td>
</tr>
<tr>
<td width="76" height="18" rowspan="2">
<p align="center"><font color="#000000" size="4">2</font></td>
<td width="240" height="13"><font color="#000000" size="4">1: Rem=Rem-Div</font></td>
<td width="70" height="13">
<p align="center"><font color="#000000" size="4">0010</font></td>
<td width="110" height="13">
<p align="center"><font color="#000000" size="4">1111
1100</font></td>
</tr>
<tr>
<td width="240" height="5"><font color="#000000" size="4">2b:Rem<0 => +Div,sll
R,R0=0</font></td>
<td width="70" height="5">
<p align="center"><font color="#000000" size="4">0010</font></td>
<td width="110" height="5">
<p align="center"><font color="#000000" size="4">0011 1000</font></td>
</tr>
<tr>
<td width="76" height="13" rowspan="2">
<p align="center"><font color="#000000" size="4">3</font></td>
<td width="240" height="4"><font color="#000000" size="4">1: Rem=Rem-Div</font></td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -