|
|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 Tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T V
Length: 1916 (0x77c)
Types: TextFile
Names: »V«
└─⟦180fe333a⟧ Bits:30000405 8mm tape, Rational 1000, SW CATALOG, 10_20_0
└─⟦180fe333a⟧ Bits:30000537 8mm tape, Rational 1000, SW Catalog 10_20_0
└─⟦5cb1d1d7f⟧ »DATA«
└─⟦3b1ee7bd8⟧
└─⟦this⟧
with Byte_Defs;
package Crc is
type Polynomial is array (0 .. 15) of Boolean;
-- Describes a CRC generator polynomial. Polynomial (I) is
-- True if and only if X**I is one of the polynomial terms.
-- The X**16 term is implicit. For example:
Crc16_Generator : constant Polynomial -- X**16 + X**15 + X**2 + 1
:= Polynomial'(15 => True, 2 => True, 0 => True, others => False);
subtype Byte is Byte_Defs.Byte;
subtype Byte_String is Byte_Defs.Byte_String;
Msb : constant := 0;
Lsb : constant := 1;
subtype Checksum is Byte_String (Msb .. Lsb);
All_0 : constant Checksum := (others => 16#00#);
All_1 : constant Checksum := (others => 16#FF#);
function "=" (X, Y : Checksum) return Boolean renames Byte_Defs."=";
function "xor" (X, Y : Checksum) return Checksum;
function "not" (X : Checksum) return Checksum;
function Image (X : Checksum) return String; -- ASCII image, base 2
function Convert (X : Checksum) return Natural; -- range 0 .. 2**16-1
function Convert (X : Natural) return Checksum;
-- This package assumes that bytes are transmitted LSBit first.
-- Because of this, checksum bytes are stored bit-reversed.
generic
Generator : Polynomial;
package Accumulator is
procedure Accumulate (R : in out Checksum; D : Byte);
-- Perform one step in the accumulation of a checksum.
procedure Accumulate (R : in out Checksum; D : Byte_String);
-- for I in D'range loop
-- Accumulate (Checksum, D (I));
-- end loop;
-- To calculate a packet checksum, allocate a variable
-- of type Checksum, initialize it as specified by the
-- protocol (usually All_0 or All_1), and Accumulate
-- over all the data bytes in transmission order.
-- Transmit the Checksum bytes in order MSB..LSB.
end Accumulator;
end Crc;