9618/31 · May/June 2023
Download PDFNumbers are stored in two different computer systems by using floating-point representation. System 1 uses: • 10 bits for the mantissa • 6 bits for the exponent • two’s complement form for both the mantissa and the exponent. System 2 uses: • 8 bits for the mantissa • 8 bits for the exponent • two’s complement form for both the mantissa and the exponent.
Calculate the normalised floating-point representation of 113.75 and show how it would be represented in each of these two systems. Show your working. System 1 Mantissa Exponent System 2 Mantissa Exponent Working
Explain the problem that occurred in part (a) when representing the number in system 2.
Draw one line from each machine learning category to its most appropriate description. Machine learning category: Supervised learning Reinforcement learning Deep learning Unsupervised learning Description: simulates the data-processing capabilities of the human brain to make decisions enables learning by mapping an input to an output based on example input–output pairs enables information related to errors produced by the neural network to be transmitted enables learning in an interactive environment by trial and error using its own experiences enables learning by allowing the process to discover patterns on its own that were previously undetected
Describe the purpose of both the A* algorithm and Dijkstra’s algorithm.
A hashing algorithm is used to calculate storage locations for records in a random access file. It calculates hash values by using the function modulus 3. The function modulus gives the remainder after integer division. For example, 1030 modulus 3 = 1. Therefore, the record key 1030 gives a hash value of 1. Complete the table to show the remaining hash values.
| Record key | Hash value |
|---|---|
| 1030 | 1 |
| 1050 | |
| 1025 |
Describe what happens, in relation to the storage or retrieval of a record in the file, when the calculated hash value is a duplicate of a previously calculated hash value for a different record key.
Two descriptions of user-defined data types are given. Give appropriate type declaration statements for each, including appropriate names.
A data type to hold a set of prime numbers below 20. These prime numbers are: 2, 3, 5, 7, 11, 13, 17, 19
A data type to point to a day in the week, for example Monday.
State, with a reason, where it would be appropriate to use circuit switching.
Give two benefits and two drawbacks of circuit switching. Benefit 1 Benefit 2 Drawback 1 Drawback 2
Several syntax diagrams are shown.







State whether each of the following passwords is valid or invalid and give a reason for your choice. DPAD99$ Reason DAD#95 Reason ADY123? Reason
Complete the Backus-Naur Form (BNF) for the syntax diagrams shown. <symbol> ::= <letter> ::=
An identifier begins with one or more letters, followed by zero digits or one digit or more digits. Valid letters and digits are shown in the syntax diagrams on page 6. Draw a syntax diagram for an identifier.

Complete the Karnaugh map (K-map) for the following Boolean expression.
Draw loop(s) around appropriate group(s) in the K-map to produce an optimal sum-of-products.
Write the Boolean logic expression from your answer to part (b) as a simplified sum-of-products. Z =
Use Boolean algebra to give your answer to part (c) in its simplest form. Z =
Outline the characteristics of massively parallel computers.
Encryption is used to alter data into a form that makes it meaningless if intercepted. Describe the purpose of asymmetric key cryptography.
Identify two benefits and two drawbacks of quantum cryptography. Benefit 1 Benefit 2 Drawback 1 Drawback 2
The pseudocode algorithm shown copies an active accounts text file ActiveFile.txt to an archive accounts text file ArchiveFile.txt, one line at a time. Any blank lines found in the active accounts text file are replaced with the words "Account not present" in the archive accounts text file. Complete this file-handling pseudocode. DECLARE Account : STRING .......................................................................................................................................................... OPENFILE "ArchiveFile.txt" FOR WRITE WHILE NOT ...................................................................................................................................... READFILE "ActiveFile.txt", Account IF Account = "" THEN WRITEFILE "ArchiveFile.txt", " .........................................................................." ELSE WRITEFILE "ArchiveFile.txt", ............................................................................... ENDIF ENDWHILE .......................................................................................................................................................... CLOSEFILE "ArchiveFile.txt"
Pseudocode is to be written to implement a queue Abstract Data Type (ADT) with items of the string data type. This will be implemented using the information in the table.
| Identifier | Data type | Description |
|---|---|---|
| FrontPointer | INTEGER | points to the start of the queue |
| RearPointer | INTEGER | points to the end of the queue |
| Length | INTEGER | the current size of the queue |
| Queue | STRING | 1D array to implement the queue |
A constant, with identifier MaxSize, limits the size of the queue to 60 items.
Write the pseudocode to declare MaxSize, FrontPointer, RearPointer, Length and Queue.
Complete the following pseudocode for the function Dequeue to remove the front item from the queue. FUNCTION Dequeue RETURNS STRING DECLARE Item : STRING ......................................................................................................................... > 0 THEN Item ← ....................................................................................................................... ...................................................................................................................................... IF Length = 0 THEN CALL Initialise // reset the pointers ELSE IF FrontPointer > MaxSize THEN ....................................................................................................................... ← 1 ENDIF ENDIF ELSE OUTPUT "The print queue was empty – error!" Item ← "" ENDIF RETURN Item ENDFUNCTION
Explain how a new element can be added to the queue if it is implemented using two stacks.
Describe what is meant by recursion.
A Fibonacci sequence is a series of numbers formed by adding together the two preceding numbers, for example: 0, 1, 1, 2, … This function calculates and returns values in the Fibonacci sequence and uses recursion. FUNCTION Fib(Number : INTEGER) RETURNS INTEGER IF Number <= 1 THEN Result ← Number ELSE Result ← Fib(Number – 1) + Fib(Number – 2) ENDIF RETURN Result ENDFUNCTION Complete the trace table for the function when it is called as Fib(5).
| Call number | Function call | Number | Result | Return value |
|---|---|---|---|---|
| 5 |






