COMPUTER SCIENCE TRIPOS

Similar documents
COMPUTER SCIENCE TRIPOS

COMPUTER SCIENCE TRIPOS

COMPUTER SCIENCE TRIPOS

COMPUTER SCIENCE TRIPOS

King Fahd University of Petroleum and Minerals College of Computer Science and Engineering Computer Engineering Department

Chapter 5 Synchronous Sequential Logic

Mealy & Moore Machines

Name: Student ID: Instructions:

LOGIC CIRCUITS. Basic Experiment and Design of Electronics

Counters. We ll look at different kinds of counters and discuss how to build them

Reg. No. Question Paper Code : B.E./B.Tech. DEGREE EXAMINATION, NOVEMBER/DECEMBER Second Semester. Computer Science and Engineering

Sample Marking Scheme

Sample Test Paper - I

Boolean Algebra. Digital Logic Appendix A. Boolean Algebra Other operations. Boolean Algebra. Postulates, Identities in Boolean Algebra

Boolean Algebra. Digital Logic Appendix A. Postulates, Identities in Boolean Algebra How can I manipulate expressions?

EECS150 - Digital Design Lecture 23 - FFs revisited, FIFOs, ECCs, LSFRs. Cross-coupled NOR gates

UNIVERSITY OF BOLTON SCHOOL OF ENGINEERING BENG (HONS) ELECTRICAL & ELECTRONICS ENGINEERING EXAMINATION SEMESTER /2017

Digital Logic Appendix A

Fundamentals of Digital Design

LOGIC CIRCUITS. Basic Experiment and Design of Electronics. Ho Kyung Kim, Ph.D.

EET 310 Flip-Flops 11/17/2011 1

Week-5. Sequential Circuit Design. Acknowledgement: Most of the following slides are adapted from Prof. Kale's slides at UIUC, USA.

Department of Computer Science University at Albany, State University of New York Solutions to Sample Discrete Mathematics Examination II (Fall 2007)

Combinatorial Logic Design Principles

EE 209 Spiral 1 Exam Solutions Name:

DE58/DC58 LOGIC DESIGN DEC 2014

Latches. October 13, 2003 Latches 1

CPSC 121 Sample Final Examination December 2013

Philadelphia University Student Name: Student Number:

3. Complete the following table of equivalent values. Use binary numbers with a sign bit and 7 bits for the value

Boolean algebra. Examples of these individual laws of Boolean, rules and theorems for Boolean algebra are given in the following table.

Sri vidya college of engineering and technology

Midterm Examination # 1 Wednesday, February 25, Duration of examination: 75 minutes

ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN. Week 7 Dr. Srinivas Shakkottai Dept. of Electrical and Computer Engineering

ENGG 1203 Tutorial_9 - Review. Boolean Algebra. Simplifying Logic Circuits. Combinational Logic. 1. Combinational & Sequential Logic

Computer organization

Time Allowed 3:00 hrs. April, pages

ELCT201: DIGITAL LOGIC DESIGN

ECE 341. Lecture # 3

Slide Set 3. for ENEL 353 Fall Steve Norman, PhD, PEng. Electrical & Computer Engineering Schulich School of Engineering University of Calgary


CSCI 2150 Intro to State Machines

Philadelphia University Student Name: Student Number:

Learning Objectives:

ELCT201: DIGITAL LOGIC DESIGN

UNIVERSITI TENAGA NASIONAL. College of Information Technology

CS/COE1541: Introduction to Computer Architecture. Logic Design Review. Sangyeun Cho. Computer Science Department University of Pittsburgh

Lecture 10: Synchronous Sequential Circuits Design

Synchronous Sequential Circuit

ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN. Week 9 Dr. Srinivas Shakkottai Dept. of Electrical and Computer Engineering

CS/COE0447: Computer Organization

A function is a special kind of relation. More precisely... A function f from A to B is a relation on A B such that. f (x) = y

CPE/EE 422/522. Chapter 1 - Review of Logic Design Fundamentals. Dr. Rhonda Kay Gaede UAH. 1.1 Combinational Logic

CSE 105 Homework 1 Due: Monday October 9, Instructions. should be on each page of the submission.

CE Optimized State Machines

Let s now begin to formalize our analysis of sequential machines Powerful methods for designing machines for System control Pattern recognition Etc.

UNIVERSITY OF WISCONSIN MADISON

CPE100: Digital Logic Design I

Digital Circuits ECS 371

Computers also need devices capable of Storing data and information Performing mathematical operations on such data

Roger L. Tokheim. Chapter 8 Counters Glencoe/McGraw-Hill

