4-7.htm

来自「浙江大学计算机学院计算机组成教材《计算机组成与设计》(潘学增)的课堂教学课件。」· HTM 代码 · 共 758 行 · 第 1/4 页

HTM
758
字号
  <tr>                                
    <td width="243" height="17">                                
      <p align="left"><font color="#000000" size="4">2b:Rem&lt;0 =&gt;+Div,sll Q,Q0=0</font></td>                                
    <center>                                
    <td width="99" height="17">                                
      <p align="center"><font color="#000000" size="4">0000</font></td>                               
    <td width="116" height="17">                               
      <p align="center"><font color="#000000" size="4">0000 1000</font></td>                                
    <td width="91" height="17">                                
      <p align="center"><font color="#000000" size="4">0000 0111</font></td>                                
    </tr>                                
  </center>                                
  <tr>                                
    <td width="243" height="17">                                
      <p align="left"><font color="#000000" size="4">3: Shift Div right</font></td>                                
    <center>                                
    <td width="99" height="17">                                
      <p align="center"><font color="#000000" size="4">0000</font></td>                               
    <td width="116" height="17">                               
      <p align="center"><font color="#000000" size="4">0000 0100</font></td>                                
    <td width="91" height="17">                                
      <p align="center"><font color="#000000" size="4">0000 0111</font></td>                                
    </tr>                                
    <tr>                                
      <td width="87" height="31" rowspan="3">                                
        <p align="center"><font color="#000000" size="4">4</font></td>                               
    </center>                               
    <td width="243" height="10">                               
      <p align="left"><font color="#000000" size="4">1:Rem=Rem-div</font></td>                               
    <center>                               
    <td width="99" height="10">                               
      <p align="center"><font color="#000000" size="4">0000</font></td>                               
    <td width="116" height="10">                               
      <p align="center"><font color="#000000" size="4">0000 0100</font></td>                                
    <td width="91" height="10">                                
      <p align="center"><font color="#000000" size="4">0000                                 
      0011</font></td>                                
    </tr>                                
  </center>                                
  <tr>                                
    <td width="243" height="11">                                
      <p align="left"><font color="#000000" size="4">2a:Rem&nbsp; 0 =&gt; sll Q,Q0=1</font></td>                                
    <center>                                
    <td width="99" height="11">                                
      <p align="center"><font color="#000000" size="4">0001</font></td>                               
    <td width="116" height="11">                               
      <p align="center"><font color="#000000" size="4">0000 0100</font></td>                                
    <td width="91" height="11">                                
      <p align="center"><font color="#000000" size="4">0000 0011</font></td>                                
    </tr>                                
  </center>                                
  <tr>                                
    <td width="243" height="10">                                
      <p align="left"><font color="#000000" size="4">3: Shift Div right</font></td>                                
    <center>                                
    <td width="99" height="10">                                
      <p align="center"><font color="#000000" size="4">0001</font></td>                               
    <td width="116" height="10">                               
      <p align="center"><font color="#000000" size="4">0000 0010</font></td>                                
    <td width="91" height="10">                                
      <p align="center"><font color="#000000" size="4">0000 0011</font></td>                                
    </tr>                                
    <tr>                                
      <td width="87" height="20" rowspan="3">                                
        <p align="center"><font color="#000000" size="4">5</font></td>                               
    </center>                               
    <td width="243" height="6">                               
      <p align="left"><font color="#000000" size="4">1:Rem=Rem-div</font></td>                               
    <center>                               
    <td width="99" height="6">                               
      <p align="center"><font color="#000000" size="4">0001</font></td>                               
    <td width="116" height="6">                               
      <p align="center"><font color="#000000" size="4">0000 0010</font></td>                                
    <td width="91" height="6">                                
      <p align="center"><font color="#000000" size="4">0000                                 
      0001</font></td>                                
    </tr>                                
  </center>                                
  <tr>                                
    <td width="243" height="9">                                
      <p align="left"><font color="#000000" size="4">2a:Rem&nbsp; 0 =&gt; sll Q,Q0=1</font></td>                                
    <center>                                
    <td width="99" height="9">                                
      <p align="center"><font color="#000000" size="4">0011</font></td>                               
    <td width="116" height="9">                               
      <p align="center"><font color="#000000" size="4">0000 0010</font></td>                                
    <td width="91" height="9">                                
      <p align="center"><font color="#000000" size="4">0000 0001</font></td>                                
    </tr>                                
  </center>                                
  <tr>                                
    <td width="243" height="5">                                
      <p align="left"><font color="#000000" size="4">3: Shift Div right</font></td>                                
    <center>                                
    <td width="99" height="5">                                
      <p align="center"><font color="#000000" size="4">0011</font></td>                               
    <td width="116" height="5">                               
      <p align="center"><font color="#000000" size="4">0000 0001</font></td>                                
    <td width="91" height="5">                                
      <p align="center"><font color="#000000" size="4">0000 0001</font></td>                                
    </tr>                                
  </table>                                
  </center>                                
