What is a function calling convention and how does it impact the… What is a function calling convention and how does it impact the design of the RISC-V instruction set architecture (ISA)? [4 marks] (d) Consider the following C function that computes the greatest common divisor, and the assembler produced by the compiler. The assembler has been split into segments. Describe what function each segment performs(a) Explain the terms Work Conservation and max-min fairness, in the context of packet switching. [8 marks] (b) Outline the operation of two work-conserving queueing schemes that provide max-min fairness, and two (simpler) ones that do not. [8 marks] (c) Give at least two main implementation costs associated with implementations of fairness in packet switched routers. [4 marks] 3 Security (a) Describe the Bell-LaPadula security policy. [6 marks] (b) Describe the Chinese Wall security policy. [6 marks] (c) To what extent is the Chinese Wall policy an extension of Bell-LaPadula? [6 marks] (d) Are either of these policies relevant to digital rights management? [2 marks] 2 CST.2003.7.3 4 Advanced Graphics (a) We want to find the first intersection point between an arbitrary ray and a sphere of arbitrary radius at an arbitrary position in space. (i) List and define all of the parameters required to specify the geometry of the ray and the sphere. [2 marks] (ii) Give an algorithm which returns the desired intersection point (if it exists) and the appropriate normal vector at the intersection point. [5 marks] (b) Describe a method which converts an arbitrary sphere to a triangle mesh at a desired resolution. The desired resolution is specified as a desired number of triangles, D. Your method should produce a number of triangles, N, which is within an order of magnitude of D: D/10 < N < 10D. [4 marks] (c) The Catmull-Clark bivariate subdivision scheme is a bivariate generalisation of the univariate 1 8 [1, 4, 6, 4, 1] subdivision scheme. It creates new vertices as blends of old vertices in the following ways: 16 64 16 64 16 64 16 64 4 64 24 64 4 64 4 64 24 64 4 64 6 64 36 64 6 64 1 64 6 64 1 64 1 64 6 64 1 64 Face Edge Vertex (i) Provide similar diagrams for the bivariate generalisation of the univariate four-point interpolating subdivision scheme 1 16 [-1, 0, 9, 16, 9, 0, -1]. [5 marks] (ii) Explain what problems arise around extraordinary vertices (vertices of valency other than four) for this bivariate interpolating scheme and suggest a possible way of handling the creation of new edge vertices when the old vertex at one end of the edge has a valency other than four. [4 marks] 3 [TURN OVER CST.2003.7.4 5 Computer Systems Modelling Let N(t) denote the number of events in the time interval [0, t] for a (homogeneous) Poisson process of rate ?, (? > 0). (a) State the necessary properties on N(t) that define a (homogeneous) Poisson process of rate ?. [4 marks] (b) By dividing the interval [0, t] into equal length sub-intervals show that N(t) is a Poisson random variable with mean ?t. [4 marks] (c) Let X1 denote the time of the first event and for n > 1 let Xn denote the elapsed time between the (n – 1)th and the nth events of the Poisson process. Determine the distribution of X1 and the joint distribution of X1 and X2. [4 marks] (d) Let Sn = Pn i=1 Xi denote the time of the nth event. Derive the probability density function of the random variable Sn(t). [4 marks] (e) Give an algorithm to generate the first T time units of a (homogeneous) Poisson process of rate ?. [4 marks] 6 Specification and Verification I (a) Explain the difference between a variant and an invariant. Briefly describe what they are used for. [4 marks] (b) State and justify the verification conditions for the total correctness of WHILE commands. (b) Define a predicate JK such that JK(j,k,q) models the behaviour of a JK flipflop. Describe and justify the logical type of JK. (c) Write down a formal specification of a device COUNT such that the output attime t is t mod 4.(d) Design an implementation of COUNT using JK flip-flops, describe how it worksand draw a diagram of your design.(e) How you would prove that your design meets its specification? Consider alternative algorithms for sorting an array of n items.(a) The BST-sort algorithm looks at each element of the array in turn, starting atposition 0, and inserts it into a BST (pass 1). Having processed all elements, itrepeatedly extracts the minimum from the BST, refilling the array from position0 onwards (pass 2).(i) Derive, with justification, the computational complexity of each of the twopasses of BST-sort.(ii) Describe a way of asymptotically speeding up pass 2 without changingthe data structure, yielding enhanced BST-sort, and give the newcomputational complexity of pass 2 and of the overall algorithm.(iii) Compare enhanced BST-sort against heapsort, mergesort and quicksortwith respect to asymptotic worst-case time and space complexity, sayingwhen (if ever) it would be preferable to any of them.(b) The enhanced 2-3-4-sort algorithm is obtained by replacing the BST with a2-3-4 tree in enhanced BST-sort.(i) Perform pass 1 of enhanced 2-3-4 sort on the array {6,9,3,1,4,3,6,7,5,0,2},redrawing the tree at each insertion. [Hint: Remember to split 4-nodes onthe way down when inserting, and to put = keys in the left child and > inthe right.](ii) How much space will enhanced 2-3-4-sort require to sort an array of n items,if each item is m bits long? Give exact upper and lower bounds in termsof n and m rather than an asymptotic estimate. [3 marks](iii) Repeat question (a)(i) for enhanced 2-3-4-sort. [2 marks](iv) Repeat question (a)(iii) for enhanced 2-3-4-sort. (a) State carefully, without proof, the soundness and adequacy results for PCF.(You need not describe the syntax, operational and denotational semantics ofPCF in any detail.) [3 marks](b) Define the logical relation you would use in proving adequacy for PCF. Statecarefully without proof the “fundamental theorem” for the logical relation.[5 marks](c) Define contextual equivalence for PCF. [2 marks](d) Explain carefully the difficulties in obtaining a fully abstract denotationalsemantics for PCF. [7 marks](e) Describe how PCF syntax and operational semantics can be extended to obtainfull abstraction A program which decrypts files under the Swap Encryption Scheme by swappingpairs of characters is given below. Some code has been omitted and you do not needto understand the operation of the algorithm.1 class Swapper extends Reader {2 private final PushbackReader pushBack;3 Swapper(PushbackReader p) { pushBack = p; }45 @Override6 public int read(char[] cbuf, int off, int len) {7 int r = wrap.read(cbuf, off, len);8 if (r % 2 == 1) { pushBack.unread(cbuf, off + –r, 1); }9 for (int i = 0; i < r; i += 2) { swap(cbuf, i, i + 1); }10 return r;11 }12 }1314 class Decryptor {15 static List

Don't use plagiarized sources. Get Your Custom Essay on

Top answer: What is a function calling convention and how does it impact the…

Just from $10/Page