📄 5.htm
字号:
<td width="11%"><b><font color="#000000" size="4"> x</font></b></td>
<td width="11%"><b><font color="#000000" size="4"> x</font></b></td>
<td width="11%"><b><font color="#000000" size="4"> x</font></b></td>
<td width="11%"><b><font color="#000000" size="4"> x</font></b></td>
<td width="12%"><b><font color="#000000" size="4"> 010</font></b></td>
</tr>
<tr>
<td width="11%"><b><font color="#000000" size="4"> x</font></b></td>
<td width="11%"><b><font color="#000000" size="4"> 1</font></b></td>
<td width="11%"><b><font color="#000000" size="4"> x</font></b></td>
<td width="11%"><b><font color="#000000" size="4"> x</font></b></td>
<td width="11%"><b><font color="#000000" size="4"> x</font></b></td>
<td width="11%"><b><font color="#000000" size="4"> x</font></b></td>
<td width="11%"><b><font color="#000000" size="4"> x</font></b></td>
<td width="11%"><b><font color="#000000" size="4"> x</font></b></td>
<td width="12%"><b><font color="#000000" size="4"> 110</font></b></td>
</tr>
<tr>
<td width="11%"><b><font color="#000000" size="4"> 1</font></b></td>
<td width="11%"><b><font color="#000000" size="4"> x</font></b></td>
<td width="11%"><b><font color="#000000" size="4"> x</font></b></td>
<td width="11%"><b><font color="#000000" size="4"> x</font></b></td>
<td width="11%"><b><font color="#000000" size="4"> 0</font></b></td>
<td width="11%"><b><font color="#000000" size="4"> 0</font></b></td>
<td width="11%"><b><font color="#000000" size="4"> 0</font></b></td>
<td width="11%"><b><font color="#000000" size="4"> 0</font></b></td>
<td width="12%"><b><font color="#000000" size="4"> 010</font></b></td>
</tr>
<tr>
<td width="11%"><b><font color="#000000" size="4"> 1</font></b></td>
<td width="11%"><b><font color="#000000" size="4"> x</font></b></td>
<td width="11%"><b><font color="#000000" size="4"> x</font></b></td>
<td width="11%"><b><font color="#000000" size="4"> x</font></b></td>
<td width="11%"><b><font color="#000000" size="4"> 0</font></b></td>
<td width="11%"><b><font color="#000000" size="4"> 0</font></b></td>
<td width="11%"><b><font color="#000000" size="4"> 1</font></b></td>
<td width="11%"><b><font color="#000000" size="4"> 0</font></b></td>
<td width="12%"><b><font color="#000000" size="4"> 110</font></b></td>
</tr>
<tr>
<td width="11%"><b><font color="#000000" size="4"> 1</font></b></td>
<td width="11%"><b><font color="#000000" size="4"> x</font></b></td>
<td width="11%"><b><font color="#000000" size="4"> x</font></b></td>
<td width="11%"><b><font color="#000000" size="4"> x</font></b></td>
<td width="11%"><b><font color="#000000" size="4"> 0</font></b></td>
<td width="11%"><b><font color="#000000" size="4"> 1</font></b></td>
<td width="11%"><b><font color="#000000" size="4"> 0</font></b></td>
<td width="11%"><b><font color="#000000" size="4"> 0</font></b></td>
<td width="12%"><b><font color="#000000" size="4"> 000</font></b></td>
</tr>
<tr>
<td width="11%"><b><font color="#000000" size="4"> 1</font></b></td>
<td width="11%"><b><font color="#000000" size="4"> x</font></b></td>
<td width="11%"><b><font color="#000000" size="4"> x </font> </b></td>
<td width="11%"><b><font color="#000000" size="4"> x</font></b></td>
<td width="11%"><b><font color="#000000" size="4"> 0</font></b></td>
<td width="11%"><b><font color="#000000" size="4"> 1</font></b></td>
<td width="11%"><b><font color="#000000" size="4"> 0</font></b></td>
<td width="11%"><b><font color="#000000" size="4"> 1</font></b></td>
<td width="12%"><b><font color="#000000" size="4"> 001</font></b></td>
</tr>
<tr>
<td width="11%"><b><font color="#000000" size="4"> 1</font></b></td>
<td width="11%"><b><font color="#000000" size="4"> x</font></b></td>
<td width="11%"><b><font color="#000000" size="4"> x</font></b></td>
<td width="11%"><b><font color="#000000" size="4"> x</font></b></td>
<td width="11%"><b><font color="#000000" size="4"> 1</font></b></td>
<td width="11%"><b><font color="#000000" size="4"> 0</font></b></td>
<td width="11%"><b><font color="#000000" size="4"> 1</font></b></td>
<td width="11%"><b><font color="#000000" size="4"> 0</font></b></td>
<td width="12%"><b><font color="#000000" size="4"> 111</font></b></td>
</tr>
</table>
<p><font color="#000000" size="4">用卡诺图化简得:</font></p>
<p><font color="#000000" size="4">Operation2=F1*ALUOp1+ALUOp0</font></p>
<p><font color="#000000" size="4">Operation1=^F2+^ALUOp1</font></p>
<p><font color="#000000" size="4">Operation0=(F3+F0)*ALUOp0</font></p>
<p><font color="#000000" size="4"><img border="0" src="Image/5-2.gif" width="490" height="331"> </font></p>
<p><b><font color="#000000" size="4">三.设计主控制单元:产生CPU中所有数据通路控制信号</font></b></p>
<p><font color="#000000" size="4"> <b>从上例知:ALU控制输入op0,op1,op2是由指令操作码字段和功能码字段经</b></font></p>
<p><b><font color="#000000" size="4">组合设计实现,那么主控制单元的设计也完全类同:</font></b></p>
<p><b><font color="#000000" size="4">我们先来看看R型,I型和Branch指令的格式</font></b></p>
<p><b><font color="#000000" size="4">R 型</font></b></p>
<table border="1" width="100%" bordercolordark="#CC9966" bordercolorlight="#FFCC66">
<tr>
<td width="14%"><b><font color="#000000" size="4"> Field</font></b></td>
<td width="14%"><b><font color="#000000" size="4"> 0</font></b></td>
<td width="14%"><b><font color="#000000" size="4"> rs</font></b></td>
<td width="14%"><b><font color="#000000" size="4"> rt</font></b></td>
<td width="14%"><b><font color="#000000" size="4"> rd</font></b></td>
<td width="15%"><b><font color="#000000" size="4"> shamt</font></b></td>
<td width="15%"><b><font color="#000000" size="4"> func</font></b></td>
</tr>
<tr>
<td width="14%"><b><font color="#000000" size="4">Bit position</font></b></td>
<td width="14%"><b><font color="#000000" size="4"> 31-26</font></b></td>
<td width="14%"><b><font color="#000000" size="4"> 25-21</font></b></td>
<td width="14%"><b><font color="#000000" size="4"> 20-16</font></b></td>
<td width="14%"><b><font color="#000000" size="4"> 15-11</font></b></td>
<td width="15%"><b><font color="#000000" size="4"> 10-6</font></b></td>
<td width="15%"><b><font color="#000000" size="4"> 5-0</font></b></td>
</tr>
</table>
<p><b><font color="#000000" size="4">I型</font></b></p>
<table border="1" width="100%" height="32" bordercolordark="#CC9966" bordercolorlight="#FFCC66">
<tr>
<td width="14%" height="1"><b><font color="#000000" size="4"> Field</font></b></td>
<td width="14%" height="1"><b><font color="#000000" size="4"> 35or43</font></b></td>
<td width="14%" height="1"><b><font color="#000000" size="4"> rs</font></b></td>
<td width="14%" height="1"><b><font color="#000000" size="4"> rt</font></b></td>
<td width="44%" height="1"><b><font color="#000000" size="4"> address</font></b></td>
</tr>
<tr>
<td width="14%" height="32"><b><font color="#000000" size="4">Bit position</font></b></td>
<td width="14%" height="32"><b><font color="#000000" size="4"> 31-26</font></b></td>
<td width="14%" height="32"><b><font color="#000000" size="4"> 25-21</font> </b></td>
<td width="14%" height="32"><b><font color="#000000" size="4"> 20-16</font></b></td>
<td width="44%" height="32"><font color="#000000" size="4"> <b>15-0</b></font></td>
</tr>
</table>
<p><b><font color="#000000" size="4">Branch指令</font></b></p>
<table border="1" width="100%" height="32" bordercolordark="#CC9966" bordercolorlight="#FFCC66">
<tr>
<td width="14%" height="1"><b><font color="#000000" size="4"> Field</font></b></td>
<td width="14%" height="1"><b><font color="#000000" size="4"> 4</font></b></td>
<td width="14%" height="1"><b><font color="#000000" size="4"> rs</font></b></td>
<td width="14%" height="1"><b><font color="#000000" size="4"> rt</font></b></td>
<td width="44%" height="1"><b><font color="#000000" size="4"> address</font></b></td>
</tr>
<tr>
<td width="14%" height="32"><b><font color="#000000" size="4">Bit position</font></b></td>
<td width="14%" height="32"><b><font color="#000000" size="4"> 31-26</font></b></td>
<td width="14%" height="32"><b><font color="#000000" size="4"> 25-21</font> </b></td>
<td width="14%" height="32"><b><font color="#000000" size="4"> 20-16</font></b></td>
<td width="44%" height="32"><font color="#000000" size="4"> <b>15-0</b></font></td>
</tr>
</table>
<p><b><font color="#000000" size="4">我们知道:</font></b></p>
<p><b><font color="#000000" size="4">1.数据地址控制:由指令的地址字段决定</font></b></p>
<p><b><font color="#000000" size="4">2.运算和操作控制:由opcode和function两者决定</font></b></p>
<p><b><font color="#000000" size="4">对照上述指令格式,</font></b></p>
<p><b><font color="#000000" size="4">1.控制数据流字段地址:</font></b></p>
<p><b><font color="#000000" size="4">1)第二源寄存器的地址(rs):Instruction[25-21]</font></b></p>
<p><b><font color="#000000" size="4">2)第三源寄存器的地址(rt):Instruction[20-16]</font></b></p>
<p><b><font color="#000000" size="4">3)目的寄存器的地址:A) I型指令Instruction[20-16]</font></b></p>
<p><b><font color="#000000" size="4">
B) R型指令 (rd):Instruction[15-11]</font></b></p>
<p><b><font color="#000000" size="4">4)I型指令的地址偏移: Instruction[15-0]:要与rs相加,构成存储器的直接</font></b></p>
<p><b><font color="#000000" size="4">
地址</font></b></p>
<p><b><font color="#000000" size="4">2.操作码字段:</font></b></p>
<p><font color="#000000" size="4"> <b>opcode:Instruction[31-26],即op[5-0]</b></font></p>
<p><font color="#000000" size="4"> <b> Funct: Instruction[5-0]</b></font></p>
<p><font color="#000000" size="4"> <b>以上两者决定了操作流和运算控制以及ALU的有关操作</b></font></p>
<p><b><font color="#000000" size="4">下面我们来看看数据操作的控制信号:</font></b></p>
<table border="1" width="100%" bordercolordark="#CC9966" bordercolorlight="#FFCC66">
<tr>
<td width="33%" align="center"><b><font color="#000000" size="4"> Signal name</font></b></td>
<td width="33%" align="center"><b><font color="#000000" size="4"> Effect when
deasserted</font></b></td>
<td width="34%" align="center"><b><font color="#000000" size="4"> Effect when asserted</font></b></td>
</tr>
<tr>
<td width="33%" align="center"><b><font color="#000000" size="4"> MemRead</font></b></td>
<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">Data memory contents at the read address
are put on read data output</font></b></td>
</tr>
<tr>
<td width="33%" align="center"><b><font color="#000000" size="4"> MemWrite</font></b></td>
<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">Data memory contents at address giver by
write address is replaced by value on Write data input</font></b></td>
</tr>
<tr>
<td width="33%" align="center"><b><font color="#000000" size="4"> ALUSrc</font></b></td>
<td width="33%" align="center"><b><font color="#000000" size="4">The second ALU operand comes from the
second register file output </font></b></td>
<td width="34%" align="center"><b><font color="#000000" size="4">The second ALU operand is the
sign-extended lower 16-bits of the instruction</font></b></td>
</tr>
<tr>
<td width="33%" align="center"><b><font color="#000000" size="4"> RegDst</font></b></td>
<td width="33%" align="center"><b><font color="#000000" size="4"> The register destination number for the
Write register comes from the rt field</font></b></td>
<td width="34%" align="center"><b><font color="#000000" size="4">The register destination number for the
Write register comes from the rd field</font></b></td>
</tr>
<tr>
<td width="33%" align="center"><b><font color="#000000" size="4"> RegWrite</font></b></td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -