Digital PDFs
Documents
Guest
Register
Log In
DIGITAL-8-10-U
December 1965
6 pages
Original
0.2MB
view
download
Document:
digital-8-10-u-d
Order Number:
DIGITAL-8-10-U
Revision:
Pages:
6
Original Filename:
https://svn.so-much-stuff.com/svn/trunk/pdp8/src/dec/digital-8-10-u/digital-8-10-u-d.pdf
OCR Text
IDENTIFICATION I .I Digital-B-IO—U-Sym I .2 Binary-Coded—Decimal to Binary Conversion Subroutine I .3 March I, I965 POP-8 LIBRARY Dig ital-8- l O-U-Sym Page 2 2. ABSTRACT A basic subroutine for converting binary-coded-decimal numbers to their equivalent binary value. Conversion is accomplished by "radix deflation. 3. REQUIREMENTS 3. l Storage " This subroutine requires 23 (decimal) memory locations. 3.3 Equipment Standard PDP-8. 4. USAGE 4.l Loading Load the subroutine with the Binary or RIM Loader. 4.2 Calling Sequence Call with the number to be converted in the AC. Return will be to the location following the calling JMS with the result in the AC. 6. DESCRIPTION 6 .1 Discussion The method used is thatof "radix deflation. ” Upon entry, the BCD number may be considered to be in the following form. D2162+D116+D° 6.1.1.E What is desired is the number in the form. D2l02+D110+D° 6.].2.E The PDP-8 can shift (rotate) and add. A right shift is equivalent to a division by a power of An appropriate series of shifts, additions, and subtractions is used to convert the number from the form of 6.l l .E to that of 6. l .2.E. two. . 6.2 Example Consider the BCD number Digital-8-10—U-Sym Page 3 0101 0001 1001 representing the decimal number 519. First, the whole number is stored and then brought back into the AC. Next, the four most significant bits are masked out. At this point, the accumulator contains 16x16xA or 0101 0000 0000 1000 0000 A shift to the right of one bit yields 0010 This number is stored and then brought back to the AC, shifted right two bits, and the stored value added as follows 0000 1010 0000 0010 1000 0000 0011 0010 0000 Now the original number is added to this result 0011 0010 0000 0101 0001 1001 1000 0011 1001 and the most significant eight bits masked out as 1000 This is stored, 0011 0000 brought back and shifted right once,and the stored value added. 0100 0001 1000 1000 0011 0000 1100 0100 1000 Next the result of this addition is shifted right two places dividing the number by four as follows 0011 0001 0010 negated and the original number added 1100 1110 1110 0101 0001 1001 0010 0000 0111 This result represents in binary 512 plus 4 plus 2 plus 1 6.3 or 519,the original number. Scaling This subroutine assumes an integral BCD number and yields an integral binary equivalent. Digital-8— I O-U-Sym Page 4 METHOD 7.2 Algorithm The algorithm used is illustrated step by step in Section 10.4. EXECUTION TIME 9.2 Maximum The maximum (and invariant) execution time of this subroutine is 49.6 microseconds. 10. PROGRAM 10.4 Program Listing A listing of the subroutine with BCDBIN located at 0200 is given below. simplify mnemonics D 2, D 1, and DO 0200 0000 0201 3223 DCA TEMPPP 0202 1223 0203 0225 TAD TEMPPP AND MASKKA 0204 7110 CLL RAR 0205 3224 DCA TEMPPQ BCDBIN, 0 0206 1224 TAD TEMPPQ 0207 7012 RTR 0210 1224 TAD TEMPPQ 0211 1223 TAD TEMPPP 0212 0226 AND MASKKB 0213 3224 DCA TEMPPQ 0214 I224 TAD TEMPPQ 0215 7110 CLL RAR 0216 1224 TAD TEMPPQ 0217 7012 RTR 0220 7041 CIA 0221 1223 TAD TEMPPP /ABC IN BCD CODE IN AC /16 (16A + B) + c /16 (16A) /8 (16A) /8 (16A) /2 (16A) /10 (16A) /16 (26A + B) + C /16 (26A + B) /16 (26A + B) /8 (26A + B) /24 (26A + B) /6 (26A + B) /—6 (26A + B) /16 (16A + B) + C -6 (26A+ B) /=16x16A 6x26A + 16B 6xB+C /= 100A +1013 + c /BINARY VALUE IN AC - 0222 5600 JMP I BCDBIN 0223 0000 0 0224 0000 0225 7400 0226 7760 TEMPPP; TEMPPQ, MASKKA, MASKKB, To have been replaced respectively with A, B, and C. — 0 7400 7760 /MASK FOR MOST SIG. FOUR BITS /MASK FOR MOST SIG. EIGHT BITS Digital-8— l O-U—Sym Page 5 12. REFERENCES 12.3 DECUS Programs See DECUSCOPE January l965, article entitled ”Accelerated Radix Deflation on l4. the PDP—7 and PDP-8." ACKNOWLEDGEMENTS Mr. Donald V. Weaver, Consultant, of New York City, who first described the algorithm used by this subroutine in reference l2.3 has granted his kind permission to include this subroutine in the PDP-8 library so that a detailed description may be available.
Home
Privacy and Data
Site structure and layout ©2025 Majenko Technologies