University of Minnesota Department of Electrical and Computer Engineering

CprE 281: Digital Logic

Contents. Chapter 2 Digital Circuits Page 1 of 30

Appendix B. Review of Digital Logic. Baback Izadi Division of Engineering Programs

COMPUTER SCIENCE TRIPOS

Digital Logic: Boolean Algebra and Gates. Textbook Chapter 3

ECE/CS 250 Computer Architecture

The Design Procedure. Output Equation Determination - Derive output equations from the state table

Lecture 7: Logic design. Combinational logic circuits

Written exam with solutions IE Digital Design Friday 21/

Computational Models #1

ECE 250 / CPS 250 Computer Architecture. Basics of Logic Design Boolean Algebra, Logic Gates

Digital Electronics Final Examination. Part A

ELEC Digital Logic Circuits Fall 2014 Sequential Circuits (Chapter 6) Finite State Machines (Ch. 7-10)

Experiment 9 Sequential Circuits

CSCI 2200 Foundations of Computer Science Spring 2018 Quiz 3 (May 2, 2018) SOLUTIONS

CS/COE0447: Computer Organization

King Fahd University of Petroleum and Minerals College of Computer Science and Engineering Computer Engineering Department

Different encodings generate different circuits

CSE 200 Lecture Notes Turing machine vs. RAM machine vs. circuits

Mathematical Preliminaries. Sipser pages 1-28

ELCT201: DIGITAL LOGIC DESIGN

Boolean Logic Prof. James L. Frankel Harvard University. Version of 3:20 PM 29-Aug-2017 Copyright 2017, 2016 James L. Frankel. All rights reserved.

Closure under the Regular Operations

Digital Logic Design - Chapter 4

SAMPLE ANSWERS MARKER COPY

( c) Give logic symbol, Truth table and circuit diagram for a clocked SR flip-flop. A combinational circuit is defined by the function

Sequential Logic Circuits

Lecture (08) Synchronous Sequential Logic

Logic Design. Chapter 2: Introduction to Logic Circuits

ELCT201: DIGITAL LOGIC DESIGN

COMPUTER SCIENCE TRIPOS

DIGITAL LOGIC CIRCUITS

ELECTRONICS & COMMUNICATION ENGINEERING PROFESSIONAL ETHICS AND HUMAN VALUES

EE40 Lec 15. Logic Synthesis and Sequential Logic Circuits

Department of Electrical & Electronics EE-333 DIGITAL SYSTEMS

CITS2211 Discrete Structures (2017) Cardinality and Countability

Boolean Algebra and Digital Logic 2009, University of Colombo School of Computing

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified) State any two Boolean laws. (Any 2 laws 1 mark each)

Transcription:

CST.2014.2.1 COMPUTER SCIENCE TRIPOS Part IA Tuesday 3 June 2014 1.30 to 4.30 pm COMPUTER SCIENCE Paper 2 Answer one question from each of Sections A, B and C, and two questions from Section D. Submit the answers in five separate bundles, each with its own cover sheet. On each cover sheet, write the numbers of all attempted questions, and circle the number of the question attached. You may not start to read the questions printed on the subsequent pages of this question paper until instructed that you may do so by the Invigilator STATIONERY REQUIREMENTS Script paper Blue cover sheets Tags Rough work pad SPECIAL REQUIREMENTS Approved calculator permitted

CST.2014.2.2 SECTION A 1 Digital Electronics (a) A combinational logic circuit takes a 4-bit unsigned binary integer number at its inputs labelled D 3, D 2, D 1 and D 0, where D 3 is the most significant bit. For decimal input 1, 2, 3, 5, 7, 11 and 13, the output S is to be at logic 1, and it is to be at logic 0 otherwise. Write down the truth table for the required combinational logic function. (ii) Using a Karnaugh map, determine the simplified Boolean expression for the output S in terms of the inputs D 3 to D 0 in a minimum sum-of-products form. (iii) Describe what is meant by an essential term in a Karnaugh map. Write down the essential terms for the Karnaugh map in (ii ). (iv) Using a Karnaugh map, this time determine the required simplified Boolean expression for the output S in a minimum product-of-sums form. [10 marks] Provide a circuit diagram which implements the following Boolean function using only NAND gates F = (A + D).(B + C + D).(A + B + C) that has the don t care states: A.B.C.D, A.B.C.D, A.B.C.D and A.B.C.D (c) Show that (X + Y ).(X + Z) = X + Y.Z (X + Y ).(X + Z) = X.Z + X.Y Using these results or otherwise, simplify the following expression P = (A + B + C).(A + B + D).(A + B + E).(A + D + E).(A + C) [6 marks] 2

