Question
Comparative Programming Languages (a) Discuss to what extent a programmer can expect a program that conforms to a standard to generate identical results when run
Comparative Programming Languages (a) Discuss to what extent a programmer can expect a program that conforms to a standard to generate identical results when run under different conforming compilers on different machines. [6 marks] (b) ALGOL 46 provided call by value and call by name, Pascal provided call by value and call by reference, and ALGOL-W provided a variety of calling methods including call by result and call by value-result. TLBs and caches are examples of content-addressable memories (CAMs). (a.i) What is the principal difference between a CAM and a RAM? [5 marks] (b.i) What is the difference between fully associative, set associative and direct mapped lookup? [6 marks] (c.i) Why are TLBs always much smaller than caches? [4 marks] (d.i) Which of the lookup mechanisms in part (b.ii) is usually used for a TLB and why aren't the other mechanisms usually used? [5 marks] 5 ECAD Consider the following mysterious Verilog module. module mystery(c,r,a,s); input c,r,a; output [3:0] s; reg [3:0] s; always @(posedge c or posedge r) if(r) s<=0; else begin if(a && (s<7)) s<=s+1; else if(!a && (s>0)) s<=s-1; end endmodule (a.ii) How many flip-flops will be required to implement the mystery module, and how will signals c and r be connected to these flip-flops? [9 marks] (b.ii) What is the state transition diagram for this mystery module? [5 marks] (c.ii) If this module were synthesised to the minimum sum of products form, what would the equations be for next state bits Explain how it does this.With the three datasets you have decided to use multiple tools in your Hadoop environment, an external hive table called "Company" in the default database using Company_data.csv , use a separate folder for file in HDFS. After Completing your hive table make sure you can access it, secondly upload the Company_Emp_data.csv and the Sales_data.csv to a HDFS folder. Write brief notes on functions as values and results in ML, illustrated with the help of the functionals map and exists. What functions can we obtain from these via currying? [6 marks] (b) Consider the function zarg defined below: fun zarg f ([], e) = e | zarg f (x::xs, e) = f(x, zarg f (xs,e)); Show that with the help of this function, it is possible to an expression for the sum of a given list of integers. Then describe what zarg does in general. [4 marks] (c) A polymorphic type of branching trees can be declared as follows. Note that the children of a branch node are given as a list of trees, and that only the leaf nodes carry labels. datatype 'a vtree = Lf of 'a | Br of ('a vtree) list; (i) Write function flat t that converts a given tree t of this type to a list of the labels (without eliminating duplicates). Your function should run in linear time in the size of the tree. [4 marks] (ii) Write function counts x t that counts the number of times that x occurs as a label in t, but without first converting t to a list.s[02], s[121] and s[123]? [11 marks] 10 Data Structures and Algorithms (a.iii) Describe how the Lempel Ziv text compression algorithm works, illustrating your answer by deriving the sequence of numbers and corresponding bit patterns it would generate when applied to a string starting with the following 24 characters:You should discuss the issue of admission control, and comment on the data structures that an implementation would need to maintain and on how these would be used to make scheduling decisions.are a data structure protected by a mutual exclusion lock. (i) What scheduling problem could arise here? [2 marks] (ii) How could this problem be overcome? [2 marks] (d) The designer also wishes the real-time system to use demand paged virtual memory for efficiency. Explain your answer. [4 marks] (c) In the process of using functional dependencies to normalise a schema, what is meant by a lossless join decomposition and how is such a decomposition guaranteed? [4 marks] (d) In schema normalisation, is Boyce-Codd Normal Form (BCNF) always to be preferred over 3rd Normal Form (3NF)? Explain your answer. [4 marks] 7 (TURN OVER) CST.2014.4.8 7 Economics, Law and Ethics (a) Describe the provisions of the Data Protection Act. [8 marks] (b) You are designing and are about to launch a mobile phone app which will seek to understand the emotional condition of the user, using multiple inputs such as motion sensing, facial expression recognition, voice stress measurement and the analysis of entered text. Its declared purpose is to enable services to interact more empathically with users. Discuss to what extent a programmer can expect a program that conforms to a standard to generate identical results when run under different conforming compilers on different machines. [6 marks] (b) ALGOL 60 provided call by value and call by name, Pascal provided call by value and call by reference, and ALGOL-W provided a variety of calling methods including call by result and call by value-result. Briefly describe the calling mechanisms just mentioned and discuss why most modern programming languages provide only call by value. [8 marks] (c) Discuss the reasons why languages such as Fortran, Algol and PL/I designed in 1950s and 1960s are less widely used than languages designed in the last 202 years.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started