</div>                                
<p align="left"><font color="#000000">&nbsp;&nbsp;&nbsp; <font size="4">The last value:                                 
Quotient--0011;Remainder--0000 0001.</font></font></p>                                
<p align="left"><font color="#000000" size="4">三:<a name="第二代除法算法和硬件设计">第二代除法算法和硬件设计</a></font></p>                              
<p align="left"> <font color="#000000" size="4">&nbsp;&nbsp;&nbsp; 我们可以发现在上面的算法中,divisor中只有一半是有用信息,因此我们可以将divisor                                
和ALU 同时砍掉一半。通过将remainder向左移来达到将divisor向右移的同样的目的,其具体算法和硬件设计如下图:</font></p>                               
<p align="center"><font color="#000000" size="4"><img border="0" src="images/4-7-pic2.gif" width="721" height="400"></font></p>                            
<p align="left"> <font color="#000000" size="4"> &nbsp;&nbsp;&nbsp; Example: Divide 0000 0111<sub>two</sub> by 0010<sub>two</sub>gg.<br>                            
&nbsp;&nbsp;&nbsp; Answer:</font></p>                             
<p align="center"> <font color="#000000" size="4"> &nbsp;&nbsp;</font></p>                            
<div align="center">                          
  <center>                          
  <table border="1" cellpadding="0" cellspacing="0" width="585" height="220" bordercolordark="#CC9966" bordercolorlight="#FFCC66">                          
    <tr>                          
      <td width="72" height="20" bgcolor="#CCFF99">                          
        <p align="center"><font color="#000000" size="4">Iteration</font></td>                          
      <td width="247" height="20" bgcolor="#CCFF99">                          
        <p align="center"><font color="#000000" size="4">Step</font></td>                          
      <td width="82" height="20" bgcolor="#CCFF99">                          
        <p align="center"><font color="#000000" size="4">Quotient</font></td>                          
      <td width="88" height="20" bgcolor="#CCFF99">                          
        <p align="center"><font color="#000000" size="4">Divisor</font></td>                          
      <td width="84" height="20" bgcolor="#CCFF99">                          
        <p align="center"><font color="#000000" size="4">Remainder</font></td>                          
    </tr>                          
    <tr>                          
      <td width="72" height="18">                          
        <p align="center"><font color="#000000" size="4">0</font></td>                          
    </center>                          
    <td width="247" height="18">                          
      <p align="left"><font color="#000000" size="4">Initial Values</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">0000 0111</font></td>                           
    </tr>                           
    <tr>                           
      <td width="72" height="55" rowspan="3">                           
        <p align="center"><font color="#000000" size="4">1</font></td>                          
    </center>                          
    <td width="247" height="19">                          
      <p align="left"><font color="#000000" size="4">1: Shift Rem left</font></td>                           
    <center>                           
    <td width="82" height="19">                           
      <p align="center"><font color="#000000" size="4">0000</font></td>                          
    <td width="88" height="19">                          
      <p align="center"><font color="#000000" size="4">0010</font></td>                          
    <td width="84" height="19">                          
      <p align="center"><font color="#000000" size="4">0000 1110</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">1110                            
      1110</font></td>                           
    </tr>                           
  </center>                           
  <tr>                           
    <td width="247" height="18">                           
      <p align="left"><font color="#000000" size="4">3b:Rem &lt;0 =&gt;+Div ,sll Q,Q0=0</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">0000 1110</font></td>                           
    </tr>                           
    <tr>                           
      <td width="72" height="47" rowspan="3">                           
        <p align="center"><font color="#000000" size="4">2</font></td>                          
    </center>                          
    <td width="247" height="18">                          
      <p align="left"><font color="#000000" size="4">1: shift Rem left</font></td>                           
    <center>                           
    <td width="82" height="18">                           
      <p align="center"><font color="#000000" size="4">0000</font></td>                          

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?