⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 5.htm

📁 浙江大学计算机学院计算机组成教材《计算机组成与设计》(潘学增)的课堂教学课件。
💻 HTM
📖 第 1 页 / 共 4 页
字号:
    <td width="33%" align="center"><b><font color="#000000" size="4"> None</font></b></td>
    <td width="34%" align="center"><b><font color="#000000" size="4">The register on the Write register input   
      is written into with the value on the write data input</font></b></td>  
  </tr>  
  <tr>  
    <td width="33%" align="center"><b><font color="#000000" size="4">&nbsp;&nbsp; PCSrc</font></b></td>             
    <td width="33%" align="center"><b><font color="#000000" size="4"> The PC is replaced by the output of the             
      adder that computes the value of PC+4</font></b></td>            
    <td width="34%" align="center"><b><font color="#000000" size="4">The PC is replaced by the output of the          
      adder that computes the branch target</font></b></td>         
  </tr>         
  <tr>         
    <td width="33%" align="center"><b><font color="#000000" size="4">&nbsp;&nbsp; MemtoReg</font></b></td>             
    <td width="33%" align="center"><b><font color="#000000" size="4"> The value fed to the register write             
      data input comes from the&nbsp; ALU&nbsp;</font></b></td>            
    <td width="34%" align="center"><b><font color="#000000" size="4">The value fed to the register write data             
      input comes from the data memory</font></b></td>            
  </tr>            
</table>            
            
        
        
<p><font color="#000000" size="4"> <img border="0" src="Image/5-3.gif" width="768" height="550"></font></p>

<p><b><font color="#000000" size="4">指令执行过程举例:</font></b></p>

<p><b><font color="#000000" size="4">1)R型指令执行过程: 如&nbsp; add&nbsp; $1,$2,$3&nbsp; #$2+$3=&gt;$1</font></b></p>             
             
<p><b><font color="#000000" size="4">&nbsp;a)取指令:&nbsp; i)指令存储器读出指令,把opcode送指令译码器,rs,rt,rd              
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;              
对应相对的选择线</font></b></p>             
             
<p><b><font color="#000000" size="4"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; j)pc+4:&nbsp;              
准备取下一条指令</font></b></p>             
             
<p><b><font color="#000000" size="4">&nbsp;b)指令译码器产生相应的控制信号</font></b></p>           
           
<p><b><font color="#000000" size="4">&nbsp;c)ALU执行相应的运算</font></b></p>           
           
<p><b><font color="#000000" size="4">&nbsp;d)运算的结果送rd</font></b></p>           
           
<p><b><font color="#000000" size="4">&nbsp;&nbsp; 注:R型指令是在一个周期内完成的</font></b></p>             
             
<p> </p>             
             
<p><b><font color="#000000" size="4">2)I型指令:如&nbsp;&nbsp; sw $3,offset($5)</font></b></p>             
             
<p><font color="#000000" size="4">&nbsp; <b>a)取指令 ,pc+4:&nbsp; 准备取下一条指令</b></font></p>             
             
<p><b><font color="#000000" size="4">&nbsp; b)从寄存器组中读出$5</font></b></p>            
            
<p><font color="#000000" size="4">&nbsp;<b>c)计算存储器的有效地址  offset(符号扩展) +$5&nbsp;</b></font></p>            
            
<p><font color="#000000" size="4"><b>&nbsp; </b><img border="0" src="Image/31.gif" width="345" height="264"></font></p>           
           
<p><b><font color="#000000" size="4">&nbsp;d) EA =有效地址,送给存储器读地址</font></b></p>             
             
<p><b><font color="#000000" size="4">&nbsp;e)以Memory读出值送指定的寄存器 :由Instruction[20-16]决定</font></b></p>

<p><b><font color="#000000" size="4">3)Branch指令   Beq $3,$2,offset&nbsp;</font></b></p>

<p><font color="#000000" size="4">&nbsp; <b>a)取指令 ,pc+4:&nbsp; 准备取下一条指令</b></font></p>             
             
<p><b><font color="#000000" size="4">&nbsp; b)从寄存器组中读出$2,$3</font></b></p>             
             
