0% found this document useful (0 votes)
6 views6 pages

A) Express The Number 113 (Denary) in

The document provides examples and explanations of various computer science concepts: 1) Converting between binary, decimal, octal, hexadecimal representations of numbers. 2) Representing negative numbers in binary using sign-magnitude and two's complement notation. 3) Floating point number representation using mantissa and exponent. 4) Storing data in a binary tree and issues that can arise from deleting nodes. 5) The insertion sort algorithm. 6) The fetch-decode part of the CPU instruction cycle and purpose of registers. 7) Benefits of instruction pipelining and types of instructions that require pipeline reset.

Uploaded by

Abigail Mathe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views6 pages

A) Express The Number 113 (Denary) in

The document provides examples and explanations of various computer science concepts: 1) Converting between binary, decimal, octal, hexadecimal representations of numbers. 2) Representing negative numbers in binary using sign-magnitude and two's complement notation. 3) Floating point number representation using mantissa and exponent. 4) Storing data in a binary tree and issues that can arise from deleting nodes. 5) The insertion sort algorithm. 6) The fetch-decode part of the CPU instruction cycle and purpose of registers. 7) Benefits of instruction pipelining and types of instructions that require pipeline reset.

Uploaded by

Abigail Mathe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

1.

a) Express the number 113 (denary) in


(i) binary
(ii) in BCD
using an appropriate number of bytes in each case. (4)

b) Using the answer obtained in part (a) show how 113 (denary) can be expressed in
(i) octal
(ii) hexadecimal. (4)

A. a)
(i) 128 64 32 16 8 4 2 1
0 1 1 1 0 0 0 1 =01110001.

(ii) 1 = 0001
1 = 0001
3 = 0011
Therefore 113 = 0000000100010011

b)
(i) 113 = 001 110 001 in binary
= 1 6 1 in octal.
(ii) 113 = 0111 0001 in binary
= 7 1 in hexadecimal.

2. Explain how the denary number –27 can be represented in binary in


(i) sign and magnitude
(ii) two’s complement
notation, using a single byte for each answer. (4)
A. (i) +/- 64 32 16 8 4 2 1
1 0 0 1 1 0 1 1 = 10011011

(ii) –27 = -128 + 101


= -128 + (+64 +32 +4 +1)
-128 64 32 16 8 4 2 1
1 1 1 0 0 1 0 1 = 11100101
3. a) A floating point number is represented in a certain computer system in a single 8
bit byte. 5 bits are used for the mantissa and 3 bits for the exponent. Both are
stored in two’s complement form and the mantissa is normalised.

(i) State the smallest positive value,


(ii) state the most negative value

that can be stored. Give each answer as an 8 bit binary value and as a decimal
equivalent. (4)

b) Explain the relationship between accuracy and range when storing floating point
representations of real numbers. (4)

A. a)
(i) 01000/100 or ½ * 2-4 = 1/32
(ii) 10000/011 or -1 * 23 = -8

b)
-The larger the number of bits used for the mantissa, the better the accuracy
-The larger the number of bits used for the exponent, the greater the range
-There is always a finite number of bits.
-Therefore the more bits used for one part of the representation, the fewer bits can
be used for the other.

4. a) Show how a binary tree can be used to store the data items Feddi, Eda, Joh,
Sean, Dav, Gali in alphabetic order. (4)

b) Explain why problems may arise if Joh is deleted from the tree and how such
problems may be overcome. (4)

A. a) Feddi

Eda Joh

Dav Gali Sean

Marks:

-Root node
-Eda and Joh correctly positioned in relation to Feddi
-Eda’s subtree
-Joh’s subtree

b)
-Data in a tree serves two purposes (one is to be the data itself) the other is to act as
a reference for the creation of the subtree below it
-If Joh is deleted there is no way of knowing which direction to take at that node to
find the details of the data beneath it.
-Solution 1 is to store Joh’s subtree in temporary storage and then rewrite it to the
tree after Joh is deleted. (The effect is that one member of the subtree will take over
from Joh as the root of that subtree).
-The data, Joh, can be marked as deleted so that the data no longer exists but it can
maintain its action as an index for that part of the tree so that the subtree can be
correctly negotiated.

