CSMM031 UNIVERSITY OF DUBLIN TRINITY COLLEGE FACULTY OF ENGINEERING & SYSTEM SCIENCES DEPARTMENT OF COMPUTER SCIENCE M.Sc. Multimedia Systems Client Technologies, Server Technologies and Networking Andy Nisbet, Brian MacNamee Please answer FIVE questions. Please place the answers for each subject examined in separate answer booklets 1. The "Little Man Computer" (LMC) is a simplified model of a central processing unit. The LMC has NINE instructions in total:-1 LOAD mailbox 2 STORE mailbox 3 ADD mailbox 4 SUBTRACT mailbox 5 INPUT 00 6 OUTPUT 00 7 HALT 00 8 SKIP code 9 JUMP mailbox The code in the skip instruction will cause the LMC to skip the next instruction if: SKIP 00 800 if calculator value is negative. SKIP 01 801 if calculator value is 0 SKIP 02 802 if calculator value is 0 or positive. A mailbox is a 2 digit number from 0 to 99. Write a commented LMC program that REPEATEDLY inputs three integers, adds them all together and outputs the result. The program should terminate when ANY negative number is inputted. Your program should be presented in 1 mneumonic and machine code forms. Describe sensible rules for the placement of DATA and INSTRUCTIONS within the mailbox address range of 0 to 99. 2. Describe the meaning of null and undefined variables in JavaScript. Write JavaScript code to test if a variable is null. Write JavaScript code to test if a variable is undefined. Describe how Adobe Atmosphere 3D virtual worlds can be viewed. Discuss how JavaScript programs can be used in conjunction with Atmosphere. Describe FOUR aspects of the virtual world that can be manipulated using JavaScript. Describe the SPECIFIC input events that can be used to trigger the execution of JavaScript code in the Atmosphere environment. 3. Describe how the methods window.setInterval(), window.setTimeout() can be used to schedule a piece of JavaScript code to be executed periodically. Describe the use of window.clearInterval() and window.clearTimeout() and their purpose. Discuss practical considerations in the choice of an appropriate period for animation of a sequence of images. Write a JavaScript program that repeatedly animates a sequence of FIFTY images using the HTML <IMG> tag. <IMG SRC="nameOfJPEG.jpg" NAME=animation> Discuss how the initial animation can proceed smoothly by forcing the images to be cached (using JavaScript). 4. a) Explain the operation of the following pieces of JavaScript code: var x1 = 0; var x2 = 0; var i; for(i = 1024; i >= 0;i--) { if(i%2 == 0) x1 = x1 + contents[i];// contents is an array of length 1024 // containing integer values at contiguous locations else x2 = x2 + contents[i]; if(x1 > 512 || x2 < -256) break; } document.writeln("x1 is " + x1 + " x2 is " + x2 + " and i was " + i); 2 5. b) Define what is meant by an "object" in Javascript. Write a Javascript code fragment that illustrates how objects can be created and initialised/used. c) Discuss how numbers are represented in Javascript programs. Discuss practical considerations on the use of Javascript in financial calculations. d) Describe the use and benefits of including JavaScript source files within <SCRIPT> tags. a) List the key distinguishing features of a Local Area Network (LAN). b) Describe the issues associated with communication among multiple computers sharing a common communication medium in a LAN, such as that shown in figure 1 below. c) Explain how these issues are overcome in the Ethernet LAN standard. Again refer to the scheme shown below in figure 1. A B C D E F Figure 1: LAN 6. d) Is it possible to extend the cable in the scheme shown above in figure 1 indefinitely? Explain your answer. a) Briefly describe the issues that need to be agreed between a sender and receiver in order for successful communications to take place. b) Define the term protocol with respect to network communication. c) Explain the layering principle with respect to network communication. d) Draw a diagram of the Internet protocol stack, making sure to give the name of each layer. e) Briefly explain the responsibilities of the top three layers of the Internet protocol stack, naming a protocol used at each of these layers. f) Explain the term encapsulation with respect to network communication. 3 7. 8. a) Explain the differences between a connectionless and connection-oriented service with respect to the Internet protocol’s Network layer. b) Describe the differences between the three classes of IP addresses currently in use on the Internet. c) The Internet protocol’s Transport layer offers two basic services to the Application layer above it. Name these two services and briefly describe them, giving particular focus to their differences. Also, give an example of an application suited to each type of service. d) Explain the differences between flow control and congestion control. a) Show the HTML code required to implement a Web page which displays the following form. When the submit button is pressed the data in the form should be sent to a file called “welcome.php”. b) Show the contents of the PHP file “welcome.php”. This page should display the following (where <title>, <fullName> and <address> refer to the values entered in the HTML form above): Hello <title> <fullName> from <address>. NOTE: If the user selects the “Other” radio button option for their title then the value entered in the text field next to this radio button should be displayed as the user’s title. c) Explain the statement “HTTP is a stateless protocol” and describe one scheme that can be used to maintain state in Web based applications. 4