<p><b><font color="#000000" size="4">&nbsp;c)扩展指令[15-0](16位)到32位&nbsp;&nbsp;</font></b></p>           
           
<p><b><font color="#000000" size="4">&nbsp;d)根据ALU的Zero=1? 选择pc+4还是pc+4+offset(扩展后)送pc</font></b></p>             
             
<p><b><font color="#000000" size="4">这三类指令的控制位信号值总结如下:</font></b></p>           
           
           
           
<table border="1" width="100%" bordercolordark="#CC9966" bordercolorlight="#FFCC66">           
  <tr>           
    <td width="10%"><b><font color="#000000" size="4">Instruction</font></b></td>        
    <td width="10%"><b><font color="#000000" size="4">RegDst</font></b></td>        
    <td width="10%"><b><font color="#000000" size="4">ALUSrc</font></b></td>        
    <td width="10%"><b><font color="#000000" size="4">MemtoReg</font></b></td>        
    <td width="10%"><b><font color="#000000" size="4">Reg<br>        
    Write</font></b></td>        
    <td width="10%"><b><font color="#000000" size="4">Mem Read</font></b></td>          
    <td width="10%"><b><font color="#000000" size="4">Mem<br>        
    Write</font></b></td>        
    <td width="10%"><b><font color="#000000" size="4">Branch</font></b></td>        
    <td width="10%"><b><font color="#000000" size="4">ALUOp1</font></b></td>        
    <td width="10%"><b><font color="#000000" size="4">ALUOp2</font></b></td>        
  </tr>        
  <tr>        
    <td width="10%"><b><font color="#000000" size="4">&nbsp;R-format</font></b></td>        
    <td width="10%"><b><font color="#000000" size="4">&nbsp; 1</font></b></td>             
    <td width="10%"><b><font color="#000000" size="4">&nbsp; 0</font></b></td>             
    <td width="10%"><b><font color="#000000" size="4">&nbsp;&nbsp; 0</font></b></td>             
    <td width="10%"><b><font color="#000000" size="4">&nbsp; 1</font></b></td>             
    <td width="10%"><b><font color="#000000" size="4">&nbsp;0</font></b></td>        
    <td width="10%"><b><font color="#000000" size="4">&nbsp; 0</font></b></td>             
    <td width="10%"><b><font color="#000000" size="4">&nbsp; 0&nbsp;</font></b></td>             
    <td width="10%"><b><font color="#000000" size="4">&nbsp; 1</font></b></td>             
    <td width="10%"><b><font color="#000000" size="4">&nbsp; 0</font></b></td>             
  </tr>             
  <tr>             
    <td width="10%"><b><font color="#000000" size="4">&nbsp; lw</font></b></td>             
    <td width="10%"><b><font color="#000000" size="4">&nbsp; 0</font></b></td>             
    <td width="10%"><b><font color="#000000" size="4">&nbsp; 1</font></b></td>             
    <td width="10%"><b><font color="#000000" size="4">&nbsp;&nbsp; 1</font></b></td>             
    <td width="10%"><b><font color="#000000" size="4">&nbsp; 1</font></b></td>             
    <td width="10%"><b><font color="#000000" size="4">&nbsp;1</font></b></td>        
    <td width="10%"><b><font color="#000000" size="4">&nbsp; 0</font></b></td>             
    <td width="10%"><b><font color="#000000" size="4">&nbsp; 0</font></b></td>             
    <td width="10%"><b><font color="#000000" size="4">&nbsp; 0</font></b></td>             
    <td width="10%"><b><font color="#000000" size="4">&nbsp; 0</font></b></td>             
  </tr>             
  <tr>             
    <td width="10%"><b><font color="#000000" size="4">&nbsp; sw</font></b></td>             
    <td width="10%"><b><font color="#000000" size="4">&nbsp; x</font></b></td>             
    <td width="10%"><b><font color="#000000" size="4">&nbsp; 1</font></b></td>             
    <td width="10%"><b><font color="#000000" size="4">&nbsp;&nbsp; x</font></b></td>             
    <td width="10%"><b><font color="#000000" size="4">&nbsp; 0&nbsp;</font></b></td>             
    <td width="10%"><b><font color="#000000" size="4">&nbsp;0</font></b></td>        
    <td width="10%"><b><font color="#000000" size="4">&nbsp; 1</font></b></td>             
    <td width="10%"><b><font color="#000000" size="4">&nbsp; 0</font></b></td>             
    <td width="10%"><b><font color="#000000" size="4">&nbsp; 0&nbsp;</font></b></td>             
    <td width="10%"><b><font color="#000000" size="4">&nbsp; 0</font></b></td>             
  </tr>             
  <tr>             
    <td width="10%"><b><font color="#000000" size="4">&nbsp; beq</font></b></td>             
    <td width="10%"><b><font color="#000000" size="4">&nbsp; x</font></b></td>             
    <td width="10%"><b><font color="#000000" size="4">&nbsp; 0</font></b></td>             
    <td width="10%"><b><font color="#000000" size="4">&nbsp;&nbsp; x</font></b></td>             
    <td width="10%"><b><font color="#000000" size="4">&nbsp; 0</font></b></td>             
    <td width="10%"><b><font color="#000000" size="4">&nbsp;0</font></b></td>        
    <td width="10%"><b><font color="#000000" size="4">&nbsp; 0</font></b></td>             
    <td width="10%"><b><font color="#000000" size="4">&nbsp; 1</font></b></td>             
    <td width="10%"><b><font color="#000000" size="4">&nbsp; 0</font></b></td>             
    <td width="10%"><b><font color="#000000" size="4">&nbsp; 1</font></b></td>             
  </tr>             
