FUNCTION MOMENTUM_PROM_ADDRESS(INDEX) C---------------------------------------------------------------------- C- C- Purpose and Methods : This changes an address byte of the form: C- P2 P1 P0 A7 A6 A5 A4 A3 A2 A1 A0 C- to an address byte of the form: C- P2 P1 A7 A6 A5 A4 A3 A2 A1 A0 P0 C- where Pn is a bit for selecting a page and An is a bit for selecting an C- address within that page. These bit patterns assume a range [0, 2047]. C- What actually is passed is a range [1, 2048]. C- C- This routine assumes that in the momentum lookup PROMs, 3 address C- bits are used for vertex Z-correction, and 8 address bits are used for C- input data. It needs to be changed if the address bits are going to be C- assigned with 2 address bits for vertex Z-correction and 9 address for C- input data. C- C- Returned value : The address using the different bit assignment. This C- will be on the range [1, 2048] C- Inputs : INDEX The address before the bits are moved around. This will C- be on the range [1, 2048] C- Outputs : none C- Controls: none C- C- Created 3-OCT-1990 MICHIGAN STATE UNIVERSITY, TRIGGER CONTROL SOFTWARE C- C---------------------------------------------------------------------- IMPLICIT NONE INTEGER MOMENTUM_PROM_ADDRESS INTEGER TEMP_VALUE INTEGER HIGH_TWO INTEGER MOVED_BIT INTEGER LOW_EIGHT INTEGER INDEX C TEMP_VALUE = INDEX -1 LOW_EIGHT = MOD(TEMP_VALUE, 256) MOVED_BIT = MOD(TEMP_VALUE, 512) - LOW_EIGHT HIGH_TWO = TEMP_VALUE - MOVED_BIT - LOW_EIGHT MOMENTUM_PROM_ADDRESS = HIGH_TWO + LOW_EIGHT * 2 & + MOVED_BIT / 256 + 1 C---------------------------------------------------------------------- 999 RETURN END C