(3b) Place a 1-bit in B7 wherever B9 and B10 disagree
(4) Replace bits 10 - 13 of B6 with bits 13 - 16 of B9
(5) Add B30, B31 bit by bit modulo 2; then multiply bit
by bit modulo 2. Put the results in B1 and B2
respectively
(6) Set b7 to 0 if b7 > 0 1 if b7 ≤ 0
(7) Cause the sign bit of B71 a) to be 0, b) to be 1
(8) B3 contains a character in bits 0-5; bits 6-23
are zero. Push this character into bits 12 - 17 of
B4 pushing 1 octal digit off either end of B4
(9) Make bit 5 of B80, 1 if b13 is odd; 0 if b13 is even
(10) Replace every other 1 bit of b60 with a 0 starting with
bit 23
(11) B12 contains the octal digits a b c d e f g h
B13 contains the octal digits A B C D E F G H
(a) Replace the contents of B12 by A b c d e f g H
(b) Replace the contents of B12 by E F G E a b c d
(c) Replace the contents of B12 by A b C d E f G h
preserving b13 in each case
Use only basic codes
(12) Reverse the order of the bits in B62
(13) Count in B31 the number of one-bits in B17
(14) Count in B41 the number of half words (regarded as
24-bit non-negative integers) in blocks 40 to 50 which contain an exact power of 2
(15) Suppose that lists A and B of 1000 half word numbers each are stored consecutively from
addresses A29 and A77. The lists are identical except where A contains a zero,
B does not and where B contains a zero, A does not.
Replace A with the list of all non-zero entries of the two lists, except where both entries are zero
(16) Ten full-word 48-bit signed integers are stored from
A10 onwards. Place their 48-bit sum in B30, B31 . The sum will not exceed 48-bits
(17) Write a programme to print the contents of block 10:
in octal. Print each word on a new line as two strings of 8 octal digits separated by a single space
Extracodes 1340 - 1344 may be used
(18) The following exercises involve three 24 × 24 matrices whose elements are zeros and ones.
Matrix F is held in B-lines 1 to 24, where the ith row of F is the contents of B(i + 1), i = 0 to 23.
Matrix G is similarly contained in B25 to B48. Matrix H is held in the left half words of the 24
consecutive full-words with addresses iA40, i = 0 to 23.
Thus half-word iA40 is the ith row of H.
(a) Set F = 0 (the zero matrix).
(b) Set H = I (the unit matrix).
(c) Compute in B80 the trace of G, taken modulo 2
(the trace of a matrix is the sum of its diagonal elements).
(d) Copy Gt (the transpose of G) to H.
(e) Compute the matrix product F × G and store it in the original location of G.
The elements are to be computed modulo 2.
The following solution is based on the fact
that if a ≠ 0 then [a & (a-1)] has exactly
one fewer 1 bits than a.
(18e)
The solution may be obtained by placing Gt in the H
position as above and then performing
the following instructions.
The elements of the matrix F × G are computed
row by row, the elements of each row being
computed in reverse order and shifted in from
the left. The element aij is computed as the
number of ones, taken modulo 2, in the
quantity b(i+1) & (jA40).