Solution (source code)

= Solution

Fetch and decode the <MIPS I-type instruction>, read $rs$ and $rt$, and subtract their values in the <arithmetic logic unit>. The <zero flag> is one exactly when they are equal. The branch target is
$$
\mathrm{BrT}=(pc+4)+\bigl(\operatorname{signextend}(imm)\ll2\bigr).
$$
The branch selector chooses that target when $Br_1=1$ and $Br_0=0$ make the diagram's condition equal to $\mathrm{Zero}$. Otherwise it chooses $pc+4$. Neither registers nor data memory are written. The <control signals> are
$$
\begin{array}{c|ccccccccc}
&\mathrm{RegDst}&\mathrm{Branch}&\mathrm{Jump}&\mathrm{MemWrite}&\mathrm{MemToReg}&\mathrm{ALUOp}&\mathrm{MemRead}&\mathrm{ALUSrc}&\mathrm{RegWrite}\\\hline
\mathrm{beq}&-&10&0&0&-&01&0&0&0
\end{array}.
$$
Dashes are <don't-care conditions> because register write enable is zero. The immediate goes to the branch-target adder, while the main ALU's second input remains the value in $rt$.