</table>             
             
         
         
<p><b><font color="#000000" size="4">所以我们可以列出真值表来实现主控制单元的逻辑实现</font></b></p>        
        
        
        
<table border="1" width="100%" bordercolordark="#CC9966" bordercolorlight="#FFCC66">        
  <tr>        
    <td width="49%" colspan="3" align="center"><b><font color="#000000" size="4">R-format</font></b></td>       
    <td width="17%" align="center"><b><font color="#000000" size="4">lw</font></b></td>       
    <td width="17%" align="center"><b><font color="#000000" size="4">sw</font></b></td>       
    <td width="17%" align="center"><b><font color="#000000" size="4">beq</font></b></td>       
  </tr>       
  <tr>       
    <td width="16%" rowspan="6" align="center"><b><font color="#000000" size="4">inputs</font></b></td>       
    <td width="16%" align="center"><b><font color="#000000" size="4">Op5</font></b></td>       
    <td width="17%" align="center"><b><font color="#000000" size="4">0</font></b></td>       
    <td width="17%" align="center"><b><font color="#000000" size="4">1</font></b></td>       
    <td width="17%" align="center"><b><font color="#000000" size="4">1</font></b></td>       
    <td width="17%" align="center"><b><font color="#000000" size="4">0</font></b></td>       
  </tr>       
  <tr>       
    <td width="16%" align="center"><b><font color="#000000" size="4">Op4</font></b></td>       
    <td width="17%" align="center"><b><font color="#000000" size="4">0</font></b></td>       
    <td width="17%" align="center"><b><font color="#000000" size="4">0</font></b></td>       
    <td width="17%" align="center"><b><font color="#000000" size="4">0</font></b></td>       
    <td width="17%" align="center"><b><font color="#000000" size="4">0</font></b></td>       
  </tr>       
  <tr>       
    <td width="16%" align="center"><b><font color="#000000" size="4">Op3</font></b></td>       
    <td width="17%" align="center"><b><font color="#000000" size="4">0</font></b></td>       
    <td width="17%" align="center"><b><font color="#000000" size="4">0</font></b></td>       
    <td width="17%" align="center"><b><font color="#000000" size="4">1</font></b></td>       
    <td width="17%" align="center"><b><font color="#000000" size="4">0</font></b></td>       
  </tr>       
  <tr>       
    <td width="16%" align="center"><b><font color="#000000" size="4">Op2</font></b></td>       
    <td width="17%" align="center"><b><font color="#000000" size="4">0</font></b></td>       
    <td width="17%" align="center"><b><font color="#000000" size="4">0</font></b></td>       
    <td width="17%" align="center"><b><font color="#000000" size="4">0</font></b></td>       
    <td width="17%" align="center"><b><font color="#000000" size="4">1</font></b></td>       
  </tr>       
  <tr>       
    <td width="16%" align="center"><b><font color="#000000" size="4">Op1</font></b></td>       
    <td width="17%" align="center"><b><font color="#000000" size="4">0</font></b></td>       
    <td width="17%" align="center"><b><font color="#000000" size="4">1</font></b></td>       
    <td width="17%" align="center"><b><font color="#000000" size="4">1</font></b></td>       
    <td width="17%" align="center"><b><font color="#000000" size="4">0</font></b></td>       
  </tr>       
  <tr>       
    <td width="16%" align="center"><b><font color="#000000" size="4">Op0</font></b></td>       
    <td width="17%" align="center"><b><font color="#000000" size="4">0</font></b></td>       
    <td width="17%" align="center"><b><font color="#000000" size="4">1</font></b></td>       
    <td width="17%" align="center"><b><font color="#000000" size="4">1</font></b></td>       
    <td width="17%" align="center"><b><font color="#000000" size="4">0</font></b></td>       
  </tr>       
  <tr>       
    <td width="16%" rowspan="9" align="center"><b><font color="#000000" size="4">Outputs</font></b></td>       
    <td width="16%" align="center"><b><font color="#000000" size="4">RegDst</font></b></td>       
    <td width="17%" align="center"><b><font color="#000000" size="4">1</font></b></td>       
    <td width="17%" align="center"><b><font color="#000000" size="4">0</font></b></td>       
    <td width="17%" align="center"><b><font color="#000000" size="4">x</font></b></td>       
    <td width="17%" align="center"><b><font color="#000000" size="4">x</font></b></td>       
  </tr>       
  <tr>       
    <td width="16%" align="center"><b><font color="#000000" size="4">ALUSrc&nbsp;</font></b></td>       
    <td width="17%" align="center"><b><font color="#000000" size="4">0</font></b></td>       
    <td width="17%" align="center"><b><font color="#000000" size="4">1</font></b></td>       
    <td width="17%" align="center"><b><font color="#000000" size="4">1</font></b></td>       
    <td width="17%" align="center"><b><font color="#000000" size="4">0</font></b></td>       
  </tr>       
  <tr>       
    <td width="16%" align="center"><b><font color="#000000" size="4">MemtoReg&nbsp;</font></b></td>       
    <td width="17%" align="center"><b><font color="#000000" size="4">0</font></b></td>       
    <td width="17%" align="center"><b><font color="#000000" size="4">1</font></b></td>       
    <td width="17%" align="center"><b><font color="#000000" size="4">x</font></b></td>       
    <td width="17%" align="center"><b><font color="#000000" size="4">x</font></b></td>       
  </tr>       
  <tr>       
    <td width="16%" align="center"><b><font color="#000000" size="4">RegWrite&nbsp;</font></b></td>       
    <td width="17%" align="center"><b><font color="#000000" size="4">1</font></b></td>       
    <td width="17%" align="center"><b><font color="#000000" size="4">1</font></b></td>       
    <td width="17%" align="center"><b><font color="#000000" size="4">0</font></b></td>       
    <td width="17%" align="center"><b><font color="#000000" size="4">0</font></b></td>       
  </tr>       
  <tr>       
    <td width="16%" align="center"><b><font color="#000000" size="4">MemRead</font></b></td>       
    <td width="17%" align="center"><b><font color="#000000" size="4">0</font></b></td>       
    <td width="17%" align="center"><b><font color="#000000" size="4">1</font></b></td>       
    <td width="17%" align="center"><b><font color="#000000" size="4">0</font></b></td>       
    <td width="17%" align="center"><b><font color="#000000" size="4">0</font></b></td>       
  </tr>       
  <tr>       
    <td width="16%" align="center"><b><font color="#000000" size="4">MemWrite</font></b></td>       
    <td width="17%" align="center"><b><font color="#000000" size="4">0</font></b></td>       
    <td width="17%" align="center"><b><font color="#000000" size="4">0</font></b></td>       
    <td width="17%" align="center"><b><font color="#000000" size="4">1</font></b></td>       
    <td width="17%" align="center"><b><font color="#000000" size="4">0</font></b></td>       
  </tr>       
  <tr>       

⌨️ 快捷键说明

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