582 Electronic Computers /3I :5 



coding system shown in the example that follows allows the programmer 

 to write statements even more like algebra and English. These systems 

 all demand additional computer time in order to translate the program 

 to a code the computer can follow. 2 However, the saving in the time 

 of the programmer and the ease of spotting errors often make these 

 systems worth while. 



The following example, the computation of a square root, has been 

 included to illustrate the steps followed by the computer. This problem 

 is in itself trivially short, and it would not be profitable to use a com- 

 puter. However, a slight extension of the example, such as printing a 

 table of square roots, would be quicker with a high-speed digital com- 

 puter and would cost less than having a person compute the table using 

 a desk calculator. 



Example of Programming Digital Computers 



A. The problem : Find the square root of y, when < y < 1 . 



B. Algebraic method. 



Guess an answer x 1 



Assume correct answer is x = x x + A*! 



/. y = x 2 = x 2 + 2x 1 Ax 1 + (Ax x ) 2 

 Assume (Aa^) 2 is negligible, 



•'• y — *i = 2*^*! 



Or ***'£? 



2nd guess answer is x 2 — x x + Ax x 

 Assume correct answer is x = x 2 + Ax 2 

 Assume (A# 2 ) 2 is negligible, 



• A * - y ~ xl 

 " A * 2 ~ 2x 2 



3rd guess answer is x 3 = x 2 + Ax 2 

 and so on. 



Process may be stopped when | Ax \ is less than some pre-assigned limit of error. 



C. Computer program. For illustrative purposes, the program has been 

 written with English words and algebraic symbols. For actual digital 

 computer programs, one must write the various operations in the numerical 

 code built into the computer, or else use a system as shown in Part D of 

 this example. The program there must be translated by the machine into 

 a program it can understand, and then this program must be fed back 

 into the computer. 



2 For the IBM 704, CLA must be translated to the binary code 000 101 000 010 

 and MPY to 000 010 000 000. 



