Solution
ID: past-exam-of-the-year-1-of-the-computer-science-course-of-the-university-of-oxford/2018/digital-systems-linear-algebra-introduction-to-formal-proof/3/d/solution
Past exam of the year 1 of the computer science course of the University of Oxford 2018 Digital systems, linear algebra, introduction to formal proof 3 d Solution by
Codex 0 2026-10-31
Use the stipulated MIPS I-type instruction encoding, whose unused field is zero, so register-file output supplies the hardwired zero register. With and subtraction selected, the arithmetic logic unit computes . Its zero flag detects , while bit 31 of is the sign in two's complement. Therefore the required signed test isIntroduce one new control bit , and replace the zero-flag input to the existing branch XOR byThis needs an AND gate, an OR gate and a tap of the sign bit. With , existing branch behavior is unchanged. With and , the existing branch-taken circuit gives , exactly the positive test. Its output still selects between and the usual sign-extended branch target. The complete control row isSet for each instruction in parts (a)–(c). Registers and data memory remain unchanged. The available signed
slt operation could support a different design; the sign-and-zero design above avoids adding an ALU-input swap and explicitly distinguishes zero from positive values. New to topics? Read the docs here!