




Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A subroutine for converting binary data to binary-coded-decimal (BCD) format for typeout, magnetic tape recording, etc. The subroutine uses 33 storage locations and requires a standard PDP-8. It is called by the JMS instruction and returns the BCD result in the accumulator.
Typology: Study Guides, Projects, Research
1 / 8
This page cannot be seen from the preview
Don't miss anything!





LIBRARY
Digital-8-14-U-Sym Page 3
After eight pases through the basic loop, the developed BCD representation is shifted left four bits and the "residual" least significant digit is added before exit.
6.2 Example
As an example consider the conversion of the binary equivalent of 512 decimal: 00 1 000 000 000 Successive calculations to obtain the most significant BCD digit are as follows: Link
Addition 00 1 000 000 000
Notice that the remainder is the binary representation of 12 decimal. Writing
The original binary number must be no larger than 999 (decimal) which is equiva- lent to 1747 (octal). The binary point is assumed to be at the extreme right end of the word (to the right of bit position 11) and the decimal point is also so positioned.
and 11. 1 •
In other words, this subroutine converts binary integers to BCD integers. Note that the subroutine is designed for positive input only!
METHOD
Algorithm The algorithm is straightforward and is fully described in sections 6.1, 10.4,
TIME = 216.0 + N x 3.
216.0 + 3X3.2 = 225.6 microseconds
I AC4-7 10 I AC 8-11 1
11. 1 Flow Chart
POINTER
(L)·O
CLA TAD NUMBER RAL ISZ POINTER
SNL
ENTER
DATA -+ INPUT (CDNTROLl-+ POINTER CLL (COUNTl-+AC
(AC) _NUMBER TAD INPUT TAD TABLE
(L )'
(AC)_INPUT
CLL RTL CLL RTL TAD INPUT JMP I BCD
RETURN
Digital-8-14-U-Sym Page 6