Question
Explain the following questionS. Suppose a Prolog database exists that gives information about the parts in an automobile engine. Predicates of big, small, and part-of
Explain the following questionS.
Suppose a Prolog database exists that gives information about the parts in an automobile engine. Predicates of big, small, and part-of are included. a. Write a query to find all small items that are part of other items. b.Write a query to find all big items that have small subitems. c Formulate a recursive rule to define component-of.
Explain why or why not in each case(a) Briefly explain the differences between combinational and sequential logic. [2 marks] (b) With the aid of appropriate diagrams, briefly explain the operation of Moore and [6 marks] (c) The state sequence for a binary counter is as follows: A B C D 0 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 1 0 0 0 1 0 0 1 1 0 1 0 1 0 1 1 1 1 0 0 The counter is to be implemented using four synchronously clocked D-type flip-flops. (i) Draw a state table for the counter, showing the required D inputs. [4 marks] (ii) Find expressions for the D inputs, making use of unused states if appropriate. [6 marks] (iii) What problem could occur when the counter circuit is powered-up? Give two possible general methods for overcoming the problem. [2 marks] .(a) With the aid of relevant diagrams, show the effect on the output of a combinational logic circuit of a: (i) static hazard; (ii) dynamic hazard. [3 marks] (b) Simplify the following expressions using Boolean algebra: (i) X = (A + B + A . B).(A + B). A . B (ii) Y = (A + B + A . B). C [4 marks] (c) Given: F = A . B . C . D + A . C + B . C . D + B . C + A . C . D + A . B . C . D (i) Show using a Karnaugh map that F can be simplified to F1 = A . B + A . B + A . C + B . C . D [2 marks] (ii) Show that there are a total of four possible expressions for F. [3 marks] (iii) Show how F1 can be implemented using NAND gates and draw the circuit diagram. Assume that complemented input variables are available. [2 marks] (iv) Show how the static 1 hazard in F1 can be eliminated using a Karnaughmap-based approach. [2 marks] (v) Now implement F1 assuming only 2-input NAND gates are available. [4 marks]Give the impulse response h 0 0 , h0 1 , . . . , h0 7 of a filter H0 with frequency response |H0 (f)| = |H(fs/2 f)|. [4 marks] (c) A programmer cuts a block out of a digitised sound signal and applies the Discrete Fourier Transform to estimate its spectral power distribution. (i) What effect distorts the resulting power spectrum? [3 marks] (ii) Describe briefly one technique to reduce these distortions. [3 marks] 9 [TURN OVER CST.2004.7.10 11 Topics in Concurrency A simulation between CCS terms is defined to be a binary relation S between CCS terms such that whenever (t, u) S for all actions a and terms t 0 t a t 0 u 0 . u a u 0 & (t 0 , u0 ) S . Write t u iff there is a simulation S for which (t, u) S. (a) Write down the transition rules for CCS parallel composition. Show that for CCS terms if t u and t 0 u 0 , then (t k t 0 ) (u k u 0 ) holds between their parallel compositions. [6 marks] (b) By exhibiting suitable CCS terms show that t u and u t together does not necessarily imply that t and u are strongly bisimilar. [6 marks] (c) Consider the following fragment of Hennessy-Milner logic: A ::= haiA | ^ iI Ai , where a is an action of CCS and I is a set. Show that t u iff for all assertions A in the fragment, whenever t satisfies A then so does u. [8 marks] 10 CST.2004.7.11 12 Information Retrieval (a) What role does stemming play in automatic indexing? [4 marks] (b) Briefly describe the principles behind the Porter Stemmer. [5 marks] (c) One extreme form of "stemming" is the mapping of all words of a certain prefix length onto one term. What effect will this prefix mixing have if the prefix length is extreme. Set up a student ArrayList of N student objects, and test it with N = 10 (at least). You have to store your test data in a file so that your program can read them. The client dlass should be well-structured and should have the essential methods in addition to the main method. The interaction with the user can be via the command line e. no graphical user interface i expected). Devise suitable test data to test all sections of program code. You will need to provide all the test data used. Your program should also include a method (eg. Studentinfo(0) to output your student details (name. student number, mode of enrolment. tutor name. tutorial attendance day and time) at the start of program results.
8. (4 pts+2Xc) Write a bash shell script called 08-numMajors that will do the following Read data from a class enrollment file that will be specified on the command line ii. If the file does not exist. is a directory, or there are more or less than one parameters provided. display an appropriate error/usage message and exit gracefully Display the number of a specified major who are taking a given class ii. The following is a sample input file and a sample run. I will use a file in the same format as this one to test your script. but the one use may have different data in it. Your script should work with whatever data is in the file use. including other majors than the ones shown in the examples below. Sample input file (turk/NetworkingClass/08-ClassEnrollment-CIS350.bxt) Bill Both, 123456789, Computer Information Systems Carla Carothers. 234567890, Computer Information Systems Stephanie Williams, 345678901, Marketing Aritrya Badopadhi, 456789012 Computer Science Santhi Roopashree. 567890123, Computer Information Systems Heather Williams. 678901234 Computer Information Systems Dave Schroth. 789012345, Computer Science Sample runs 08-nunMajors 08-ClassEnrollment-C1s350.txt #file in dir current.
8. (4 pts+2Xc) Write a bash shell script called 08-numMajors that will do the following Read data from a class enrollment file that will be specified on the command line ii. If the file does not exist. is a directory, or there are more or less than one parameters provided. display an appropriate error/usage message and exit gracefully Display the number of a specified major who are taking a given class ii. The following is a sample input file and a sample run. I will use a file in the same format as this one to test your script. but the one use may have different data in it. Your script should work with whatever data is in the file use. including other majors than the ones shown in the examples below. Sample input file (turk/NetworkingClass/08-ClassEnrollment-CIS350.bxt) Bill Both, 123456789, Computer Information Systems Carla Carothers. 234567890, Computer Information Systems Stephanie Williams, 345678901, Marketing Aritrya Badopadhi, 456789012 Computer Science Santhi Roopashree. 567890123, Computer Information Systems Heather Williams. 678901234 Computer Information Systems Dave Schroth. 789012345, Computer Science Sample runs 08-nunMajors 08-ClassEnrollment-C1s350.txt #file in dir current.
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