CST.2014.2.3 2 Digital Electronics (a) Show how two NOR gates may be connected to form an RS latch. Describe its operation and give a table relating its inputs to its outputs. How could you use this circuit to eliminate the effect of contact bounce in a single pole double throw switch supplying an input to a digital logic circuit? [6 marks] The state sequence for a particular 4-bit binary up-counter is as follows: Q A Q B Q C Q D 0 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1.... 1 0 1 1 0 0 0 0 0 0 0 1.... Show how four negative edge triggered T-type flip-flops (FFs) with outputs labelled Q A, Q B, Q C and Q D can be used to implement a ripple counter having the specified state sequence. Show any combinational logic necessary assuming that the FFs have asynchronous reset inputs available. (c) Using the principles of synchronous design, determine the next state combinational logic expressions required to implement a counter having the state sequence specified in part (b ). Assume that D-type FFs are to be used and that unused states do not occur. (d) Explain carefully what happens if the counter in (c ) starts in state 1 1 1 0. In general, how can start-up problems be overcome in the design of synchronous state machines? (e) What are the advantages and disadvantages of the synchronous design in part (c ) compared with the alternative design in part (b )? [2 marks] 3 (TURN OVER)

CST.2014.2.4 SECTION B 3 Operating Systems One goal of a multiuser operating system is to protect each user s information and activity from damage caused by accidental or deliberate actions of other users of the system. (a) Describe a mechanism that operating systems use to reduce the opportunity for a user process to prevent another user s process from making progress. In your description include any particular hardware features that are relied upon. (c) Describe two alternative mechanisms that operating systems could use to reduce the opportunity for a user process to access or corrupt the information being used by another user s process. In your descriptions include any particular hardware features that are relied upon. [6 marks] Describe how an operating system might attempt to ensure that long-term user information (that is, information which exists beyond process execution) is not interfered with or misused by other users. Your description should be clear about when actions are performed and the resources they consume. [5 marks] (d) To what extent are the mechanisms described above useful in single user systems? (e) How do operating systems ensure that they are not themselves overly-restricted by these mechanisms? 4

CST.2014.2.5 4 Operating Systems (a) Describe the difference between blocking and nonblocking input/output operations. How can an operating system improve the performance (as seen by a process) of blocking operations? A privileged process is given raw access to a slow disk device. It reads a page from the disk (using a blocking operation), processes the information and repeats. Suppose a read takes 3 units of time and the processing 2 units of time, so that reading a block and processing takes 5 units of elapsed time. Assuming the machine is otherwise idle, how can this elasped time be reduced? State any assumptions about hardware features you are making. [5 marks] (c) Describe how polled I/O works and state its disadvantages. Under what conditions is polling a sensible approach? Describe an alternative approach. (You may find it helpful to provide a few lines of psuedo code.) (d) What advantages does direct memory access (DMA) provide? Describe its operation as seen by a device driver in the operating system. (You may find it helpful to write a few lines of psuedo code.) [5 marks] (e) To what extent does heterogeneity in I/O systems add complexity to an operating system? [2 marks] 5 (TURN OVER)

CST.2014.2.6 SECTION C 5 Software and Interface Design (a) Define briefly, for each of the following techniques, what its purpose is and how it is conducted. Regression testing (ii) A/B testing (iii) Unit testing (iv) Load testing [12 marks] Although each of these techniques can provide new information of value to a software project, costs can be reduced if information is available earlier in the design cycle. For each of the four techniques in part (a), suggest a method by which some of the resulting information could be obtained earlier in the project. [8 marks] 6

CST.2014.2.7 6 Software and Interface Design The following is an extract from a design brief written by the client for one of the 2014 Cambridge group design projects. What I d like is some sort of database of recipes to which I can send queries such as Find me something that doesn t contain cabbage or tomatoes that takes less than 30 minutes to prepare, or I ve got kohlrabi in the veg box AGAIN, are there any recipes I haven t tried that might make something edible out of it?, or I ve actually got a couple of hours free to cook this weekend, what was that complicated Ottolenghi recipe I flagged two weeks ago to try later?. The database needs to cope with the fact that ingredients can have different names but mean the same thing: e.g. flour and plain flour, and that 1/4 lb and 4oz are the same thing and equal to 100g (and not 113g). It would be great if once I ve chosen this week s menu, it could produce a shopping list I can plug into www.myfavouritesupermarket.com, and it needs to be usable by non-engineers. (a) For each of the following software project phases, suggest a design model or representation that would be a helpful aid in the design process. For each of these, sketch an example to show what this model looks like, based on some part of the above design brief. Inception phase (ii) Elaboration phase (iii) Construction phase (iv) Transition phase [12 marks] (c) For each of the sketched examples in part (a), describe how the design work so far could be evaluated before proceeding to the next phase. Choose two of the above design models, representations or evaluation methods, and explain how they would be done differently if the design project was following an agile rather than spiral project management approach. 7 (TURN OVER)