5. Describe the steps in sorting a list of numbers into order using an insertion sort. (4)

A. -Each value in turn is compared with the values already in the list and is…
- inserted in the correct location.
-Once a value has been inserted the algorithm is repeated by comparing all the
values in the list, in turn…
-with the next value in the list.
-This continues until all the values have been inserted.
-Example.

6. Describe the fetch/decode part of the fetch/decode/execute/reset cycle, explaining


the purpose of any special registers that you have mentioned. (6)

A. -Contents of PC loaded into MAR


-PC is incremented
-Contents of address stored in MAR loaded into MDR
-Contents of MDR loaded into CIR
-Instruction in CIR is decoded.
-PC (program counter) stores the address of the next instruction to be executed.
-MAR (memory address register) holds the address in memory that is currently
being used
-MDR (memory data register) holds the data (or instruction) that is being stored in
the address accessed by the MAR.
-CIR (current instruction register) holds the instruction which is currently being
executed.

7. a) Describe how pipelining normally speeds up the processing done by a computer.


(2)

b) State one type of instruction that would cause the pipeline system to be reset,
explaining why such a reset is necessary. (3)

A. a)
-All instructions have three phases…
-which are treated separately, by different parts of the processor…
-so that more than one instruction can be being dealt with simultaneously.

b)
-Jump instruction
-The instructions in the pipeline are no longer the ones to be dealt with next…
-so the pipeline has to be reset.

8. Explain why the size of the memory available is particularly relevant to the process of
compilation. (4)

A. The computer must be able to simultaneously hold in memory:


-The compiler software/without which the process cannot be carried out.
-The source code/the code that needs to be compiled
-The object code/because the compilation process produces the program in machine
code form.
-Working space/processing area to be used by the compiler during the process.
9. Explain, in detail, the stage of compilation known as lexical analysis. (6)

A. -Source program is used as the input


-Tokens are created from the individual characters and from…
-the special reserved words in the program.
-A token is a string of binary digits.
-Variable names are loaded into a look up table known as the symbol table
-Redundant characters (e.g. spaces) are removed
-Comments are removed
-Error diagnostics are issued.

10. Explain how an interrupt is handled by a processor which is working on another task.
(4)
A. -At some point in the cycle/at the end of an instruction
-the processor will check to see if there are any outstanding interrupts.
-If there are, the current job is suspended and…
-the contents of the special registers are stored so that it can be restarted later
-interrupts are then serviced until all have been dealt with…
-Control is returned to the original job.

11. Explain the difference between


(i) Input/output bound jobs and
(ii) Processor bound jobs.

Explain how the computer should prioritise the two types of job if it is going to make
maximum use of the system. (4)

A. -I/O jobs are those that require relatively little processing but do need to use the
peripheral devices substantially
-Processor bound jobs require a large amount of processor time and very little use of
the various peripheral devices.
-I/O jobs are given the highest priority…
-in order to keep the peripherals working as much as possible…
-and because they would be blocked and ‘never see’ the processor if the others had
priority.
12. a) Explain the difference between paging and segmenting when referring to memory
management techniques. (2)

b) Describe how virtual memory can allow a word processor and a spreadsheet to run
simultaneously in the memory of a computer even though both pieces of software are
too large to fit into the computer’s memory. (3)

A. a)
-They are both methods of dividing up the available memory space into more
manageable pieces.
-Paging involves memory being divided into equal size areas.
-Segmenting involves areas of different size dependent upon the contents needing to
be stored.

b)
-The software code is divided up into parts that have some level of equivalence.
-Those most commonly used routines are kept together
-These are loaded into memory and other routines are
-only loaded when the user calls upon them.
-Thus they give the impression of being permanently available.

13. Describe how a PC operating system uses a file allocation table to find files when
necessary. (4)
A. -The disk surface must be divided up into small areas
-Files are stored in these small areas
-Each file will normally use more than one area
-The table of files has an entry pointing to the first area on the disk surface used by
that file and
-a pointer to the next area.
-Each subsequent area has a pointer to the next area, as in a linked list with…
-a null value to signify the end of the file.

(Total: 70)

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy