Digital PDFs
Documents
Guest
Register
Log In
XX-D3317-50
2000
4 pages
Original
90.8kB
view
download
Document:
PDP7 appNote701
Order Number:
XX-D3317-50
Revision:
Pages:
4
Original Filename:
http://bitsavers.org/pdf/dec/pdp7/PDP7_appNote701.pdf
OCR Text
APPLICATION NOTE 701 PROGRAM PDP-7 Gray Code Conversion COMPUTER SYSTEM PDP-7 with special lOT instructions that permit the input of an encoded number in Gray binary. DESCRIPTION n The Gray code is a specific n bit counting sequence of 2 counts having the characteristics of being nonweighted, monostrophic (binary codes in which only one bit changes from count to count) and reflected (represents a numbering system of a radix r, and by complementing a given bit, which is the same bit for all counts and is usually the most significant bit, will yield the r-1 l s complement of the original count) and represents a specific ordered n numbering system of 2 counts. METHOD Adjacent bits in the Gray word are compared. When they are equal, the corresponding normal bit is set to O. When they are different, the corresponding normal bit is set to 1. EXAMPLE Gray binary input = 10100 Compute normal binary by comparing bits 1 0 1 0 0 Gray 1 1 0 0 0 Normal ~/~/~/~/~ SPECIFICATIONS Timing 1. Size-oriented subroutine: 21 jJsec + 12.25 x N jJsec + 8.75 jJsec average time = 210 jJsec for 18-bit Gray code word 2. Speed-oriented subroutine: 7 jJsec + 7 x N jJsec + 3.5K jJsec average time = 101 .5 jJsec for 18-bit Gray code word where N is the number of Gray bits = 1 where K is the number of Gray bits = 0 PDP 7 _ 3RA.R" Page 2 Storage Requirements 1. Size-oriented subroutine 14 locations 2. Speed-oriented subroutine 3 + 31 locations where I is the number of bits in the Gray code word USAGE The size-oriented routine is entered with the Gray code to be converted in the AC. The routine returns with the converted number (in normal binary) in the AC. LAC A JMS GRYBIN where A is the Gray code to be converted. The speed-oriented routine is open coding, to be used when the number of Grey code bits to be converted is known. Size-Oriented Conversion Routine Flow Chart 7 Page 3 LISTING Size-Oriented Routine /GRAY CODE TO NORMAL BINARY - SIZE ORIENTED o GRYBIN, DAC TEMP LAC (-11 DAC COUNT LAC TEMP Cll RAL SPl XOR (400000 RAl ISZ COUNT JMP .-4 RAl JMP I GRYBIN /INITIALIZE COUNTER FOR 12-BIT CONVERSION /FIRST NORMAL BIT - FIRST GRAY BIT /MOVE NORMAL BIT /HAVE 12 BITS BEEN CONVERTED /NO - CONTINUE; lOOP /MOVE LAST NORMAL BIT /RETURN STORAGE MAP TEMP COUNT (Gray number to be converted) C (TEMP) Contains indexable constant for 12-bit conversion SPEED-ORIENTED IN-liNE CODING /MAIN PROGRAM Cll RAl SPl XOR (400000 RAl SPl XDR (400000 RAl /REPEAT UNTil I BITS HAVE /BEEN CONVERTED RAl /MAIN PROGRAM DEFINITION OF TERMS AC C(AC) C(A) C(B) lOT Accumulator Contents of AC Contents of B are replaced by the contents of A Input-output transfer commands 7 LIBR.u.R Page 4 COMPARISON OF NUMBER SYSTEMS Binary Gray Normal Decimal 1 11 10 110 111 101 100 1100 1101 1111 1110 1010 1011 1001 1000 11000 1 10 11 100 101 110 111 1000 1001 1010 1011 1100 1101 1110 1111 10000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 7 6 R t, R'l
Home
Privacy and Data
Site structure and layout ©2025 Majenko Technologies