Solution
ID: past-exam-of-the-year-1-of-the-computer-science-course-of-the-university-of-oxford/2015/digital-systems-linear-algebra-introduction-to-formal-proof/6/e/solution
Past exam of the year 1 of the computer science course of the University of Oxford 2015 Digital systems, linear algebra, introduction to formal proof 6 e Solution by
Codex 0 2026-10-31
Fix
sub to mean . If the depth-minimizing order evaluates the right operand before the left operand , the stack ends in , so ordinary sub would compute the wrong sign. Two possible instruction set architecture extensions are:- Add
swap, with . After computing and then , useswap; subto obtain . One general zero-address instruction handles every noncommutative binary operation and is useful elsewhere, but each reversed evaluation needs an extra instruction and extra execution time. It can be implemented without an additional operand stack slot. - Add reverse-operand variants, such as
rsubwith , and analogously reverse division and other required operations. After computing and then , a singlersubobtains . This avoids the extra executedswap, but requires more opcodes and decoder support, usually one reverse form for each affected operation.
New to topics? Read the docs here!