[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GCR Encoding



Bryan Parkoff asked:

>    Can Disk II Family read three or four (zero) bits that it will always
>show invalid?  Is it the truth that Disk II's hardware is designed to read
>only one or two (zero) bits?  Can you explain why?  Why do each byte require
>between $80 and $FF?  I do understand that between $00 and $7F can't be used
>because it will show more than two (zero) bits.
>    How did Steve Worniak decide to design logic chip that can only handle
>two (zero) bits?  I do know that he decides to use software by reading each
>bit.  If software is chosen to use without from hardware's help, two (zero)
>bits can be accurate because the rotation speed may vary.  If hardware is
>chosen to use its own hardware, three or more (zero) bits can be accurate
>because the rotation speed is always fixed.
>    I do see that most copy-protected disks contain more than three (zero)
>bits.  If it is true, it is called weak bit that GCR encoding could detect
>three (zero) bits before it can skip to continue reading next valid bits.
>    I am so curious why Apple II decide NOT to use standard MFM encoding
>that it does exist before 1970s, but all PC like 8080 and/or 8085 use MFM
>encoding (probably FM encoding) before 1970s.  Please explain every detail
>if you have great knowledge.

I would add only one thing to Eric's excellent explanation.

The analog read amplifier on the analog card must successfully detect
magnetic transitions and generate a pulse when one is detected.  Since
magnetic media, recording currents, and heads are not identical, and
subject to variations in response (particularly the media), it is necessary
to employ an automagic gain control (AGC) to maintain appropriate read
signal levels.

As long as a series of 1's are arriving, the AGC circuit has a good measure
of the read signal level, and can maintain good gain control.  But if there
is a series of 0's (no transitions), then the AGC circuit treats that as a
lack of sufficient signal gain, and turns up the gain.

If the average number of 1's goes too low for too long, the gain of the read
channel will be increased until random noise read from the media will be
interpreted as transitions.  This is why reading an erased disk will show
a random pattern of 1's and 0's.

To summarize, the presence of transitions, 1's, turns down the gain to
the proper level, and the absence of transitions causes the gain to rise
until "transitions" are detected, even if they are only noise.

The time constant of the AGC circuit must be chosen to be fast enough
to respond to relatively sudden changes in the response of the media, but
slow enough that it will not "turn up the volume" so fast that legitimate
strings of 0's will be corrupted by noise.  In the case of the SA400 drive
chosen by Apple (Steve Wozniac, actually), and compatible drives, the
time constant only allows two consecutive zeros to be read reliably in
the context of enough 1's.  (It is interesting to note that even three 0's
may be read reliably if they are preceded by several 1's--for example,
the nibble $F8.)

This constraint was adopted in the GCR scheme Woz designed (although
his original design was a bit more restrictive than required, resulting in
only 32 usable 7-bit-plus-"start"-bit nibbles, and only 13 sectors per track).
The 16-sector version of the code used the properties of the AGC circuit
to permit the two-consecutive-zero cases when they were surrounded by
sufficient 1's (transitions) to keep the AGC happy.

Timing constraints are also a real consideration, as pointed out by
Eric, but the read channel characteristics are fundamental.

-michael

Check out amazing quality sound for 8-bit Apples on my
Home page:  http://members.aol.com/MJMahon/