Contact us Heritage collections Image license terms
HOME ACL Associates Technology Literature Applications Society Software revisited
Further reading □ ContentsIntroduction0. Introductory exercises1. Basic operations2. Modification, counting and testing3. B-register operations4. Accumulator operations5. Extracode functions6. Input and output operations7. Magnetic tape operations8. Advanced programming techniques9. Complete programs
ACD C&A INF CCD CISD Archives Contact us Heritage archives Image license terms

Search

   
ACLLiteratureAtlas manualsABL Exercises :: ATLAS 1 COMPUTER ABL PROGRAMMING EXERCISES
ACLLiteratureAtlas manualsABL Exercises :: ATLAS 1 COMPUTER ABL PROGRAMMING EXERCISES
ACL ACD C&A INF CCD CISD Archives
Further reading

Contents
Introduction
0. Introductory exercises
1. Basic operations
2. Modification, counting and testing
3. B-register operations
4. Accumulator operations
5. Extracode functions
6. Input and output operations
7. Magnetic tape operations
8. Advanced programming techniques
9. Complete programs

4 ACCUMULATOR OPERATIONS

4.1 Floating Point Numbers (see Chapter 5)

Exercises

(1)

Convert the ten decimal numbers of List 1 to standardised floating point form, giving the result as the number pair (mantissa, exponent), where

mantissa = sign bit.octal fraction

exponent = decimal integer

For example, 4.5 = (0.44, 1)

List 1
  1. 0
  2. -100
  3. 125 × 10-3
  4. (-2)-9
  5. 375 × 10-3
  6. -250 × 2-14
  7. 1/10 (to 13 octal digits)
  8. 3 × 85
  9. -1000000
  10. 1.3

(2)

Store the first five numbers of List 1 in standardised floating point form in full words iA1, i = 0 to 4, using only B-type instructions.

(3)

Write in octal form the numbers stored in full words A1 to A10 by the section of ABL program shown in List 2. For example, the contents of A6 are J4, i.e. (A6) = J4.

List 2
  1. +1 (: + 2)
  2. +K765 (:-2)
  3. -K1.0:5
  4. +0:26
  5. -1 (:-1):2
  6. +0
  7. +1 (2)
  8. -K 2.3 (2) : K10
  9. + 4 (:-2)
  10. -2 (:3):4

4.2 Results of Accumulator Instructions (see Chapter 3)

Exhibit the contents of the accumulator after the execution of each of the following sets of instructions. Use the notation

ay' = J (3 octal digits)

m' = octal digit . (13 octal digits, omitting right hand zeroes)

l' = . (13 octal digits, omitting right hand zeroes)

sign l' = 0 or 1

For example, the instruction

     1) + 16
     324     0    0     A1

leaves the accumulator in the state

    ay' = J002
     m' = 0.2
     l' = .0
sign l' = 0

Exercises

(1)

     1) -16
     324     0    0     A1

(2)

     1) +K21.5:13
     334     0    0     A1

(3)

     1) +K275.123456 +0:26
     324     0    0     A1
     320     0    0     1A1

(4)

     1) +K73:3
     334     0    0     A1
     340     0    0     J4

(5)

     1) -10
     344     0    0     A1
     101     124  0     A1
     163     124  0     0

In problems (6) onward, in addition to showing the final state of the accumulator, indicate accumulator overflow (AO), exponent overflow (SO) and exponent underflow (EU) and instruction(s) which caused them.

(6)

     1) -1
     346     0    0     J4
     331     0    0     A1

(7)

     1) -1(:127)
     344     0    0     A1
     121     124  0     0
     355     0    0     J4

(8)

     1) +K2,-K3
     324     0    0     A1
     352     0    0     1A1

(9)

     1) -K1(:127)
     325     0    0     A1

(10)

     1) +5
     2) +1(:-24)
     324     0    0     A1
     320     0    0     A2

(11)

     1) +K.4
     344     0    0     A1
     364     0    0     J4
     365     0    0     J4

(12)

     1) -1(:64)
     314     0    0     A1
     372     0    0     A1
     365     0    0     J4

(13)

     1) +.125(:-127), +0
     324     0    0     A1
     332     0    0     1A1
     366     0    0     J4

(14)

In this problem exhibit the contents of the store line before and after the instruction is performed.

     1) -1
     335     0    0     A1
     356     0    0     A1

(15)

     1) +1 
     2) -1
     324     0    0     A1
     373     0    0     A2

4.3 Further Accumulator Instructions (see Chapter 3 and Chapter 6)

In questions 1), 2) and 3) the standardised floating point numbers a0, a1, ..., a99 are held in addresses iA79, i = 0 to 99.

(1) Place their double length floating point sun in the accumulator, round to single length and store the result in A80.

(2) Place the integral part of a0 in the accumulator in double length fixed point form (exponent = 25, mantissa = int. pt. a0 × 8-25)

(3) Assume that the accumulator holds a double length floating point number Z. Compute the product of that number, double length, with V = (A90) and leave the result in the accumulator.

In questions 4), 5), 6) and 7) the integers x0, x1, ..., x99 are stored in (iA100), i = 0 to 99 in the substandard floating point form (12, xi × 8-12).

(4) Working fixed point, store their alternating sum x0 - x1 + x2 - ... in A99.

(5) Place the integral part of the quotient x0/x1 in A399 and the remainder in 1A399, both in the substandard form. Assume x0 and x1 to be positive.

(6) Store x3 × x4 as a standardised double length number in A341, 1A341.

