Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In an interleaved fashion by switching the active thread only on a memory stall); Memory bandwidth is infinitely high in this system, but memory latency

In an interleaved fashion by switching the active thread only on a memory stall); Memory bandwidth is infinitely high in this system, but memory latency is 60 clocks. A cache hit is only 1 cycle. A cache line is 4 bytes. The cache implements a least-recently used (LsRU) replacement policy(i) Explain the Feiste principle used by block ciphers such as DES and its purpose. KGKGKGKGKGKGKG

Explain what is meant by the terms directed graph, undirected graph and bipartite graph. [3 marks] Given a bipartite graph, what is meant by a matching, and what is an augmenting path with respect to a matching? [4 marks] Prove that if no augmenting path exists for a given matching then that matching is maximal. [6 marks] Outline an algorithm based on this property to find a maximal matching, aessors exploit instruction level parallelism in order to improve throughput. (a) Control-flow processors use pipelining to improve throughput. What limits throughput in the simple 5-stage pipeline depicted below? [10 marks] instruction decode/ execute memory register fetch register fetch access write back (b) What is the principle of operation of a static data-flow processor and how does it resolve data dependencies? [10 marks] 3 Digital Communication I What is meant by the term flow control? [3 marks] What is meant by the term credit-based flow control? [4 marks] What is meant by start-stop (or XON-XOFF) flow control? [4 marks] A start-stop system is used on a 10 kbps link with a constant delay of 5 ms. How much buffer must a receiver keep in reserve for "stopping time" in order to prevent information loss? [3 marks] Which system is more appropriate to use across the Internet and why? [6 marks] 4 Computer Graphics and Image Processing Explain how a cathode ray tube (CRT) works, including details of how colour is achieved. [8 marks] Describe a run-length encoding scheme for encoding images whose pixels have eight-bit intensity values. [8 marks] Calculate the best possible compression ratio achievable with your scheme and describe the situation(s) in which this ratio would be achieved. [2 marks] Calculate the worst possible compression ratio achievable with your scheme and describe the situation(s) in which this ratio would be achieved. [2 marks] 2 CST.2000.12.3 5 Business Studies What are the differences between profit and loss and cash flow statements? [5 marks] What are the differences between debt and equity finance? [5 marks] What is an option and how might it be valued? [5 marks] Comment on the current prices of high-tech stocks. [5 marks] 6 Comparative Programming Languages Outline how you would implement complex numbers in C++. Your implementation should attempt to make complex numbers look as if they were built into the language by allowing new complex numbers to be declared, initialised, assigned and operated on by the normal arithmetic operators. [13 marks] Discuss to what extent a good C++ compiler could implement your version of complex numbers as efficiently as if they had been a primitive type in the language. [7 marks] 7 Compiler Construction Give a brief description of the main features of either Lex and Yacc or the corresponding Java tools JLex and Cup. [5 + 5 marks] Illustrate their use by outlining how you would construct a parser for expressions composed of identifiers, integers, unary minus and binary operators +, , and /. Your parser is expected to create a parse tree in a format of your choice representing the expression that is presented to it. If it helps, you may assume that expressions will be terminated by writing a semicolon after them. [10 marks] 3 [TURN OVER CST.2000.12.4 8 Prolog for Artificial Intelligence Consider the following problem to be solved using a Prolog program: Given a closed planar polygon chain represented as a list of n vertices [v(x1,y1), v(x2,y2), . . . , v(xn,yn)] compute the area of the enclosed polygon, and the orientation of the chain. The area is computed by the line integral 1/2 R x dyy dx where the integral is over the polygon chain. A nave solution is given by the following program, which defines the predicate area. The goal area(Chain,Area) succeeds when Chain is the list of vertices, and the magnitude of Area is the area of the polygon bounded by the chain. The sign of Area is positive if the orientation of the polygon is anticlockwise and negative if it is clockwise: area([X],0). area([v(X1,Y1),v(X2,Y2)|VS],Area):- area([v(X2,Y2)|VS],Temp), Area is Temp + (X1 * Y2 - Y1 * X2) / 2. Explain how vertices are processed by this procedure. [4 marks] Why does this program execute inefficiently? [3 marks] Write an alternative definition that is tail-recursive and makes use of accumulator variables. [10 marks] Explain why your alternative definition executes more efficiently.

Convert this code into JavaFX (without FXML)

code :

import java.util.HashSet; import java.util.Scanner; import java.util.Set;

public class VCApp {

public final static String STATUS_PENDING = "pending"; public final static String STATUS_1st_DOSE_APPOINTMENT = "1st dose appointment"; public final static String STATUS_1st_DOSE_COMPLETED = "1st dose completed"; public final static String STATUS_2st_DOSE_APPOINTMENT = "2st dose appointment"; public final static String STATUS_2st_DOSE_COMPLETED = "2st dose completed";

private static Set recipients = new HashSet(); private static Set vcs = new HashSet(); private static void init() { Recipient r = null; for(int i = 1; i <= 200; i++) { r = new Recipient("ABC-"+i, String.valueOf(987654321+i)); recipients.add(r); } vcs.add(new VC("VC-100", 5)); vcs.add(new VC("VC-101", 10)); } public static void main(String[] args) { init(); Scanner keyboard = new Scanner(System.in); boolean stop = false; while(!stop) {

System.out.println("Enter 1.Recipient 2.Ministry of Health (MOH) 3.Vaccination center (VC)" + " 4. Exit"); int choice = keyboard.nextInt();

keyboard.nextLine(); if(choice == 1) { recipient(); } else if(choice == 2) { moh(); }

else if(choice == 3) { System.out.print("Enter VC name: "); String name = keyboard.nextLine(); VC vc = searchVCByName(name); if(vc != null) vc(vc); }

else if(choice == 4) { stop = !stop; } else { System.out.println("Invalid Option! Try again!"); } } // keyboard.close();

} private static VC searchVCByName(String name) { for(VC v : vcs) { if(v.getName().equalsIgnoreCase(name)) { return v; } }

System.out.println("Not any VC found with name "+name); return null; }

private static Recipient searchByName(String name) { for(Recipient r : recipients) { if(r.getName().equalsIgnoreCase(name)) { return r; } }

System.out.println("Not any recipient found with name "+name); return null; }

private static void recipient() {

Scanner keyboard = new Scanner(System.in); boolean stop = false; while(!stop) { System.out.println(" Enter 1. Register 2. Sign in to check status 3. Exit");

int choice = keyboard.nextInt(); keyboard.nextLine(); if(choice == 1) {

System.out.print("Enter name: "); String name = keyboard.nextLine();

System.out.print("Enter phone: "); String phone = keyboard.nextLine();

Recipient r = new Recipient(name, phone); recipients.add(r); System.out.println("Recipient successfully registered."); }else if(choice == 2) { System.out.print("Enter name: "); String name = keyboard.nextLine(); Recipient r = searchByName(name); if(r != null) System.out.println(r); } else if(choice == 3) { stop = !stop; } else { System.out.println("Invalid Option! Try again!"); } }

// keyboard.close(); } private static void moh() {

Scanner keyboard = new Scanner(System.in); boolean stop = false; while(!stop) { System.out.println(" Enter 1. View all recipients 2. Search recipient " + " 3. Distribute vaccines 4. View statistics 5. Exit");

int choice = keyboard.nextInt(); keyboard.nextLine();

if(choice == 1) { for(Recipient r : recipients) { System.out.println(r); } } else if(choice == 2) { System.out.print("Enter name: "); String name = keyboard.nextLine(); Recipient r = searchByName(name); if(r != null) System.out.println(r); }

else if(choice == 3) { for(VC vc : vcs) { vc.setAvailable(vc.getCapacity()); } } else if(choice == 4) {

for(VC vc : vcs) { vc.viewStats(); } } else if(choice == 5) { stop = !stop; } else { System.out.println("Invalid Option! Try again!"); } } // keyboard.close(); }

private static void vc( VC vc) { Scanner keyboard = new Scanner(System.in); boolean stop = false; while(!stop) {

System.out.println(" Enter 1. View all recipients 2. Set appointment " + " 3. Update status 4. View statistics 5. Exit");

int choice = keyboard.nextInt(); keyboard.nextLine(); if(choice == 1) { vc.viewAllRecipients(); }

else if(choice == 2) { System.out.print("Enter recipient name: "); String name = keyboard.nextLine();

Recipient r = searchByName(name); if(r != null) { recipients.add(vc.setAppointment(r)); } }

else if(choice == 3) {

System.out.print("Enter recipient name: "); String name = keyboard.nextLine();

Recipient r = searchByName(name); if(r != null) { recipients.add(vc.updateStatus(r)); } } else if(choice == 4) { vc.viewStats(); } else if(choice == 5) { stop = !stop; } else { System.out.println("Invalid Option! Try again!"); } }

// keyboard.close(); }

}

Write function that takes in a root node of a trie and returns the length of the longest word stored in that trie.

Create C++ program to manage phone contacts. The program will allow the user to add new phone contacts, display a list of all contacts, search for a specific contact by name, delete a specific contact.

Write C program that will handle and organize two parallel one-dimensional arrays

Write C function to add a node to the beginning of a linked list.

Consider the following definitions of the functionals foldl and foldr: fun foldl f e [] = e | foldl f e (h::t) = foldl f (f(h,e)) t; fun foldr f e [] = e | foldr f e (h::t) = f(h, foldr f e t); What is the type of foldl? [2 marks] What is the type of the expression foldr op/? [2 marks] For each of the following functions, write an ML definition using one of the functionals foldl or foldr. (a) product: (real list) -> real, which given a list of real numbers gives their product. (b) exists: ('a -> bool) -> ('a list) -> bool, which given a predicate p and a list l determines whether there is any element of l satisfying p. (c) length: ('a list) -> int which determines the length of a list. [9 marks] Prove, by induction on lists, that for all lists of integers l, the following identity is true: foldl op+ 0 l = foldr op+ 0 l Explain the Bayesian approach to solving problems in computer vision. Explain the notion of an Inverse Problem and how computer vision can be regarded thereby in a formal sense as inverse graphics. Write down Bayes' rule in general form, and explain the interpretation of its terms as: probability of the image, given the object probability of the object, given the image What is the role of the "prior?" Discuss and illustrate the Bayesian approach in terms of 3D surface reconstruction, given the reflectance data in an image. [20 marks] 8 CST.2000.12.9 13 Complexity Theory Give precise definitions of polynomial time reductions and NP-completeness. [2 marks each] Consider the following two decision problems on undirected graphs. 3-node-colourability: the collection of graphs G = (V, E) for which there is a mapping : V {r, g, b} such that if (u, v) E, then (u) 6= (v). 3-edge-colourability: the collection of graphs G = (V, E) for which there is a mapping : E {r, g, b} such that if (u, v),(u, v0 ) E, with v 6= v 0 , then (u, v) 6= (u, v0 ). Show that there is a polynomial time reduction from 3-edge-colourability to 3-node-colourability. [8 marks] The problem 3-edge-colourability is known to be NP-complete. Using this information, for each of the following statements, state whether or not it is true. In each case, give complete

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Unity From Zero To Proficiency Beginner A Step By Step Guide To Coding Your First Game

Authors: Patrick Felicia

1st Edition

1091872023, 978-1091872028

More Books

Students also viewed these Programming questions

Question

Which of the these colours is least scattered by dust ,fog, smoke?

Answered: 1 week ago

Question

What is the approximate diameter of the human eye ?

Answered: 1 week ago

Question

The front transperant part of the sclerosis known as.....?

Answered: 1 week ago

Question

What is the refractive index of the cornea....?

Answered: 1 week ago