explicate the operation and gate level circuit of a multiplexer. How may it be used in conjunction
Question:
explicate the operation and gate level circuit of a multiplexer. How may it be used in conjunction with a demultiplexer to establish alternative connections across a unidirectional path between two modules? What is involved in extending the method to allow a bidirectional path between two (or more) modules? What do you understand by the terms bus, master, slave in connection with your circuit? 2 Design a divide-by-three counter using T-ty pe flipflops. 3 Explain the Synchronization Problem which affects the operation of certain logic circuits. How should circuits be designed to minimize or avoid the problem? 4 Give a qualitative explanation of current flow across a p-n junction in a semiconductor diode. Why is there a depletion layer in the immediate vicinity of the junction? 1
SECTION B 5 Give an ML definition of the function map3 which has the property that map3 f [x1, x2, . . . , xn] = [f 0 x1 x2, f x1 x2 x3, . . . , f xn1 xn 0] and deduce the type of map3. The function map3iter is defined as follows: fun map3iter (0:: ) = 0 | map3iter g x = 1 + map3iter g (map3 g x); Deduce the type of map3iter and explain in words what the function does. Illustrate your answer by considering the call map3iter g [1, 1, 1, 1, 1, 1]; in an environment in which g is defined as follows: fun g 0 1 = 2 | g 1 1 = 1 | g 2 1 = 2 | g 2 0 = 0 | g n = n; 6 The structure of a binary tree containing integers at some of its leaves is given by the ML datatype T defined as follows: datatype T = X | N of int | D of T*T; Define a function filter of type (int -> bool) -> (T -> T) with the property that the call filter p t will yield a simplified copy of t by repeated application of tree rewrite rules: D(X,a) -> a D(a,X) -> a on the tree obtained from t by replacing all leaf nodes of the form N k for which p k yields true by x. Thus, for example: filter (fn n => n=0) should yield a function that converts D(D(N0,N0), D(D(N2,N0), N3)) to D(N2,N3). 2 CST.93.1.3 7 State carefully what it means to say that a function has time complexity O(f(n)), and give ML definitions for some example int ->int functions which have time complexities O(log n), O(n), O(n 2 ), O(n 3 ). In what circumstances can a function have time complexity O(1)?
Estimate the time complexities of the functions f1, f2 and f3 defined below: fun f1 0 = 1 | f1 n = 1 + f1(n-1); fun f2 0 = 1 | f2 n = f2(n-1) + f1 n; fun f3 0 = 1 | f3 n = f3(n div 7) + f3(5*n div 7) + f1 n; 8 The structure of a binary tree with integers at the leaves is represented by the following ML datatype: datatype T = n of int | d of T*T; Define a function flatten which when given an argument t of type T will yield the list of integers obtained by a left to right walk over t. For example, flatten (d(d(n1,n2),n3)) = [1,2,3].
Define a function splits which, when given a list of length n > 0, will yield the list of 2-tuples representing the n1 ways of splitting the given list into two non-empty sublists. For example, splits [1,2,3] = [ ([1], [2,3]), ([1,2], [3]) ]. Hence or otherwise define a function alltrees which, when given a list of length n > 0, will form a list of all the trees of type T that will flatten to the given list. For example, alltrees [1,2,3] = [ d(n1, d(n2, n3)), d(d(n1, n2), n3) ].
Question: Early programming languages had relatively poor facilities for type checking, data abstraction, data hiding and encapsulation. Explain the meaning of these terms and discuss their importance. [6 marks] Outline the key features that a language must have to be called object-oriented and briefly discuss to what extent C++, Java and Smalltalk have them. [7 marks] Briefly discuss some of the reasons why C++ programs typically run faster than equivalent programs written in Java or Smalltalk. [7 marks] 6 Compiler Construction It is desired to obtain an unambiguous context-free grammar G0 which generates the same strings as the following grammar G with start symbol S. S -> E E -> ( E ) | [ E ] | E * E | a | b | c ( E ) -> ( + E ) [ E ] -> [ - E ] Define a suitable G0 or explain why G already satisfies the criterion. [6 marks] Write context-free (Type 2) grammar which describes floating-point numbers of the form []dd [.d ][e[]dd ] where d stands for decimal digit and d stands for zero or more decimal digits. [ ] means that the enclosed item is optionally present in the floating-point number. [7 marks] Sketch a recursive descent parser for the following grammar H with start symbol S. You should assume the existence of a routine lex() which sets variable token to one of '1', '2', '(', ')', '-' or eof. P -> 1 | 2 | (E) E -> P | E - P S -> E eof
Windows implements static inheritance for the access-control lists of NTFS files and folders. (i) What does static inheritance mean here and how does it differ from dynamic inheritance? [4 marks] (ii) Five flag bits (ci,oi,np,io,i) in each NTFS access-control entry (ACE) manage how it is inherited. Briefly describe the purpose of each bit. [5 marks] (iii) User mike gives his folder project the following access-control list: project AllowAccess mike: full-access (oi,ci) AllowAccess alice: read-execute (ci,np) AllowAccess bob: read-only (oi) It contains one folder and two text files, none of which have any noninherited access-control entries: project\doc.txt project\src project\src\main.c For each of these three objects, list all inherited access-control entries, showing in parentheses the inheritance-control flag bits that are set (using the same notation as above). [5 marks] (b) Describe the purpose and four typical functions of a root kit.
Given a sequence of points (Vi) n i=0 on a plane, consider the problem of interpolating a smooth curve through all of the points in order by constructing a sequence of polynomial parametric functions, one for each interval [Vi , Vi+1] n1 i=0 . (a) What is meant by Ck continuity at the junction between two curve segments? [2 marks] (b) Explain how the degree of the polynomial function for a curve segment constrains the continuity at its two ends. What continuity can be achieved at each end of a cubic segment? [4 marks] (c) Derive a cubic parametric function for the interval [Vi , Vi+1] where 0 < i < n1 Momentarily clarify the job of the attest articulation and why this program will trigger a state disappointment when executed. Supply two altered adaptations of the program that change the trade work definition and, assuming fundamental, its calls, to stay away from this state disappointment. One rendition should be in C, and the other should utilize C++ language highlights. [4 marks] (c) Describe the location space format (featuring four areas of memory) of a ordinary incorporated x86 C program, and how every one of these areas are utilized by C builds. [8 marks] (d) Briefly clarify what indistinct conduct is in the C norm. Under what circumstance(s) would calling the accompanying C capacity result in unclear conduct? int32_t divide(int32_t a, int32_t b) { return a/b; }
(a) Consider vague conduct in C. (I) Define whaonduct. [3 marks] (ii) Briefly clarify why it is critical to have undefined conduct in the meaning of the C language. [1 mark] (b) Compare and differentiation the struct and association catchphrases in C, providing an illustration of a circumstance where it would be more proper to utilize an association rather than a struct. [4 marks] (c) Explain the accompanying C or C++ language ideas. You might find it supportive to utilize short code sections or outlines to show your response. (I) The virtual catchphrase used to qualify a C++ part work and its sway on produced code. [4 marks] (ii) The job of the C preprocessor in the source-code gathering cycle, and why it is a helpful device for investigating. [4 marks] (iii) Templated capacities in C++, giving one advantage and one downside of utilizing them contrasted and involving a void* work in C.
(a) Assuming that it is mapped to a square with texture co-ordinates from (0, 0) to (1, 1), sketch a picture of the procedural texture map generated by the following Java code. Use textual annotations to indicate the colours of the various parts of the picture. [7 marks] Color BLUE = ...; Color GREEN = ...; Color WHITE = ...; Color parametricTexture(double tu, double tv) { double r1 = 2 * Math.sqrt( (tu - 0.25) * (tu - 0.25) + (tv - 0.5) * (tv - 0.5) ); double r2 = 2 * Math.sqrt( (tu - 0.75) * (tu - 0.75) + (tv - 0.5) * (tv - 0.5) ); double f = f(r1) + f(r2); return (f > 0.45 && f < 0.55) ? WHITE : GREEN.times(f).plus(BLUE.times(1 - f)); } private double f(double r) { if (0 <= r && r < 0.333) { return 1 - 3*r*r; } else if (0.333 <= r && r < 1) { return 1.5*(1-r)*(1-r); } else { return 0; } } (b) Write brief notes that explain the following. (i) Explain Perlin Noise, including how it differs from white noise. [3 marks] (ii) Explain Barycentric Co-ordinates, including how they are calculated. Diagrams are encouraged. [3 marks] (c) Given a ray R(t) = O + Dt and a unit sphere S, initially centred on the origin and subsequently transformed by affine matrix M, where M represents the transformation of the sphere from local to world coordinates: (i) state the centre of the sphere in local co-ordinates and in world co-ordinates; (ii) give an expression in terms of t for the local co-ordinates of the intersections between R and S; (iii) give an expression for the world co-ordinates of the same intersections; and (iv) give an expression for the world co-ordinates of the normal at those intersections.
(a) Describe the differences in complexity and usage between parsimony and distance phylogenetic methods. Give an example of the usage of both methods. [6 marks] (b) Describe the differences in complexity and usage between hierarchical clustering and the Markov clustering (MCL) algorithm. [5 marks] (c) Explain how to identify different gene features using Hidden Markov Model methods such as Genescan. [5 marks] (d) Explain how you could identify a regulatory network involving a set of genes.
[11:14 AM, 5/5/2022] Eagle Be.: Which situations cause Silly Window Syndrome (SWS)? What is the impact of SWS on network throughput?
(i) Objects: Files in a commercial, distributed, Internet-based le service. Policy: The owner may authorise other principals to download the le. (ii) Objects: Sales data relating to a company. Policy: Those employed in the Sales Departments of all branches of the company worldwide may read the data. (iii) Objects: Electronic health records (EHRs) in a nationwide service. Policy: The owner (patient) may read from its own EHR. A qualied and employed doctor may read and write the EHR of a patient registered with him/her. (iv) Object: The solution to online coursework. Policy: The coursework setter has read and write access. A candidate has no access until after the marks have been published.
A network-based service manages persistent objects. The service must enforce an access control policy to protect the objects. (a) Discuss how this access control might best be implemented for the following example of objects and policy components: Objects: Files in a University Department's le service, operating behind a rewall. Policy: The owner may specify read, write and execute rights in terms of principals and groups. [4 marks] (b) Discuss how this access control might best be implemented for two of the following examples: [8 marks each] (a) Describe the way in which a problem should be represented in order to allow its solution using a heuristic search technique. [5 marks] (b) Dene what it means for a search algorithm to be complete, and to be optimal. [2 marks] (c) Dene what it means for a heuristic function to be admissible, and to be monotonic. [2 marks] (d) Describe the operation of the A? heuristic search algorithm. [5 marks] (e) Prove that the A? heuristic search algorithm is optimal when applied in conjunction with a monotonic heuristic. State the conditions under which the algorithm is also complete, and explain why this is the case. [6 marks] (a) Dene formally the semi-structured data (SSD) model. [5 marks] (b) Show how SSD expressions can be expressed in XML. [2 marks] (c) What are the main dierences between the SSD and XML models? [2 marks] When viewed graphically, simple SSD expressions denote trees. Consider a variant, d-SSD, where the edges emanating from any node in the tree must have a unique label, but where the labels may themselves be d-SSD expressions. (You may disregard object identities (oids); hence d-SSD expressions always denote trees.) (d) Dene the syntax of d-SSD expressions. [3 marks] (e) Give a d-SSD expression to represent the following: (i) the array ["Do","Re","Mi"]; (ii) the set {11,52,44}; (iii) the bag {{10,10,13,42,13,10}}. [1 mark each] (f ) Dene the syntax for path expressions in the d-SSD model. [2 marks] (g) Hence describe precisely how the d-SSD model can be extended to represent graphs.
Explain what impact each of the following can have on reliability, development costs, programmer productivity and software eciency: (a) top-down renement; [4 marks] (b) the Z specication language; [4 marks] (c) loop invariants; [4 marks] (d) structural induction; [4 marks] (e) the choice of programming language for use in a project. [4 marks] You may wish to explain what the alternatives or opposites to the concept discussed are, or give brief examples. (a) Prove that if L is a regular language, its complement is also regular. [6 marks] (i) {w | w is not a palindrome} (ii) {ak | k is a multiple of 3} (iii) {ak | k is prime} [14 marks] A faulty component is drawn at random from a pile of rejects. Use Bayes's Theorem to determine the probabilities that the faulty com... [11:15 AM, 5/5/2022] Eagle Be.: Examine the following statements and indicate which are true and which are false. In most cases a simple one-word answer "true" or "false" will suffice, but, if you feel the need to make assumptions about circumstances or otherwise elaborate a little, please keep your notes as short as possible. (a) All methods in an abstract superclass must be declared abstract. (b) A class declared final cannot be subclassed. Every method of a final class is implicitly final. (c) A redefinition of a superclass method in a subclass need not have the same signature as the superclass method. Such a redefinition is not method overriding but is simply an example of method overloading.
Cornerstones of Managerial Accounting
ISBN: 978-0324660135
3rd Edition
Authors: Mowen, Hansen, Heitger