function m1reverse,dd
;
;+
; NAME:
;	M1REVERSE
;
; PURPOSE:
;	This function reverses the bits of the m1 lvdt reading.
;
; CATEGORY:
;	UTIL
;
; CALLING SEQUENCE:
;	M1REVERSE,Dd
;
; INPUTS:
;	Dd:	Then DN value from the M1 LVDT
;
; OUTPUTS:
;	This function returns the value of the M1 LVDT reading after bit
;	reversal.
;
; MODIFICATION HISTORY:
; 	Written by:	RA Howard, NRL, 1994
;
;	@(#)m1reverse.pro	1.1 10/05/96 LASCO IDL LIBRARY
;-

;
a=0L
d=dd and 'ffe0'xl
for i=0,15 do begin
    a = 2*a
    if (d and 1) then a=a+1
    d = d/2
endfor
return,fix(a)
end
