Question
Disadvantages 1. High storage requirement: exponential with tree depth. Depth-first search A search strategy that extends the current path as far as possible before backtracking
Disadvantages 1. High storage requirement: exponential with tree depth. Depth-first search A search strategy that extends the current path as far as possible before backtracking to the last choice point and trying the next alternative path is called Depth-first search (DFS). Object n = new Integer(42), o = new String("DATAs"); 21. 4 Computer Graphics and Image Processing (a) Describe the limitations of human vision in terms of: (i) spatial resolution (ii) luminance (iii) colour and explain the implications that each of these limitations has on the design of display devices. [10 marks] (b) In image compression we utilise three different mechanisms to compress pixel data: (i) mapping the pixel values to some other set of values (ii) quantising those values (iii) symbol encoding the resulting values Explain each mechanism, describe the way in which it helps us to compress the image, and describe in what way it affects the visual quality of the resulting (decompressed) image when compared with the original. [10 marks] SECTION B 5 Comparative Programming Languages (a) Outline the main innovations that are in Simula 67 but were not in Algol 60, paying particular attention to Simula Classes. [6 marks] (b) Illustrate how Simula can be used to simulate a small restaurant with six tables, two waiters and small groups of customers arriving at random intervals. You need specify only the classes you would define. Most of the algorithmic details may be omitted. [6 marks] (c) Discuss to what extent Simula has been made redundant by the development of modern object-oriented languages such as Java.
Databases (a) Explain how to describe the structure of a collection of data using entities, attributes and relationships. [6 marks] (b) How would you identify particular instances of data in order to record the information in a database? Illustrate your answer by considering both a relational database maintained using SQL-92 and an ODMG database. [6 marks] (c) A high street bank has just announced a merger with a nationwide building society. You are employed as a consultant to advise on the integration of their client databases. Both institutions use relational databases. Write brief notes to alert the database administrators to the difficulties that they may encounter. [8 marks] SECTION C 9 Semantics of Programming Languages (a) The integer expressions E of a programming language are given by E ::= n | X | E | E + E where n ranges over integer constants and X ranges over identifiers. Explain the principle of structural induction for proving that some property (E) holds for all integer expressions E. [5 marks] (b) Taking states to be finite partial functions mapping identifiers to integer constants, define a relation E, s n giving the result n (if any) of evaluating integer expression E in state s. [7 marks] (c) Use structural induction to prove that if E, s n1 and E, s n2 both hold, then n1 = n2. [Hint: Consider the property (E) given by s, n1, n2((E, s n1) & (E, s n2) n1 = n2).] [7 marks] (d) What property of the pair E, s ensures that there is some n for which E, s n holds?
A novice SystemVerilog programmer has written the following decimal counter module which should zero the decimal_count on reset and then, when enabled, increment modulo 10 the decimal_count on every positive clock edge. module count_decimal_wrong( input logic clk; input logic reset; input logic enable; output logic decimal_count); always_comb @(posedge clk or reset) if(enable) begin decimal_count = decimal_count+1; if(decimal_count>9) decimal_count = 0; end elsif(reset) decimal_count = 0; endmodule // count_decimal_wrong (a) What bugs exist in the code and how can they be rectified? [10 marks] (b) SystemVerilog synthesis tools use a Boolean optimiser to simplify the implementation logic. (i) Why are don't care terms useful for Boolean optimisation? [3 marks] (ii) How could the SystemVerilog be modified to introduce don't care terms for unreachable states above 9? [3 marks Suppose that an Entity-Relationship model has been constructed that contains two entities S(A, and T(C, Amount), where A, B, C and Amount are attributes and the underline indicates a key. Suppose that we also have a many-to-many relationship R between S and T. We might expect that this model would be implemented in a relational schema such as S(A, B), T(C, Amount), and R(A, C). However, the database implementor has noticed that a very common and expensive query is this: given an A-value a, find the sum of all Amount values for records in T related to this a value in S. Therefore, the implementor has decided to "optimise" the database and replace table S with S 0 having schema S 0 (A, B, Sum), where the records in table S 0 will contain the precomputed values for this query. In this way the common and expensive query can be answered by a single key-based read.
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