# Comp q.pdf - NOVEMEBR 2019 1. State the function of the...

• 72

Course Hero uses AI to attempt to automatically extract content from documents to surface to you and others so you can study better, e.g., in search results, to enrich docs, and more. This preview shows page 1 - 3 out of 72 pages.

NOVEMEBR 20191.State the function of the control unit (CU) in the central processing unit (CPU).2.Explain the purpose of cache memory.3.Colours are represented by a computer as a combination of the three primary colours: red,green and blue.Numerical values are used to represent the different shades of each primarycolour.These values range from 0 to 255 in decimal, or 00 to FF in hexadecimal.(a) State why hexadecimal numbers are frequently used in computing.(b) State the number of bits used to represent a non-primary colour, such as yellow.(c) State the maximum number of colours that can be represented in a computer pixel4.Copy and complete the following truth table where:X = A XOR BY = A NOR CZ =X OR NOT Y5.Explain why abstraction is required in the design of algorithms.6.Construct a trace table for the following algorithm:K = 1N = 1M = 2loop while K < 5output(N,M)K = K + 1N = N + 2M = M * 2end loop7.Consider the following algorithm.N = 372X = N DIV 100Y = X + 10 * (N MOD 100 DIV 10)Z = Y + (N MOD 10) * 100ABCXYZ000
(a) Determine the values of variables X, Y, and Z after execution of this algorithm. Show yourworking.
(b) Construct this algorithm. You may assume that the array THREE is initialised with a sufficientnumber of elements.(c) Describe how a selection sort algorithm could be used to sort the arrayTHREE in ascending order .ANSWER KEY

Course Hero member to access this document

Course Hero member to access this document

End of preview. Want to read all 72 pages?