9618/32 · Oct/Nov 2023
Download PDFReal numbers are stored in a computer using floating point representation with: • 10 bits for the mantissa • 6 bits for the exponent • two’s complement form for both the mantissa and the exponent. Write the normalised floating-point representation of –96.75 in this system. Show your working.
Explain why a binary representation is sometimes only an approximation to the real number it represents.
Describe what is meant by composite and non-composite data types. Composite ........................................................................................................................................ .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... Non-composite ................................................................................................................................. .......................................................................................................................................................... .......................................................................................................................................................... ..........................................................................................................................................................
The location of a record in a random file is determined using a hashing algorithm. A collision may occur during the process of adding a record.
Outline what is meant by the term collision in this context.
Explain how a collision can be dealt with when writing records to a random file.
Complete the following paragraph about a protocol suite, using words from the given list. Some words are not used. BitTorrent circuit switching layered link list peer-to-peer queue stack star TCP/IP The protocols in a ............................................................................. determine the interconnectivity rules for a ............................................................................. network model such as the ............................................................................. model.
Outline the reasons why an operating system may need to use virtual memory.
Explain the circumstances in which disk thrashing could occur.
The Reverse Polish Notation (RPN) expression: a b * 2 / c d / * is to be evaluated where a = 20, b = 3, c = 10 and d = 5. Show the changing contents of the following stack as the RPN expression is evaluated.
Explain how an expression stored in RPN can be evaluated.

This logic circuit represents the Boolean expression: Complete this truth table for the given logic circuit.
Apply De Morgan’s laws to the expression: ......................................................................................................................................
Simplify the following expression using Boolean algebra. Show all the stages in your simplification.
Calculate the shortest distance between the Start and each of the destinations in the diagram using Dijkstra’s algorithm. Show your working and write your answers in the table provided.

A stack Abstract Data Type (ADT) is to be implemented using pseudocode, with procedures to initialise it and to push new items onto the stack. A 1D array Stack stores the contents of the stack. Study the pseudocode in part (a)(ii) and complete the table of identifiers by writing the missing data types and descriptions.
Complete the pseudocode. CONSTANT MaxSize = 40 DECLARE BasePointer : INTEGER DECLARE TopPointer : INTEGER DECLARE Stack : ARRAY[1:40] OF REAL // initialisation of stack PROCEDURE Initialise() ................................................................................ ← 1 ................................................................................ ← 0 ENDPROCEDURE // push an item onto the stack PROCEDURE Push(NewItem : REAL) ................................................................................ MaxSize THEN .......................................................................................................... Stack[TopPointer] ← ............................................................. ENDIF ENDPROCEDURE
Justify the use of a linked list instead of an array to implement a stack.
Explain how a compiler makes use of a stack when translating recursive programming code.
Describe the features of the SIMD and MISD computer architectures. SIMD ................................................................................................................................................ .......................................................................................................................................................... .......................................................................................................................................................... .......................................................................................................................................................... MISD ................................................................................................................................................ .......................................................................................................................................................... .......................................................................................................................................................... ..........................................................................................................................................................
A declarative programming language is used to represent some facts about people and their hobbies. 01 hobby(music). 02 hobby(caving). 03 hobby(climbing). 04 hobby(camping). 05 hobby(baking). 06 hobby(travelling). 07 person(toby). 08 person(natasha). 09 person(fatima). 10 person(joseph). 11 person(elijah). 12 person(nina). 13 enjoys(natasha, travelling). 14 enjoys(toby, climbing). 15 enjoys(nina, climbing). 16 enjoys(elijah, camping). 17 enjoys(fatima, baking). 18 enjoys(joseph, camping). 19 dislikes(toby, caving). These clauses have the meanings: Clause Meaning 01 Music is a hobby 07 Toby is a person 13 Natasha enjoys travelling 19 Toby dislikes caving
Carlos is a person who enjoys the hobby of cycling but does not like music. Write additional clauses to represent this information. 20 ............................................................................................................................................ 21 ............................................................................................................................................ 22 ............................................................................................................................................ 23 ............................................................................................................................................
Using the variable P, the goal: enjoys(P, camping) returns P = elijah, joseph Write the result returned by the goal: enjoys(P, climbing) P = ....................................................................................................................................
N is a person who might enjoy H if H is a hobby and N does not dislike H. Write this as a rule. might_enjoy(N, H) IF ............................................................................................................................................ ................................................................................................................................................... ................................................................................................................................................... .............................................................................................................................................
Describe, with an example, what is meant by an exception.
A pseudocode algorithm searches for a customer record in a random file AccountRecord.dat. A user inputs the name of the customer. The records are stored using the user-defined data type TAccount. TYPE TAccount DECLARE AccountNumber : INTEGER DECLARE Name : STRING DECLARE Address : STRING DECLARE Telephone : STRING ENDTYPE If the record is found, it is output, otherwise an error message is displayed. Complete the file handling pseudocode. DECLARE Customer : TAccount DECLARE Location : INTEGER DECLARE MaxSize : INTEGER DECLARE FoundFlag : BOOLEAN DECLARE SearchCustomer : STRING MaxSize ← 1000 OPENFILE ............................................................................................................... Location ← 1 ............................................................................................................... ← FALSE OUTPUT "Enter the customer’s name" ............................................................................................................... ................................................................................... AND Location <= MaxSize ................................... "AccountRecord.dat", ............................................ GETRECORD "AccountRecord.dat", Customer IF SearchCustomer = Customer.Name THEN OUTPUT "Customer found: " OUTPUT Customer // output customer record FoundFlag ← TRUE ENDIF Location ← Location + 1 ENDWHILE IF NOT FoundFlag THEN OUTPUT ".........................................................................................................." ENDIF






