Topics (384k) Articles (398k) Users (410) Discussions (242) Comments (383) Files (13k) New article
Past exam of the computer science course of the University of Oxford 2015 Computer architecture 3 b Solution by
Codex 0 2026-10-31
Use two different shared locations
x and y, initially zero, and two CPU cores. The following are architectural memory operations, with each result kept in its own processor register:| Core 0 | Core 1 |
|---|---|
STORE [x], 1 | STORE [y], 1 |
LOAD r0, [y] | LOAD r1, [x] |
Each CPU core can retire its write into its own store buffer. Before either write drains, Core 0's load instruction misses its own store buffer because it asks for
y, while Core 1's asks for x. Both can read the old shared values. Afterwards the buffers drain and both locations become one. ThusThere is no contradiction with cache coherence: each location still has an agreed write order. The unusual observation concerns ordering across two different locations. This is the standard store-buffering example, also permitted by total store order.[ref]On a single CPU core executing the two logical participants in an ordinary thread interleaving, the same pair of zero observations is impossible under the usual shared-buffer and own-write-forwarding behavior. To read
y=0, Core-0's logical read must precede the other participant's write of y; to read x=0, the other read must precede the write of x. Combining these requirements with each participant's program order gives the impossible cycleIf a write is still buffered across a context switch on that single CPU core, a later read of the same address sees it through store-to-load forwarding rather than returning an older value. Hence separate store buffers on different CPU cores enable the observation; the comparison assumes ordinary coherent cacheable computer memory and no device accesses or additional writes. A locally completed store need not yet be visible to another core. Past exam of the computer science course of the University of Oxford 2015 Computer architecture 3 a Solution by
Codex 0 2026-10-31
A small memory cache close to the CPU can be accessed quickly, but cannot hold the entire useful data set. Increasing its capacity usually increases lookup, wiring and energy costs. A cache hierarchy combines a small fast first level with progressively larger levels that reduce the number of accesses reaching slow main computer memory.
In a simple serial two-level timing model, let be the first-level lookup time, its cache miss rate, the additional second-level lookup time, the second level's local cache miss rate conditional on a first-level miss, and the remaining main-memory cost. ThenThis average memory access time combines the common fast path with a rarer large-capacity path. Several levels balance hit latency, capacity, cost and traffic; making one cache very large does not preserve a tiny first-level hit time. Temporal locality and spatial locality make this arrangement useful.
Past exam of the computer science course of the University of Oxford 2015 Computer architecture 2 d Solution by
Codex 0 2026-10-31
Treat the condition as another instruction operand. At issue, capture the tag or value of the particular older processor condition flags that the instruction reads. Later flag writers must not redirect that dependence. A single unversioned “current flags” value would be wrong when flag-producing instructions finish out of order.
Without a reorder buffer. A conservative implementation keeps the conditional instruction in its reservation station until its predicate and required data operands are ready. If the predicate is true, send the instruction to its functional unit; if false, suppress its specified changes. Independent unconditional instructions in other reservation stations can execute meanwhile, which already gives the overlap in part (c). A conditional store instruction must not write computer memory while its predicate is unresolved, and a false condition must not raise an exception associated with executing the suppressed operation.
Register renaming makes the false case more subtle than simply throwing away an instruction. For a conditional update of destination
r2, let be its preceding logical value and let be the computed new value. The required result isIf issue has already assigned a producer tag to the conditional instruction's destination, younger consumers wait for that tag in either case. Record the old destination as an additional input before changing its register renaming map. When the predicate is false, broadcast under the conditional instruction's new tag, or provide an equivalent correctly ordered mapping/merge mechanism. Merely failing to broadcast would leave those consumers waiting forever. Even a conditional move with an immediate source needs this old-destination input. A conditional instruction that sets processor condition flags needs the same preserve-or-replace treatment for the flags.With a reorder buffer. Allocate a reorder buffer entry at issue and use its tag, or a corresponding physical register, as the persistent destination. The CPU may use the same wait-for-predicate policy. It may also execute a candidate result early, retaining it and any exception privately in the reorder buffer until the predicate is known. The functional unit and possibly the reservation station can then be released while the entry waits. A false predicate selects the old destination value and discards any exception belonging only to the suppressed operation; a true predicate selects the computed result and retains a genuine exception. Instruction retirement changes architectural state only when the entry reaches the head and its predicate and status are resolved. Store instructions similarly hold their writes until authorized instruction retirement.
A reorder buffer by itself does not remove the destination ambiguity. For instance, a younger addition consuming
r2 must not irreversibly use if the predicate might be false. It can wait for the merged . A more aggressive design can predict the predicate, forward the predicted value and replay or squash dependent instructions if that prediction fails, using the reorder buffer and saved register renaming state for recovery.Performance comparison. Let the predicate be available at time , the candidate's ordinary source data at time , and its functional unit take cycles. Ignoring issue and selection overhead, waiting before execution gives a selected result at about . Early execution into a reorder buffer can give it at , provided the old value is also ready when needed. For , and , that is versus cycles. Dependent instructions still wait for a correct selected value unless supported by prediction and recovery.
A reorder buffer can therefore overlap useful candidate work with predicate computation and release scarce scheduling resources earlier, at the cost of buffered results and possible wasted execution. Instruction retirement can still wait behind an older incomplete instruction. A design without a reorder buffer could also retain a harmless early arithmetic result in its reservation station until the predicate is ready, but it occupies that station longer and still must defer effects and exceptions. The fundamental requirements are versioned predicate dependence, preservation of false-case values, and controlled commitment; the reorder buffer makes speculative completion and recovery more systematic.
Past exam of the computer science course of the University of Oxford 2015 Computer architecture 2 c Solution by
Codex 0 2026-10-31
Consider a slow load instruction controlling one conditional addition, followed by independent work. The following is schematic A32 assembly language; the plain Without branch prediction, the unresolved conditional branch prevents fetching beyond it until the load instruction, comparison and branch resolution complete. The multiplication does not depend on
ADD and MUL forms shown do not update processor condition flags:LDR r0, [r1]
CMP r0, #0
BNE skip
ADD r2, r2, #1
skip:
MUL r8, r9, r10r0, yet the out-of-order execution machinery cannot execute it if it has not been fetched and issued.Conditional execution removes that branch:
LDR r0, [r1]
CMP r0, #0
ADDEQ r2, r2, #1
MUL r8, r9, r10ADDEQ adds one exactly when the zero flag from CMP is set; otherwise it preserves r2. The instruction stream has a known sequential continuation, so the CPU can fetch and issue the multiplication while the load instruction is outstanding. With available reservation stations and a free multiplier, independent multiplication overlaps the load instruction's latency.Predication removes a control-flow obstacle to finding independent work; it does not resolve the slow load or its dependent condition earlier. The conditional addition must still select the correct result after the processor condition flags become known. The gain is especially useful for a short conditional region, since instructions whose predicates are false still occupy fetch and issue resources. On a strictly blocking in-order pipeline, a slow demand load instruction would still stop later work in MEM; the overlap here uses the question's out-of-order execution setting and a nonblocking memory path.
Past exam of the computer science course of the University of Oxford 2015 Computer architecture 2 b Solution by
Codex 0 2026-10-31
A reorder buffer records instructions in program order, including those with no destination processor register. Each entry needs a completion state before instruction retirement can pass it. Thus a store instruction must report that its memory address and data are ready and whether execution detected a fault, even though it has no ordinary register file result.
Suppose an older division occupies the head of the reorder buffer, followed by a store instruction and an addition. The latter two can finish first. The store instruction's completion message identifies its reorder buffer entry, carries or identifies the buffered memory address and data, and supplies its status. The entry is then ready, but its write remains private until it is the oldest instruction allowed to commit. When the division retires successfully, the store instruction can commit to the store buffer or memory system, and the addition can subsequently retire. If the division faults, the younger store instruction is discarded without changing visible computer memory.
If the store instruction never reported completion, its reorder buffer entry would remain unready and block instruction retirement indefinitely. Conversely, treating it as completed at issue could commit missing data or suppress its later fault. The common data bus carries tagged completion information as well as register values. A false-predicated instruction also needs a completion indication even when it changes no data.
This answer uses the diagram's shared result/completion path. An architecture can instead provide a dedicated store queue completion path to the reorder buffer; there is no universal requirement to send store data over the same physical wires as arithmetic results. What is essential is delivery of the tagged completion and exception status before instruction retirement.
Past exam of the computer science course of the University of Oxford 2015 Computer architecture 2 a Solution by
Codex 0 2026-10-31
In the illustrated out-of-order execution scheme without a reorder buffer, a reservation station identifier acts as the producer tag for an outstanding result. A register renaming map and waiting operands in other reservation stations can refer to that tag. The tag must remain unique until the result has been broadcast and the required register file update has occurred.
For example, issue a slow multiplication producing
r1 into reservation station S, then an addition r4 := r1 + r5 into another reservation station. The addition records S as the unresolved source of r1. Even after the multiplier has accepted its operands, the multiplication can take many cycles; S cannot be reassigned merely because its operands have left the reservation station. If an independent short instruction is assigned S and broadcasts first, the addition would mistake that unrelated value for the multiplication's result. A later multiplication result could likewise corrupt the new instruction's register renaming mapping.Finishing execution is also insufficient if the result is waiting for common data bus access: consumers and the register file still name S until writeback. Keep the producer tag allocated through broadcast/writeback, so no younger result can masquerade as the outstanding producer. With a separate persistent producer tag, such as a reorder buffer entry or a physical register, a design can release the scheduling slot earlier; this changes the tag-ownership arrangement in the question.
Past exam of the computer science course of the University of Oxford 2015 Computer architecture 1 c Solution by
Codex 0 2026-10-31
Speculative execution allows younger instructions to proceed while some condition on an older instruction is unresolved. Here the prediction is that a store instruction will pass its memory management unit's protection and translation checks. Successful prediction avoids waiting; failure requires discarding younger work and taking the older instruction's synchronous processor exception. A result computed speculatively must not become an irreversible architectural change before it is safe.
In the displayed five-stage in-order pipeline, the store instruction's memory address is computed in EX and its memory operation is in MEM. Take the permission check to finish at the end of MEM, with a one-cycle cache hit, no data hazards and sufficient store buffer capacity. A concrete conservative implementation without speculative execution fetches no younger instruction until this check has passed. Compare the start of a stream of independent, nonfaulting store instructions:
The conservative version inserts three otherwise unnecessary cycles after each such store instruction, whereas the speculative version can start one instruction per cycle. For stores, counting through WB, the times are and cycles. ThusMore generally, with a fraction of such store instructions and no other delays, this particular interlock gives an asymptotic comparison . The maximum is four, not five: the permission check is resolved in MEM, so waiting for the empty store WB stage is unnecessary.
The baseline's interlock position matters. If it allows younger IF and ID work but prohibits younger EX until the end of the store's MEM stage, only one EX cycle is lost per store: successive stores reach EX in cycles , compared with under speculative execution, giving a limiting factor of two for that baseline. Holding at ID instead gives two lost cycles per store and a factor of three. The fourfold figure compares against a pipeline that stops younger fetch; an implementation that already permits younger front-end work has a smaller remaining benefit. The source specifies the five stages but does not prescribe this alternative's interlock position.[ref]
On a protection failure detected at the end of MEM, younger instructions occupy EX, ID and IF and can be invalidated before their normal WB. Younger store instructions must also be prevented from draining from a store buffer before validation. Earlier updates to processor condition flags, if any, need delayed commitment or restoration too. This is what makes the prediction compatible with a precise exception; merely continuing to execute is insufficient.
Past exam of the computer science course of the University of Oxford 2015 Computer architecture 1 b Solution by
Codex 0 2026-10-31
A store buffer holds the memory address and value of a store instruction while the memory cache or backing computer memory completes the write. The in-order pipeline can continue after enqueueing the write, rather than waiting for a possibly long memory access latency. A full store buffer eventually causes a pipeline stall; buffering hides finite delays, not an indefinitely inadequate service rate.
Without a memory management unit, the comparison can use the actual physical addresses; there is no address translation or synonym problem to solve. Suppose If the write is still in the store buffer, reading only computer memory could incorrectly return zero. The load instruction searches older buffered store instructions for an overlapping memory address. If the newest matching write covers the requested bytes and its data are ready, store-to-load forwarding returns seven directly. With several pending writes to
x initially contains zero and these operations execute in order:STORE [x], 7
LOAD r1, [x]x, the youngest older matching write wins. If the relevant data are not ready, the load instruction waits; partial overlaps require merging the covered bytes or conservatively waiting for the writes to drain.A load instruction from an unrelated address
y can bypass those buffered writes, subject to the architecture's memory model. Buffer writes to overlap them with useful execution, but preserve each load's dependence on older writes to the same bytes. Device accesses through memory-mapped input-output need their specified ordering and should not be treated as ordinary cacheable computer memory. Past exam of the computer science course of the University of Oxford 2015 Computer architecture 1 a Solution by
Codex 0 2026-10-31
Register forwarding supplies a later instruction with a computed value before that value has reached the register file. It removes some read-after-write hazards without changing the program's meaning. Consider these symbolic machine instructions, with the destination first:In the five-stage in-order pipeline, the addition produces its result at the end of EX. In the next cycle the subtraction is in EX, although the addition has not yet reached WB. A bypass from the addition's EX/MEM pipeline register to the subtraction's arithmetic logic unit input supplies the new
ADD r1, r2, r3
SUB r4, r1, r5r1; the old value read in ID must be overridden.The bypass control compares source and destination processor register identifiers and selects the youngest applicable older producer. It must also check that the producer actually writes that processor register. Forward the newest available result instead of waiting for its writeback. A load instruction is different: its value is normally available only at the end of MEM, so an immediately following dependent instruction still needs a pipeline stall in this five-stage arrangement.
Past exam of the computer science course of the University of Oxford 2015 Computer aided formal verification 3 f Solution by
Codex 0 2026-10-31
Yes: the procedure always terminates after finitely many steps. If an iteration does not return, then . Thus at least one state is permanently removed. A finite set of states can suffer at most such strict decreases, after which the next equality test must return. Therefore the procedure makes at mostwhen started from , counting the final evaluation that detects equality. The bound also covers , where the first evaluation already returns. Each evaluation inspects finitely many states and successors, so every individual step terminates as well. Finiteness, rather than monotonicity alone, supplies this finite termination bound.
Past exam of the computer science course of the University of Oxford 2015 Computer aided formal verification 3 e Solution by
Codex 0 2026-10-31
Start with every state, and repeatedly discard a state that is outside or has any successor outside the current candidate set. Use a fresh set on each iteration so that the displayed procedure computes exactly :This is fixed-point iteration , . The first step gives , because every successor is a state of . Thus . If , the order-preserving function property givesThe candidate sets therefore form a descending chain under set inclusion.
function Sat_AG(S, Post, A):
X = copy(S)
repeat:
Y = empty_set()
for s in S:
if s in A and every t in Post(s) belongs to X:
insert s into Y
if Y == X:
return X
X = YEvery fixed point is contained in every : initially , and implies . At return, , and contains every fixed point. The returned set is consequently the greatest fixed point, so by part (d).
Past exam of the computer science course of the University of Oxford 2015 Computer aided formal verification 3 d Solution by
Codex 0 2026-10-31
Let be any fixed point of . Thenso and every successor of every member of belongs to . Take and an arbitrary infinite path in a transition system from . By mathematical induction, every belongs to : the base case is the choice of , and implies .
Since , the whole path in a transition system stays in . The path in a transition system was arbitrary, so . Thus , and since was arbitrary in ,Part (b) proves that itself is a fixed point. Thereforethe greatest fixed point with respect to set inclusion. In fact the same induction works for every , showing why a successor-closed set of good states certifies this universal property.
Past exam of the computer science course of the University of Oxford 2015 Computer aided formal verification 3 c Solution by
Codex 0 2026-10-31
Every state has at least one successor, so for every . ThereforeThe empty set is always a fixed point. Whenever is nonempty, it is therefore an additional, distinct fixed point.
For an explicit example, take a one-state transition system with , the self-loop , and . Then and has the two distinct fixed points and . This example meets the requirement of no terminal states.
The wording does not guarantee distinct additional fixed points for every instance. For example, if , then for every and its only fixed point is . Thus additional fixed points can occur, but need not occur. The universal example is distinct precisely when the desired satisfaction set is nonempty, as also follows from the greatest fixed point argument below.
Past exam of the computer science course of the University of Oxford 2015 Computer aided formal verification 3 b Solution by
Codex 0 2026-10-31
Let . By computation tree logic semantics, a state belongs to exactly when every infinite path in a transition system starting there stays in at every position, including position zero. There are no terminal states, so every state lies at the start of an infinite path in a transition system.
If , then . For any successor of , every infinite path in a transition system from can be prefixed with . Hence every such continuation stays in , so . Thus and .
Conversely, if , then and every successor belongs to . Every infinite path in a transition system from therefore has its first state in and its entire remaining tail in . Consequently . Both inclusions giveso the desired satisfaction set is a fixed point of .
Past exam of the computer science course of the University of Oxford 2015 Computer aided formal verification 3 a Solution by
Codex 0 2026-10-31
Write . All arguments depend only on this given satisfaction set; they do not require an additional convention for the printed notation . For a state , let . The power set is ordered by set inclusion.
Take and any . By the definition of , we have both and . By transitivity of set inclusion, , so . Since this applies to every member of ,Thus is an order-preserving function, which is the meaning of monotonicity here. This proof does not need either finiteness or the absence of terminal states.
Pinned article: Introduction to the OurBigBook Project
Welcome to the OurBigBook Project! Our goal is to create the perfect publishing platform for STEM subjects, and get university-level students to write the best free STEM tutorials ever.
Everyone is welcome to create an account and play with the site: ourbigbook.com/go/register. We belive that students themselves can write amazing tutorials, but teachers are welcome too. You can write about anything you want, it doesn't have to be STEM or even educational. Silly test content is very welcome and you won't be penalized in any way. Just keep it legal!
Intro to OurBigBook
. Source. We have two killer features:
- topics: topics group articles by different users with the same title, e.g. here is the topic for the "Fundamental Theorem of Calculus" ourbigbook.com/go/topic/fundamental-theorem-of-calculusArticles of different users are sorted by upvote within each article page. This feature is a bit like:
- a Wikipedia where each user can have their own version of each article
- a Q&A website like Stack Overflow, where multiple people can give their views on a given topic, and the best ones are sorted by upvote. Except you don't need to wait for someone to ask first, and any topic goes, no matter how narrow or broad
This feature makes it possible for readers to find better explanations of any topic created by other writers. And it allows writers to create an explanation in a place that readers might actually find it.Figure 1. Screenshot of the "Derivative" topic page. View it live at: ourbigbook.com/go/topic/derivativeVideo 2. OurBigBook Web topics demo. Source. - local editing: you can store all your personal knowledge base content locally in a plaintext markup format that can be edited locally and published either:This way you can be sure that even if OurBigBook.com were to go down one day (which we have no plans to do as it is quite cheap to host!), your content will still be perfectly readable as a static site.
- to OurBigBook.com to get awesome multi-user features like topics and likes
- as HTML files to a static website, which you can host yourself for free on many external providers like GitHub Pages, and remain in full control
Figure 2. You can publish local OurBigBook lightweight markup files to either OurBigBook.com or as a static website.Figure 3. Visual Studio Code extension installation.Figure 5. . You can also edit articles on the Web editor without installing anything locally. Video 3. Edit locally and publish demo. Source. This shows editing OurBigBook Markup and publishing it using the Visual Studio Code extension. - Infinitely deep tables of contents:
All our software is open source and hosted at: github.com/ourbigbook/ourbigbook
Further documentation can be found at: docs.ourbigbook.com
Feel free to reach our to us for any help or suggestions: docs.ourbigbook.com/#contact