CST.2014.2.8 SECTION D 7 Discrete Mathematics (a) Let m be a fixed positive integer. For an integer c, let K c = { k N k c (mod m) }. Show that, for all c Z, the set K c is non-empty. [2 marks] (ii) For an integer c, let κ c be the least element of K c. Prove that for all a, b Z, a b (mod m) iff κ a = κ b. State Fermat s Little Theorem. [2 marks] (ii) Prove that for all natural numbers m and n, and for all prime numbers p, if m n ( mod (p 1) ) then k N. k m k n (mod p). [6 marks] (c) Use Euclid s Algorithm to express the number 1 as an integer linear combination of the numbers 34 and 21. (ii) Find a solution x N to 34 x 3 (mod 21). 8

CST.2014.2.9 8 Discrete Mathematics (a) Let #X denote the cardinality of a set X. Define a unary predicate P for which the statement sets X. [ P (#X) ( sets A, B. A X = B X = A = B ) ] holds. Prove the statement for your given predicate P. [1 mark] For sets X, Y, Z, let (X Y ) denote the set of functions from X to Y and let P(Z) be the powerset of Z. For sets A and B, consider the function ( ) : ( A P(B) ) ( P(A) P(B) ) given, for all f ( A P(B) ) and X P(A), by f (X) = a X f(a) Show that for all g ( P(A) P(B) ) there exists f ( A P(B) ) such that f = g iff, for all F P(A), g ( X F X) = X F g(x). [6 marks] (c) For sets S and A, let Bij(S, S) be the set of bijections from S to S, let Inj(S, A) be the set of injections from S to A, and let P S (A) = { X A X = S } be the set of subsets of A that are in bijection with S. Prove that the relation Inj(S, A) Inj(S, A) defined, for all f, g Inj(S, A), by f g h Bij(S, S). f = g h is an equivalence relation. (ii) Define a bijection Inj(S, A) / P S (A) You need not prove your function is bijective, but you should explain why your mapping is well defined. [6 marks] 9 (TURN OVER)

CST.2014.2.10 9 Discrete Mathematics (a) The subset S of N = {0, 1, 2,...} is inductively defined by the following axiom and rules, where n ranges over N: 1 n 2n n 3n n + 5 n State the principle of Rule Induction associated with this set of axioms and rules. (ii) Use Rule Induction to prove that no element of S is divisible by 5. (iii) Is 0 an element of S? Justify your answer. [1 mark] State the principle of Mathematical Induction. [2 marks] (c) For sets X and Y of strings over an alphabet Σ, let XY denote the set {uv u X and v Y } of all concatenations of a string in X followed by a string in Y. For n N, let X n be given by: X 0 = {ε} (where ε denotes the null string) and X n+1 = XX n. Let X = n 0 Xn. Suppose X, Y, Z Σ satisfy Z = XZ Y. Prove by Mathematical Induction that n N. X n Y Z and deduce that X Y Z. (ii) Suppose further that ε / X. By considering the property of n N given by w Z. w n w X Y, or otherwise, use Mathematical Induction to prove that Z X Y. [5 marks] 10

CST.2014.2.11 10 Discrete Mathematics (a) For each symbol x in the alphabet Σ = {a, b, c}, let O x be the language over Σ consisting of all strings that contain an odd number of occurrences of the symbol x; and let E x be the language of strings over Σ containing an even number of occurrences of the symbol x. Give a deterministic finite automaton whose language of accepted strings is O a. [2 marks] (ii) Give a regular expression whose language of matching strings is O a. [2 marks] (iii) Give a deterministic finite automaton whose language of accepted strings is O a E b. M = (Q, Σ, δ, s, F ) is a deterministic finite automaton whose set of states Q has l elements. Suppose that M accepts a string w Σ whose length w satisfies w l. Show that w = u 1 vu 2 for some strings u 1, v, u 2 Σ such that u 1 < l, 1 v l and M accepts u 1 v n u 2 for all n N = {0, 1, 2,...}. [7 marks] (ii) Hence show that if infinitely many strings are accepted by M, then it must accept some string w with l w < 2l. [5 marks] END OF PAPER 11