📄 rfc803.txt
字号:
| | | | | | | |
| | | 1| |0 | | |
| | | .-----------. .-----------. | | |
| | ->| | | |<- | |
| | | 1 | | 2 | | |
| | | B-W |<-----. .----->| W-B | | |
| | \-----------' | | \-----------' | |
| | | A | | A | | |
| | | | |0 1| | | | |
| | \-----' | | \-----' | |
| | 0 .-----------. 0 | |
| | | | | |
| | | 4 | | |
| | RUN | | RUN | |
| | .-----. \-----------' .-----. | |
| | | | A A | | | |
| | | V | | V | | |
| | .-----------. 1 | | 1 .-----------. | |
| \-->| |------' 0 \------| |<--' |
| | 3 |<--------------------| 0 | |
\---->| B-B |-------------------->| W-W |<----'
\-----------' 0 \-----------'
Figure 3. DFSA Model of Encoding
Dacom 450/500 Facsimile Data Transcoding PAGE 6
2.2. Formatting Considerations
Data are encoded for transmission by the Dacom 450 in 585-bit
frames, consisting of a 24-bit synchronization code, 37-bit leader,
512-bit information area and l2-bit checksum. There are two kinds of
frames distinguished by leader format, one for setup or initialization
and the other for the data itself. Serial binary image data are placed
in the data area of succeeding data frames.
The header of each frame is shown in Figure 4. The various fields
are defined in Table 1 following the Figure.
+-----------+--------+-------------------+----------+
| Sync Code | Leader | Data | CRC Code |
+-----------+--------+-------------------+----------+
24 / 37 \ 512 12
.-------' \----------------------.
/ \
+-------+-------+-------+-------+-------+-------+
| Flags | Count | X Pos | Black | White | State |
+-------+-------+-------+-------+-------+-------+
| 7 \ 10 12 3 3 2
| \--------------------------.
| \
+-----+-----+------+-----+-------+-----+
| Seq | RUN | COFB | RPT | Spare | SUB |
+-----+-----+------+-----+-------+-----+
2 1 1 1 1 1
Figure 4. Frame Format
Dacom 450/500 Facsimile Data Transcoding PAGE 7
Table 1. Header Field Definitions
Field Width Function Setup Data
(bits) Block Block
-----------------------------------------------------
Sync Code 24 Synchronization 30474730 (octal)
Seq 2 Sequence number 00 00,01,10,11
RUN 1 Initialize-start 0 1
COFB 1 Unknown 0 0
RPT 1 Unknown 1 0
Spare 1 Unknown 0 0
SUB 1 Indicates setup frame 1 0
Count 10 Number of bits in data All 1's
field (0 - 512)
X Pos 12 Current position on All 1's
scan line (0 - 1725)
Black 3 Current black field All 1's
length (2 - 7)
White 3 Current white field All 1's
length (2 - 7)
State 2 Current state (0 - 3) All 1's
Data 512 Data (0 - 512 bits)
CRC Code 12 CRC checksum. Uses polynomial
x**12 + x**8 + x**7 + x**5 + x**3 + 1
Dacom 450/500 Facsimile Data Transcoding PAGE 8
Setup frames have additional information in the data field; the
various fields and their functions are described in Table 2.
Table 2. Field Definitions for Setup Frame.
Field Width Function
--------------------------------
Start bit 1 Always zero
Speed bit 1 Set if express mode
Detail bit 1 Set if detail mode (speed and detail
bits both zero for quality mode)
14 inch 1 Set if 14-inch paper
5 inch 1 Set if 5-inch inch paper (14-inch
and 5-inch inch paper bits both zero
for 11-inch paper)
Paper present 1 Set if paper present in scanner
Spare 5 Can have any value
Multi-page 1 Set if multi-page mode
20 All 0's
480 Alternate 1's and 0's
The tailing setup frames differ from the leading setup frames only
in bits which indicate whether the system is operating in single or
multiple page mode and whether paper is present in the scanner.
All n-bit numeric fields (except Seq) are transmitted by the Dacom
450 machine least-significant-bit (LSB) first (i.e. Count, X Pos,
Black, White, State, CRC, and run length words in the data field).
All other fields are transmitted left-most bit first.
There are a few important points to be considered in regard to the
header of a data frame. The header contains enough information about
the state of the decoding algorithm to be able to re-establish correct
decoding in the event of loss or mutilation of a data frame. The
decoding algorithm resets its state variables to those in the header
each time it begins decoding a new data frame. One of the most
difficult problems encountered while constructing the decoding algorithm
was the correct synchronization of the algorithm as it proceeds across
the frame boundary with respect to the header information. In order for
synchronization to be maintained, the operation of the algorithm must
Dacom 450/500 Facsimile Data Transcoding PAGE 9
follow exactly that described in the previous section.
This requirement for every data frame to be self-synchronizing,
leads to a few subtleties in the encoding algorithm which seem quite
natural, but were not very obvious in the beginning.
1. Transition bits(s) labeling the arcs on the state transition diagram
in Figure 2 are not broken across frames. Similarly, individual
run-length words are not broken across frames.
2. If a frame ends with a transition, the header of the next frame
contains the state to which the transition is made.
3. If a frame ends with a transition out of state 0 or 3, then the
transition bit (0 or 1) is inserted at the end of the current frame
(not at the beginning of the next frame).
4. The field lengths for black and white runs in the header include
changes that may have been caused at the end of the previous frame.
5. If a frame begins with a white or black run, then this run is
treated (for purpose of decreasing its field length) as if it were
the beginning of a new run, since there is no information in the
header to indicate otherwise.
The decoding algorithm is initialized at the first data frame
received after the sequence of setup frames at the beginning of
transmission. The first data frame has a count of zero, indicating no
data bits are in the frame. The second data frame begins the actual
document; however, its X position appears to be irrelevant. Instead, we
assume the initial X position at this time is one pel to the left of the
right margin (-l mod l726). With these assumptions succeeding X
positions of the algorithm and the frame headers agree.
2.3. The Decoding Program
The decoding algorithm described above has been implemented in the
PDP-11 MACRO-11 assembly language for the RT-11 operating system. This
program contains extensive features for selectively dumping frames and
tracing the operation of the algorithm. It is designed to operate on a
file containing the raw data generated by the machine and does not
depend upon any prior reformatting of the data. However, it will
operate also on files in the so-called UCL format [4], which has been
adopted as the standard for use in the Internet Program. The existing
DCNET supporting software for the Dacom 450 uses the UCL format and
operates normally to copy data directly between the machine and the
file, with decoding operations done at a later time. However, there is
no intrinsic factor, except processing-rate limitations, why input data
could not be decoded directly from the machine.
In operation, the program scans the input data one bit at a time
and searches for the synchronization pattern. Note that all data
processed are inverted from the natural interface conventions. When a
Dacom 450/500 Facsimile Data Transcoding PAGE 10
synchronization pattern is found, the header and data portions are
extracted and the various state variable checked and reset, if
necessary. Checksum verification is performed according to the
polynomial 1 + x**3 + x**5 + x**7 + x**8 + x**12. In the case of setup
frames the format (detail, quality, express), page length (14, 8-l/2,
5-l/4) and multiple-page indicators are extracted from the data area.
Finally, under control of specified options, the header and data
portions of the frame are printed with appropriate headings.
The decoding algorithm itself is called for each data frame. It
produces an output consisting of a sequence of run-length pairs which
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -