For Programmers: Free Programming Magazines  


Home > Archive > Fortran > June 2004 > Convering CDC 60-bit binary data









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Convering CDC 60-bit binary data
Jeff

2004-06-03, 7:24 pm

I am working on a project where I need to write a program to convert
some old data to a more useful form. Currently the data is in CDC,
60-bit binary format and in the end it needs to be converted to ASCII.
I would like to write a program to convert this data, but I am unsure
on how to do so.

Any information the CDC format, how to do this, or where to find
information would be helpful.

Thank you,
Jeff
Herman D. Knoble

2004-06-03, 7:24 pm

Jeff:
..
If by CDC 60-bit binary format you mean a fixed known number of
60-bit real numbers in records, Compaq Fortran (and I believe
the newer Intel Fortran compilers) supports an OPEN option: CONVERT='CRAY'
that will allow you to read and convert that data.

If logical records span physical records, or the logical records are
variably blocked, then the job is messier; in this case you may need also
to use the OPEN option: FORM='BINARY'
and play games bypassing the "green words" - fields in the
record used mark variable blocks of data for the Input/Output
Control System (Input/Output Fortran library logic).

Skip Knoble

On 1 Jun 2004 10:40:13 -0700, jwl165@psu.edu (Jeff) wrote:

-|I am working on a project where I need to write a program to convert
-|some old data to a more useful form. Currently the data is in CDC,
-|60-bit binary format and in the end it needs to be converted to ASCII.
-| I would like to write a program to convert this data, but I am unsure
-|on how to do so.
-|
-|Any information the CDC format, how to do this, or where to find
-|information would be helpful.
-|
-|Thank you,
-|Jeff


Herman D. (Skip) Knoble, Research Associate
(a computing professional for 38 years)
Email: SkipKnobleLESS at SPAMpsu dot edu
Web: http://www.personal.psu.edu/hdk
Penn State Information Technology Services
Academic Services and Emerging Technologies
Graduate Education and Research Services
Penn State University
214C Computer Building
University Park, PA 16802-21013
Phone:+1 814 865-0818 Fax:+1 814 863-7049
Herman D. Knoble

2004-06-03, 7:24 pm

Jeff: This utility program may also help.
http://www.scd.ucar.edu/docs/conver...ools/ncaru.html

Skip

On Tue, 01 Jun 2004 14:21:44 -0400, Herman D. Knoble <SkipKnobleLESS@SPAMpsu.DOT.edu>
wrote:

-|Jeff:
-|.
-|If by CDC 60-bit binary format you mean a fixed known number of
-|60-bit real numbers in records, Compaq Fortran (and I believe
-|the newer Intel Fortran compilers) supports an OPEN option: CONVERT='CRAY'
-|that will allow you to read and convert that data.
-|
-|If logical records span physical records, or the logical records are
-|variably blocked, then the job is messier; in this case you may need also
-|to use the OPEN option: FORM='BINARY'
-|and play games bypassing the "green words" - fields in the
-|record used mark variable blocks of data for the Input/Output
-|Control System (Input/Output Fortran library logic).
-|
-|Skip Knoble
-|
-|On 1 Jun 2004 10:40:13 -0700, jwl165@psu.edu (Jeff) wrote:
-|
-|-|I am working on a project where I need to write a program to convert
-|-|some old data to a more useful form. Currently the data is in CDC,
-|-|60-bit binary format and in the end it needs to be converted to ASCII.
-|-| I would like to write a program to convert this data, but I am unsure
-|-|on how to do so.
-|-|
-|-|Any information the CDC format, how to do this, or where to find
-|-|information would be helpful.
-|-|
-|-|Thank you,
-|-|Jeff
-|
-|
-| Herman D. (Skip) Knoble, Research Associate
-| (a computing professional for 38 years)
-| Email: SkipKnobleLESS at SPAMpsu dot edu
-| Web: http://www.personal.psu.edu/hdk
-| Penn State Information Technology Services
-| Academic Services and Emerging Technologies
-| Graduate Education and Research Services
-| Penn State University
-| 214C Computer Building
-| University Park, PA 16802-21013
-| Phone:+1 814 865-0818 Fax:+1 814 863-7049


Herman D. (Skip) Knoble, Research Associate
(a computing professional for 38 years)
Email: SkipKnobleLESS at SPAMpsu dot edu
Web: http://www.personal.psu.edu/hdk
Penn State Information Technology Services
Academic Services and Emerging Technologies
Graduate Education and Research Services
Penn State University
214C Computer Building
University Park, PA 16802-21013
Phone:+1 814 865-0818 Fax:+1 814 863-7049
James Giles

2004-06-03, 7:24 pm

Herman D. Knoble wrote:
> Jeff:
> .
> If by CDC 60-bit binary format you mean a fixed known number of
> 60-bit real numbers in records, Compaq Fortran (and I believe
> the newer Intel Fortran compilers) supports an OPEN option:
> CONVERT='CRAY' that will allow you to read and convert that data.


Cray is not CDC. The Cray is 64-bit, not 60-bit.

--
J. Giles


Richard Maine

2004-06-03, 7:24 pm

jwl165@psu.edu (Jeff) writes:

> Any information the CDC format, how to do this, or where to find
> information would be helpful.


I don't have any handy converters, but I can look up the formats.
I sort-of remember them, but a little help from Grisham will keep
me from going too far off track. My references are on paper only
(mostly Grisham's "Assembly Language Programming", though I think I
also have a CDC Fortran manual somewhere in my archives at home).
I didn't try google, as I figure you ought to be able to do that as
well as I can.

You didn't mention what type the data is. The main possibitities are

1. Character. Typically CDC display code, 6-bits per character,
10 characters per 60-bit word. I don't want to transcribe the
whole table, but the letter (one case only) are codes 1 to 26
(decimal) and the digits 0-9 are codes 27 to 36 (decimal).

There are other possibilities sch as 6/12-bit ascii, but that
isn't as common. (Some characters take 6 bits; others take 12).

2. Integer. 60-bit binary one's complement. Note that is one's
complement, rather than the 2's complement more common on most
current systems. I.E. The range is symmetric, with negative
values being the complement of the corresponding positive values.
In particular, all bits on is negative zero - not negative 1 as
it would be with 2's complement.

Some operations are restricted to integers in which the top 12
bits are all 0 (for positive) or all 1 (for negative), so you
effectively have only 48 bits of range instead of 60, but that
isn't an issue if all you are doing is translating the format.

3. Floating point. (Single precision. Double is rarely used; I
think I recall that all it does is add 48 more bits from the
mantissa of the second word, ignoring the second sign and
exponent bits, but I'd have to check more to be sure of the
details.)

1 bit - sign. For negatives, the whole word is complemented,
not just the sign bit alone.
11 bits - exponent, biased by 2000 octal. Thus an exponent
of 0 is represented as 2000 octal, an exponent of
1 is represented as 2001 octal. The biasing is
done in one's complement, just like integers, so
an exponent of -1 is represented as 1776 octal,
-2 is represented as 1775 octal, etc. The exponent
representation of 1777 (which would "naturally" be
a redundant negative zero exponent) is reserved for
"indefinites", which are petty much the same concept
as IEEE NaNs. Oh, and the largest exponent, 3777
octal, is for infinities.
48 bits - mantissa. Note that there is no "hidden bit" as
in IEEE. What you see is what you get. Note also
that the implied binary point is on the right end
of the mantissa, that is the mantissa is always an
integer (before scaling by the exponent).

Examples (all in octal, shamelessly copied from Grisham so
that I won't screw them up)

0.5 = 1776 000...buncha zeros...000 01
16. = 2000 000...buncha zeros...000 20
16. = 2004 000...buncha zeros...000 01
16. = 1724 400...buncha zeros...000 00
This shows several possibilities for the 16.; only the
last one is normalized. And
-16. = 6053 377...buncha 7's ...777 77

With this data, it is simple enough to write a converter, though I
don't have one handy. About 3 decades ago I did one on an IBM
mainframe because I had screwed up and accidentally written an
unformatted tape instead of a formatted one (and by the time I found
it out, it was inconvenient to get back to the CDC at another site to
rewrite the tape). The one I did then is long lost and irretrievable
(and probably in such bad style that I'd be embarrased for it to be
seen in public). Usually the hardest part is getting the 60-bit
data stored and broken up into appropriate 60-bit words.

--
Richard Maine | Good judgment comes from experience;
email: my first.last at org.domain | experience comes from bad judgment.
org: nasa, domain: gov | -- Mark Twain
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com