(7) Working fixed point, form the quotient 936.29 / 48.01 to 3 octal places and store it in A309 in the substandard form (10, x). Store the remainder in standardised floating point form in 1A309. The operands should be stored by program.

Answers: 4.1 Floating Point Numbers

(1)

  1. (0.0, -128)
  2. (1.634, 3)
  3. (0.1, 0)
  4. (1.0, -3)
  5. (0.3, 0)
  6. (1.014, -2)
  7. (0.6314631463146,-1)
  8. (0.3, 6)
  9. (1.41367, 7)
  10. (0.1231463146315, 1)

(2)

(1)
     121     1    0     J4
     113     1    0     A1
     113     0    0     0.4A1
(2)
     121     1    0     J007634
     113     1    0     1A1
     113     0    0     1.4A1
(3)
     121     1    0     1U9
     113     1    0     2A1
     113     0    0     2.4A1
(4)
     121     1    0     J773
     113     1    0     3A1
     113     0    0     3.4A1
(5)
     121     1    0     K3U9
     113     1    0     4A1
     113     0    0     4.4A1

(3)

  (A1)  =  J0061
  (A2)  =  J002765
  (A3)  =  J01377777
  (A4)  =  J064
  (A5)  =  J005777
  (A7)  =  J006144
  (A8)  =  J021777774224
  (A9)  =  J7764
  (A10) =  J0116

Answers: 4.2 Results of Accumulator Instructions

(1)

    ay' = J002
     m' = 7.6
     l' = .0
sign l' = 0

(2)

    ay' = J015
     m' = 0.00...021 (13 octal place fraction)
     l' = .0
sign l' = 0

(3)

    ay' = J003
     m' = 0.275 (integral part of (A1))
     l' = .0
sign l' = 0

(4)

    ay' = J002
     m' = 0.73
     l' = .0
sign l' = 0

(5)

    ay' = J001
     m' = m
     l' = .66
sign l' = 1

(6)

    ay' = J0  A0 set by 331
     m' = 1.0
     l' = .0
sign l' = 0

(7)

    ay' = J765
     m' = 7.0
     l' = .0
sign l' = 0

(8)

    ay' = J002
     m' = 7.72
     l' = .0
sign l' = 1

(9)

    ay' = J200   B0 set by 325
     m' = 0.1
     l' = .0
sign l' = 0

(10)

    ay' = J001
     m' = 0.5000000000001
     l' = .000000000001
sign l' = 0

(11)

    ay' = 0
     m' = 7.4
     l' = .0
sign l' = 0

(12)

    372   0   0   A1 gives EO and AO
    ay' = J200
     m' = 0.1
     l' = .0
sign l' = 0

(13)

    ay' = J601
     m' = .1
     l' = .0
sign l' = 0

(14)

The contents of the store line before and after the instruction are the same, i.e. J001 and the 335 instructions sets AO.

(15)

    ay' = J001
     m' = 0.1
     l' = .0
sign l' = 0

Answers: 4.3 Further Accumulator Exercises

(1)

1) +02) +0 121 1 0 -97 121 2 0 13U13 324 0 0 A79 300 0 0 1A793) 357 0 0 A1 110 2 0 A1 300 0 1 99A79 356 0 0 A2 355 0 0 J4 320 0 0 A1 300 0 0 A2 201 127 1 A3 361 0 0 J4 356 0 0 A80countto modify exponenta0 inadd aistore right halfwith correct exponentadd in next astore left halfstandardize right halfadd original right halfadd in left halfrepeatround resultstore

(2)

  1) 0.26
     324     0    0     A79
     330     0    0     A1
     364     0    0     J4
     122     124  0     J001    to get exponent 25

(3)

Let Z1 and Z2 denote the more and less significant halves of Z, and W1 and W2 the halves of the product VZ. Thus VZ = W1 + W2. Working space is A1, A2...

356 0 0 A1 355 0 0 J4 342 0 0 A90 356 0 0 A2 355 0 0 J4 356 0 0 A3 324 0 0 A1 342 0 0 A90 356 0 0 A4 355 0 0 J4 320 0 0 A3 356 0 0 A3 324 0 0 A4 300 0 0 A2 356 0 0 A2 355 0 0 J4 300 0 0 A3 300 0 0 A2store Z1standardize Z2form VZ2store (VZ2)1std (VZ2)2store (VZ2)2load Z1form VZ1store (VZ1)1std (VZ1)2add(VZ2)2store first partial W2load (VZ1)1add (VZ2)1store partial W1std second partial W2add first partial W2add partial W1

(4)

346 0 0 J42) 121 1 0 -100 124 1 0 2 330 0 1 98A100 331 0 1 99A100 215 127 1 -3*

(5)

345 0 0 A100 364 0 0 J4 375 0 0 1A100 121 124 0 12U12 357 0 0 A399 356 0 0 1A399

(6)

324 0 0 3A100 342 0 0 4A100 356 0 0 A341 355 0 0 J4 356 0 0 1A341

(7)

1) 936.29 : 10 2) 48.01 : 10 345 0 0 A1 364 0 0 J4 364 0 0 J4 364 0 0 J4 375 0 0 A2 121 124 0 10U12 347 0 0 A309 121 124 0 7U12 340 0 0 J4 356 0 0 1A309position dividend
⇑ Top of page
© Chilton Computing and UKRI Science and Technology Facilities Council webmaster@chilton-computing.org.uk
Our thanks to UKRI Science and Technology Facilities Council for hosting this site