[go: up one dir, main page]

DE102007024410B4 - Method for operating a counter and counter circuitry - Google Patents

Method for operating a counter and counter circuitry Download PDF

Info

Publication number
DE102007024410B4
DE102007024410B4 DE200710024410 DE102007024410A DE102007024410B4 DE 102007024410 B4 DE102007024410 B4 DE 102007024410B4 DE 200710024410 DE200710024410 DE 200710024410 DE 102007024410 A DE102007024410 A DE 102007024410A DE 102007024410 B4 DE102007024410 B4 DE 102007024410B4
Authority
DE
Germany
Prior art keywords
memory
data words
words
counter
gray code
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
DE200710024410
Other languages
German (de)
Other versions
DE102007024410A1 (en
Inventor
Christian Wiegand
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Siemens Corp
Original Assignee
Siemens Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Siemens Corp filed Critical Siemens Corp
Priority to DE200710024410 priority Critical patent/DE102007024410B4/en
Publication of DE102007024410A1 publication Critical patent/DE102007024410A1/en
Application granted granted Critical
Publication of DE102007024410B4 publication Critical patent/DE102007024410B4/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03KPULSE TECHNIQUE
    • H03K21/00Details of pulse counters or frequency dividers
    • H03K21/40Monitoring; Error detection; Preventing or correcting improper counter operation
    • H03K21/403Arrangements for storing the counting state in case of power supply interruption
    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03KPULSE TECHNIQUE
    • H03K23/00Pulse counters comprising counting chains; Frequency dividers comprising counting chains
    • H03K23/004Counters counting in a non-natural counting order, e.g. random counters
    • H03K23/005Counters counting in a non-natural counting order, e.g. random counters using minimum change code, e.g. Gray Code

Landscapes

  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

Verfahren zum Betreiben eines Zählers, bei dem ein aktueller Zählerstand jeweils in Form einer Gruppe von binären Speicherworten in einem Speicher hinterlegt wird, wobei zur Inkrementierung oder Dekrementierung des Zählerstands jeweils folgende Verfahrensschritte durchgeführt werden:
a) Auslesen der Speicherworte (SW) des Zählerstands aus dem Speicher (2),
b) Umordnung von Bits der Speicherworte (SW) unter Verwendung einer inversen Permutationsregel zur Erzeugung einer Gruppe von dritten Datenworten (DW3), welche jeweils in einem erweiterten Gray-Code codierte Ziffern eines in einem Gray-Code codierten Zählerstand repräsentieren,
c) Konvertieren der einzelnen dritten Datenworte (DW3) unter Verwendung einer inversen Ziffern-Kodierungsregel jeweils in zweite Datenworte (DW2), welche jeweils die Ziffern des im Gray-Code codierten Zählerstands repräsentieren,
d) Konvertieren der Gruppe von zweiten Datenworten (DW2) unter Verwendung einer inversen Zähler-Kodierungsregel zur Erzeugung einer Gruppe von ersten Datenworten (DW1), welche jeweils die Ziffern des durch eine Ordinalzahl zu einer Basis n definierten Zählerstands (ZS) repräsentieren,...
Method for operating a counter, in which a current counter reading is stored in the form of a group of binary memory words in a memory, wherein the following method steps are carried out for incrementing or decrementing the counter reading:
a) reading the memory words (SW) of the counter reading from the memory (2),
b) rearranging bits of the memory words (SW) using an inverse permutation rule to generate a group of third data words (DW 3 ), each representing in an extended Gray code coded digits of a count coded in a Gray code,
c) converting the individual third data words (DW 3 ) using an inverse numerical coding rule into second data words (DW 2 ), which respectively represent the digits of the count coded in the Gray code,
d) converting the group of second data words (DW 2 ) using an inverse counter encoding rule to generate a group of first data words (DW 1 ) each representing the digits of the count (ZS) defined by an ordinal number to a base n, ...

Figure 00000001
Figure 00000001

Description

Die Erfindung betrifft ein Verfahren zum Betreiben eines Zählers, bei dem ein aktueller Zählerstand jeweils in Form einer Gruppe von binären Speicherworten in einem nichtflüchtigen Speicher hinterlegt wird. Darüber hinaus betrifft die Erfindung eine Zähler-Schaltungsanordnung, auch kurz „Zähler" genannt, mit einem nichtflüchtigen Speicher, um einen aktuellen Zählerstand jeweils in Form einer Gruppe von binären Speicherworten zu hinterlegen, und einer Recheneinheit mit einem Arbeitsspeicher, beispielsweise einem programmierbaren Logikbaustein oder einem programmierbaren Prozessor.The The invention relates to a method for operating a counter, in a current meter reading each in the form of a group of binary memory words in one nonvolatile Memory is deposited. About that In addition, the invention relates to a counter circuit arrangement, too short called "counter", with a nonvolatile Memory to a current count each to be deposited in the form of a group of binary memory words, and a computing unit with a working memory, for example a programmable logic device or a programmable one Processor.

Zähler der genannten Art werden vielfach in modernen Steuerungen und Regelungen verwendet. Um die Zählerstände persistent und unabhängig von der Stromversorgung zu speichern, werden diese vielfach in wiederbeschreibbaren Festwertspeichern wie z. B. EEPROMs abgelegt, deren Speicherzellen eine von der Anzahl der Schreibvorgänge abhängige begrenzte Lebensdauer haben. Die Zähler werden dabei in vielen Fällen mit einem Inkrement oder Dekrement von „1" verwendet. Bei einem herkömmlichen Binärzähler wird also fortgesetzt der Wert „1" zum Zählerstand addiert oder subtrahiert und dieser neue Zählerstand persistent gespeichert. Dabei ändert sich die niederwertigste Ziffer des Zählers am häufigsten, die Änderungen an den übrigen Ziffern nehmen logarithmisch zur gewählten Basis und mit der Anzahl der Stellen des Zählers ab. Werden nach einem Zählvorgang lediglich diejenigen Datenworte des Zählerstandes gespeichert, die geänderte Ziffern des Zählers enthalten, so wird die Lebensdauer des Zählers durch die Lebensdauer derjenigen Speicherzelle bestimmt, welche die niederwertigste Ziffer enthält.Counter of mentioned type are widely used in modern controls and regulations used. To keep the meter readings persistent and independent From the power supply, these are often in rewritable Read-only memory such. B. stored EEPROMs whose memory cells a by the number of writes dependent limited Have lifespan. The counters be in many cases used with an increment or decrement of "1." In a conventional one Binary counter is So the value "1" continues to count added or subtracted and this new meter reading persistently stored. It changes the least significant digit of the counter most often, the changes at the rest Numbers take logarithmically to the selected base and number the digits of the counter from. Become after a count only those data words of the count are stored, the modified Numerals of the counter included, so the life of the meter through the life that memory cell determines which is the least significant digit contains.

In der DE 101 44 077 A1 wird ein Verfahren angegeben, um durch geschickte Speicherung der Daten im Festwertspeicher die Lebensdauer des Zählers zu erhöhen. Bei diesem Verfahren werden bei einfachem Inkrementieren bzw. Dekrementieren die Änderungen an der niederwertigsten Ziffer eines Zählerstandes auf alle Speicherworte des Zählers gleich verteilt. So wird z. B. bei einer gewählten Basis von 16 für die Ziffern eines Zählers, dessen Ziffern in vier Speicherworten gespeichert werden können, die niederwertigste Ziffer mindestens 16-mal häufiger geändert als jede andere Ziffer. Diese Änderungen sind dann in allen Speicherworten gleich verteilt. Bei jedem 16. Schreibvorgang wird jedoch das Speicherwort, welches die zweite Ziffer enthält, ebenfalls geändert, bei jedem 256. Schreibvorgang dasjenige Speicherwort, welches die dritte Ziffer enthält und so fort. Im ungünstigsten Fall werden sogar alle Datenworte eines Zählers gleichzeitig geändert. Aus diesem Grund erreicht der in der DE 101 44 077 A1 angegebene Algorithmus keine Gleichverteilung der Schreibvorgänge auf den Speicherworten, und die Lebensdauer des Zählers wird wiederum durch dasjenige Speicherwort begrenzt, welches am häufigsten geändert wird.In the DE 101 44 077 A1 A method is provided to increase the useful life of the meter by skillfully storing the data in read-only memory. With this method, with simple incrementing or decrementing, the changes to the least significant digit of a counter reading are equally distributed to all the memory words of the counter. So z. For example, given a selected base of 16 for the digits of a counter whose digits can be stored in four memory words, the least significant digit is changed at least 16 times more frequently than any other digit. These changes are then distributed equally in all memory words. However, at every sixteenth write, the memory word containing the second digit is also changed, at each 256th write, that memory word containing the third digit, and so forth. In the worst case, even all data words of a counter are changed simultaneously. For this reason, the achieved in the DE 101 44 077 A1 For example, the algorithm does not uniformly distribute the writes to the memory words, and the lifetime of the counter is again limited by the one word word that is changed most frequently.

Die DE 691 32 626 T2 beschreibt ein Verfahren zum Betreiben eines Zählers, bei welchem ein inkrementierter oder dekrementierter Zählerstand mittels einer Kodierungsregel in Datenworte konvertiert wird.The DE 691 32 626 T2 describes a method for operating a counter, in which an incremented or decremented counter reading is converted into data words by means of a coding rule.

Die US 2004/0141580 A1 beschreibt einen digitalen Zähler, welcher die Zählkapazität einer vorgegebenen Anzahl an Speicherzellen maximiert, indem die Zählauslastung gleichmäßig verteilt wird, und indem sichergestellt wird, dass jede einzelne Zustandsänderung in jeder Speicherzelle einen Zählimpuls darstellt.The US 2004/0141580 A1 describes a digital counter which maximizes the count capacity of a given number of memory cells by evenly distributing the count load and ensuring that each individual state change in each memory cell represents a count pulse.

Die US 2004/0113822 A1 beschreibt eine Zähler-Schaltungsanordnung, bei welcher ein binär inkrementierter oder dekrementierter Zählerstand unter Verwendung einer Gray-Code-Kodierungsregel in Datenworte umgesetzt wird.The US 2004/0113822 A1 describes a counter circuit in which a binary incremented or decremented count is converted to data words using a Gray code encoding rule.

Die GB 2 180 083 A beschreibt ein Verfahren, bei welchem die Permutation der Bitposition bei Datenworten zur Optimierung der Gleichverteilung von Schreibvorgängen in einen Speicherbaustein erfolgt.The GB 2 180 083 A describes a method in which the permutation of the bit position in data words to optimize the uniform distribution of write operations in a memory module.

Es ist eine Aufgabe der vorliegenden Erfindung, ein verbessertes Verfahren zum Betreiben eines Zählers sowie einen entsprechenden Zähler anzugeben.It An object of the present invention is an improved method to operate a meter as well as a corresponding counter specify.

Diese Aufgabe wird durch ein Verfahren gemäß Patentanspruch 1 und eine Zähler-Schaltungsanordnung gemäß Patentanspruch 9 gelöst.These The object is achieved by a method according to claim 1 and a Counter circuitry according to claim 9 solved.

Das der Erfindung zugrunde liegende Prinzip beruht dabei darauf, dass der Zählerstand zunächst in drei nachfolgend erläuterten Stufen binär kodiert und in dieser konvertierten binären Form in dem nicht flüchtigen Speicher hinterlegt wird. Ausgegangen wird dabei zunächst von einem Zählerstand, der durch eine Ordinalzahl zu einer beliebigen Basis n definiert ist. Beispielsweise kann es sich um die Basis 10 handeln, dann ist der Zählerstand als Dezimalzahl definiert. Es kann sich aber auch um die Basis 16 handeln, so dass der Zählerstand in einer Hexadezimalform definiert ist. Da jegliche Rechnereinheiten wie Prozessoren, Logikbausteine etc. und auch Arbeitsspeicher nur binär arbeiten, sind dabei die einzelnen Ziffern der Ordinalzahl jeweils binär in Form von ersten Datenworten, beispielsweise mit einer Länge von 4 Bit, im Arbeitsspeicher hinterlegt und werden auch in dieser Form maschinell von einer Rechnereinheit, beispielsweise einem Logikbaustein oder einem programmierbaren Prozessor verarbeitet.The underlying principle of the invention is based on the fact that the count is first binary coded in three steps explained below and stored in this converted binary form in the non-volatile memory. The starting point is initially a count that is defined by an ordinal number to an arbitrary base n. For example, it may be the base 10, then the count is defined as a decimal number. However, it may also be the base 16, so that the count is defined in a hexadecimal form. Since all computer units such as processors, logic modules, etc. and also working memory only binary, while the individual digits of the ordinal are each binary in the form of first data words, for example, with a length of 4 bits, stored in memory and are also in this form of machine a computer unit, for example a logic module or a programmable processor verarbei tet.

Dieser zunächst durch die Ordinalzahl zur Basis n definierte Zählerstand wird dann in einer ersten Kodierungsstufe in einem Gray-Code kodiert. Dies erfolgt mit einer bestimmten Zähler-Kodierungsregel. Bei einem Gray-Code handelt es sich definitionsgemäß um einen Code, bei dem sich bei jeder Inkrementierung bzw. Dekrementierung einer Zahl um den Wert „1" jeweils nur eine der Ziffern der Zahl ändert. Aus diesem Grund wird ein Gray-Code oft auch als sog. „einschrittiger Code" bezeichnet. Bei einem Gray-Code unterscheiden sich folglich benachbarte Zahlen nur in einer einzigen Ziffer. Üblicherweise werden solche Gray-Codes als Kodierungsverfahren zur robusten Übertragung digitaler Größen über analoge Signalwege verwendet. Bei dem erfindungsgemäßen Verfahren wird dies vorteilhaft genutzt, damit sich bei einer Inkrementierung/Dekrementierung nur eine Ziffer der Ordinalzahlen zur Basis n des Codes ändert. Die einzelnen Ziffern des gray-kodierten Zählerstands werden dabei als binäre zweite Datenworte, die beispielsweise ebenfalls jeweils 4 Bit lang sind, digital innerhalb der Recheneinheit des Zählers verarbeitet und im Arbeitsspeicher hinterlegt.This first By the ordinal number to base n defined count is then in a coded first coding stage in a Gray code. this happens with a specific counter encoding rule. By definition, a Gray code is one Code where each increment or decrement occurs a number around the value "1" in each case only one the digits of the number changes. For this reason, a Gray code is often referred to as so-called "one-step Code ". In a Gray code, therefore, adjacent numbers differ only in a single digit. Usually such Gray codes as a coding method for robust transmission digital sizes over analog Signal paths used. This becomes advantageous in the method according to the invention used, so that in an increment / decrement only one Number of ordinal numbers to the base n of the code changes. The individual numbers of the gray-coded count are doing as binary second data words, which are also 4 bits long, for example, digitally processed within the arithmetic unit of the counter and in the working memory deposited.

Durch eine folgende weitere Konvertierung der einzelnen zweiten Datenworte, d. h. der einzelnen Ziffer des gray-kodierten Zählerstands, unter Verwendung einer Ziffern-Kodierungsregel werden dann die Ziffern des im Gray-Code kodierten Zähler stands in einem erweiterten Gray-Code in dritten Datenworten kodiert. Bei diesem Schritt wird dafür gesorgt, dass die einzelnen Ziffern in den dritten Datenworten so hinterlegt sind, dass sich beim Ändern einer Ziffer um den Wert „1" auch wieder nur ein Bit innerhalb des betreffenden dritten Datenworts, welches die jeweilige Ziffer darstellt, ändert. Durch diese doppelte Konvertierung, einmal des Zählerstands an sich und dann der einzelnen Ziffern, wird erreicht, dass sich in der gesamten Gruppe von dritten Datenworten, welche letztlich den Zählerstand in kodierter Form wiedergeben, bei der Inkrementierung/Dekrementierung des Zählerstands um den Wert „1" nur ein einzelnes Bit ändert. Dabei wird für die Ziffer-Kodierungsregel ein so genannter erweiterter Gray-Code genutzt, beispielsweise ein erweiterter ausgeglichener oder erweiterter reflektierter Gray-Code. Ein erweiterter Gray-Code ist hierbei so zu verstehen, dass es für verschiedene aufeinander folgende Zyklen, welche die binär kodierte Ziffer insgesamt durchlaufen kann (beispielsweise bei einer Hexadezimalziffer den Zyklus von 0 bis 15), unterschiedliche Zyklus-Kodierungsregeln bzw. Teil-Gray-Codes gibt, wobei diese Zyklus-Kodierungsregeln wiederum zyklisch bzw. reflektiert zyklisch nacheinander genutzt werden. Genaue Beispiele hierzu werden später noch erläutert. Durch den erweiterten Gray-Code kann dafür gesorgt werden, dass eine sehr günstige Verteilung der Änderungen der einzelnen Bits in den Ziffern auf die verschiedenen Bit-Stellen erfolgt.By a following further conversion of the individual second data words, d. H. the single digit of the gray-coded meter reading, using a digit encoding rule then becomes the digits of the gray code coded counter states coded in an extended Gray code in third data words. at this step will be for that made sure that the individual digits in the third data words do so are deposited that when changing a digit around the value "1" again only one bit within the third data word concerned, which is the represents each digit changes. Through this double conversion, once the meter reading itself and then The individual digits, that is achieved in the whole Group of third data words, which ultimately the meter reading in coded form, in the increment / decrement the meter reading around the value "1" only a single one Bit changes. It is for the digit encoding rule used a so-called extended Gray code, for example a extended balanced or extended reflected gray code. An extended Gray code is to be understood that it is for different consecutive cycles representing the binary coded digit in total can go through (for example, at a hexadecimal digit the Cycle from 0 to 15), different cycle coding rules or partial Gray codes in turn, these cycle coding rules in turn cyclically reflect be used cyclically one after the other. Exact examples of this will be later still explained. By The extended Gray code can be used to ensure that a very cheap Distribution of changes the individual bits in the digits to the different bit locations he follows.

Anschließend erfolgt in einem dritten Schritt unter Verwendung einer bestimmten Permutationsregel eine möglichst gleichmäßige Verteilung aller Bits dieser dritten Datenworte, welche die erweitert gray-kodierten Ziffern des gray-kodierten Zählerstands angeben, auf die Speicherworte. Dadurch wird dafür gesorgt, dass bei jeder Inkrementierung/Dekrementierung sich möglichst nur genau ein Speicherwort des Zählers ändert, und zwar weitgehend gleich verteilt über alle Speicherworte.Then done in a third step using a certain permutation rule one possible even distribution all bits of these third data words, which are the extended gray-coded ones Digits of the gray-coded count specify on the memory words. This ensures that every increment / decrement as possible only exactly one memory word of the counter changes, and Although largely equally distributed over all memory words.

Eine komplette Inkrementierung bzw. Dekrementierung des Zählerstands erfolgt dann erfindungsgemäß so, dass zunächst die Speicherworte des Zählerstands aus dem Speicher ausgelesen werden und dann gemäß der invertierten Permutationsregel die Bits der Speicherworte auf die dritten Datenworte verteilt werden. Diese dritten Datenworte werden dann unter Verwendung der inversen Ziffern-Kodierungsregel in die zweiten Datenworte konvertiert, welche die Ziffern (zur Basis n) des im Gray-Code kodierten Zählerstands in binärer Form repräsentieren. Schließlich erfolgt eine komplette Konvertierung der Gruppe von zweiten Datenworten, d. h. des gesamten Zählerstands an sich, unter Verwendung der inversen Zähler-Kodierungsregel, um die Gruppe von ersten binären Datenworten zu erzeugen, welche die Ziffern der Ordinalzahlen zur Basis n des Zählerstands repräsentieren. Dieser Zählerstand wird dann inkrementiert bzw. dekrementiert. Anschließend erfolgt wiederum eine Konvertierung der gesamten Gruppe von ersten Datenworten in die Gruppe von zweiten Datenworten unter Verwendung der Zähler-Kodierungsregel, dann die Konvertierung der einzelnen zweiten Datenworte jeweils in die dritten Datenworte unter Verwendung der genannten Ziffern-Kodierungsregel und schließlich wieder eine Umordnung der Bits der dritten Datenworte unter Verwendung der Permutationsregel zur Erzeugung der neuen Speicherworte des inkrementierten bzw. dekrementierten Zählerstands. Wie oben erläutert, hat sich bei einem solchen Vorgang vorzugsweise nur eines der Speicherworte geändert. Es werden dann die so erzeugten Speicherworte mit den im Speicher hinterlegten Speicherworten verglichen und es werden dann nur diejenigen Speicherworte bzw. nur dasjenige Speicherwort neu gespeichert bzw. überschrieben, welche(s) durch die Inkrementierung oder Dekrementierung geändert wurde(n).A complete incrementation or decrementation of the meter reading takes place according to the invention so that first the memory words of the meter reading are read from memory and then according to the inverted permutation rule the bits of the memory words are distributed to the third data words. These third data words are then using the inverse Digit encoding rule converted to the second data words, which the digits (base n) of the meter reading coded in Gray code in binary form represent. Finally done a complete conversion of the group of second data words, d. H. of the total meter reading in turn, using the inverse counter encoding rule to Group of first binary To generate data words that contain the numbers of the ordinal numbers Base n of the meter reading represent. This count is then incremented or decremented. Then done again a conversion of the entire group of first data words into the group of second data words using the counter encoding rule, then the conversion of the individual second data words respectively into the third data words using the mentioned digit encoding rule and finally again a rearrangement of the bits of the third data words using the permutation rule for generating the new memory words of incremented or decremented meter reading. As explained above, has become in such a process preferably only one of the memory words changed. It will then be the memory words generated with the memory deposited memory words compared and then only those Memory words or only that memory word newly stored or overwritten, which has been changed by incrementing or decrementing.

Das angegebene Verfahren ermöglicht es, Binärzähler in technischen Systemen derart zu implementieren, dass bei fortgesetztem Inkrementieren oder Dekrementieren die Anzahl der nötigen Schreibvorgänge auf die einzelnen Speicherworte des Zählers möglichst gleich verteilt ist. Damit wird bei Spei chermedien, deren Lebensdauer von der Anzahl der Schreibzugriffe auf einzelne Speicherworte begrenzt wird, die Anzahl möglicher Zählvorgänge und so die Lebensdauer des Speichermediums maximiert.The specified method makes it possible to implement binary counters in technical systems in such a way that, with continued incrementing or decrementing, the number of necessary write operations to the individual memory words of the counter is distributed as equally as possible. This is limited in memory media whose life is limited by the number of write accesses to individual memory words It maximizes the number of possible counts and thus the life of the storage medium.

Eine erfindungsgemäße Zähler-Schaltungsanordnung weist wie die bisherigen Zähler-Schaltungsanordnungen neben einem nicht flüchtigen Speicher, beispielsweise einem EEPROM oder ähnlichem Speicherbaustein, der dazu dient, den aktuellen Zählerstand jeweils in Form einer Gruppe von binären Speicherworten zu speichern, eine Recheneinheit mit einem Arbeitsspeicher auf. Bei der Recheneinheit kann es sich um ein oder mehrere Logikbausteine, beispielsweise um ein oder mehrere FPGAs oder ASICs, handeln, welche entsprechend programmiert sind. Alternativ kann es sich auch um einen oder mehrere mit einem entsprechenden Programm versehene Prozessoren handeln. Der Arbeitsspeicher ist dabei meist in dem Logikbaustein oder der Recheneinheit integriert. Dies ist aber nicht zwingend notwendig. Der Arbeitsspeicher kann auch auf andere Weise ausgebildet und von der Recheneinheit nutzbar sein.A inventive counter circuit arrangement has the same as the previous counter circuit arrangements next to a non-volatile memory, for example, an EEPROM or similar memory device, which serves the current meter reading each store in the form of a group of binary memory words, an arithmetic unit with a working memory. At the arithmetic unit it may be one or more logic devices, for example one or more FPGAs or ASICs, which act accordingly are programmed. Alternatively, it can also be one or more act with a corresponding program provided processors. The main memory is usually in the logic block or the arithmetic unit integrated. But this is not absolutely necessary. The working memory can also be formed in other ways and used by the computing unit be.

Die Recheneinheit umfasst hierbei, beispielsweise in Form von Softwaremodulen bzw. in Form von fest in den Logikbaustein einprogrammierten Modulen, folgende Komponenten:

  • a) eine Leseschnittstelle zum Auslesen der Speicherworte des Zählerstands aus dem Speicher und Ablegen in dem Arbeitsspeicher,
  • b) ein erstes Permutationsmodul zur Umordnung von Bits der Speicherworte unter Verwendung einer inversen Permutationsregel zur Erzeugung einer Gruppe von dritten Datenworten, welche jeweils in einem erweiterten Gray-Code codierte Ziffern eines in einem Gray-Code codierten Zählerstand repräsentieren,
  • c) ein erstes Ziffern-Konvertierungsmodul zum Konvertieren der einzelnen dritten Datenworte unter Verwendung einer inversen zweiten Kodierungsregel jeweils in zweite Da tenworte, welche jeweils die Ziffern des im Gray-Code codierten Zählerstands repräsentieren,
  • d) ein erstes Zählerstand-Konvertierungsmodul zum Konvertieren der gesamten Gruppe von zweiten Datenworten unter Verwendung einer inversen ersten Kodierungsregel zur Erzeugung einer Gruppe von ersten Datenworten, welche jeweils die Ziffern des durch eine Ordinalzahl zu einer Basis n definierten Zählerstands repräsentieren,
  • e) ein Inkrementierungs-/Dekrementierungsmodul zum Inkrementieren oder Dekrementieren des Zählerstands,
  • f) ein zweites Zählerstand-Konvertierungsmodul zum Konvertieren der gesamten Gruppe von ersten Datenworten unter Verwendung der ersten Kodierungsregel in eine Gruppe von zweiten Datenworten, wobei der durch eine Ordinalzahl zu einer bestimmten Basis n definierte Zählerstand wieder in einem Gray-Code kodiert wird und die zweiten Datenworte jeweils die Ziffern des gray-kodierten Zählerstands repräsentieren,
  • g) ein zweites Ziffern-Konvertierungsmodul zum Konvertieren der einzelnen zweiten Datenworte unter Verwendung der zweiten Kodierungsregel jeweils in dritte Datenworte, wobei jeweils die Ziffern des im Gray-Code codierten Zählerstands in einem erweiterten Gray-Code in den dritten Datenworten kodiert werden,
  • h) ein zweites Permutationsmodul zur Umordnung von Bits der dritten Datenworte unter Verwendung der Permutationsregel zur Erzeugung der Speicherworte, so dass die Bits der dritten Datenworte jeweils möglichst gleichmäßig auf die Speicherworte verteilt sind,
  • i) ein Vergleichermodul zum Vergleichen der so im Arbeitsspeicher erzeugten Speicherworte mit den im nichtflüchtigen Speicher hinterlegten Speicherworten und
  • j) eine Speicherschnittstelle zum Speichern bzw. überschreiben vorzugsweise nur derjenigen Speicherworte im nichtflüchtigen Speicher, welche durch die Inkrementierung oder Dekrementierung geändert wurden.
The arithmetic unit here comprises, for example in the form of software modules or in the form of modules permanently programmed in the logic module, the following components:
  • a) a read interface for reading the memory words of the counter reading from the memory and storing in the working memory,
  • b) a first permutation module for reordering bits of the memory words using an inverse permutation rule to generate a group of third data words each representing digits coded in an extended Gray code of a count coded in a Gray code,
  • c) a first digit conversion module for converting the individual third data words using an inverse second coding rule respectively into second data words, which respectively represent the digits of the count code encoded in the Gray code,
  • d) a first counter reading conversion module for converting the entire set of second data words using an inverse first coding rule to generate a group of first data words, each representing the digits of the count defined by an ordinal number to a base n,
  • e) an increment / decrement module for incrementing or decrementing the meter reading,
  • f) a second meter reading conversion module for converting the entire group of first data words into a group of second data words using the first coding rule, wherein the count defined by an ordinal number at a certain base n is coded again in a Gray code and the second ones Data words in each case represent the digits of the gray-coded meter reading,
  • g) a second digit conversion module for converting the individual second data words using the second coding rule into third data words in each case, wherein in each case the digits of the count coded in Gray code are encoded in an extended Gray code in the third data words,
  • h) a second permutation module for rearranging bits of the third data words using the permutation rule for generating the memory words, so that the bits of the third data words are each distributed as evenly as possible to the memory words,
  • i) a comparator module for comparing the memory words thus generated in the main memory with the memory words stored in the nonvolatile memory, and
  • j) a memory interface for storing or overwriting preferably only those memory words in the nonvolatile memory which have been changed by the incrementing or decrementing.

Dabei können das erste und das zweite Permutationsmodul, das erste und das zweite Ziffern-Konvertierungsmodul und das erste und das zweite Zählerstand-Konvertierungsmodul auch jeweils durch ein einzelnes Permutationsmodul, ein einzelnes Ziffern-Konvertierungsmodul bzw. ein einzelnes Zählerstand-Konvertierungsmodul realisiert sein, welche jeweils in der Lage sind, die Umordnung der Bits bzw. Konvertierung der Datenworte unter Anwendung der entsprechenden Permutationsregel bzw. Kodierungsregel direkt oder in inverser Form anzuwenden.there can the first and the second permutation module, the first and the second Digit conversion module and the first and second meter reading conversion module also each by a single permutation module, a single Digit conversion module or a single counter reading conversion module be realized which are each capable of rearranging the bits or conversion the data words using the appropriate permutation rule or Apply coding rule directly or in inverse form.

Wie bereits erwähnt, wird als Recheneinheit vorzugsweise ein programmierbarer Logikbaustein oder Prozessor verwendet, so dass die einzelnen Module in Form von Softwaremodulen realisiert werden können, die dann in dem jeweiligen Baustein einprogrammiert werden. Daher umfasst die Erfindung auch ein entsprechendes Computer-Programmprodukt, welches direkt in einen Speicher einer solchen programmierbaren Recheneinheit einer Zähler-Schaltungsanordnung ladbar ist, mit Programm-Codemitteln, um alle Schritte des genannten Verfahrens auszuführen, wenn das Programm auf dieser Recheneinheit ausgeführt wird. Grundsätzlich ist es aber auch möglich, eine solche Recheneinheit hardwaremäßig, beispielsweise innerhalb eines IC oder anderen Moduls, oder durch mehrere miteinander verschaltete, zusammenwirkende ICs oder sonstige Module zu realisieren. Dies ist letztlich eine Frage der konkreten Verwendung des Zählers, d. h. der technischen Umgebung, in welcher der Zähler genutzt werden soll, sowie des Aufwands und der Kosten.As already mentioned, a programmable logic module or processor is preferably used as the arithmetic unit, so that the individual modules can be realized in the form of software modules, which are then programmed into the respective module. Therefore, the invention also includes a corresponding computer program product, which is directly loadable into a memory of such a programmable arithmetic unit of counter circuitry, with program code means for carrying out all steps of said method when the program is executed on said arithmetic unit. In principle, however, it is also possible to implement such a computing unit in terms of hardware, for example within an IC or other module, or through a plurality of interconnected, cooperating ICs or other modules. This is ultimately a question of the concrete use of the meter, ie the technical environment in which the meter is to be used, as well as the effort and the cost th.

Die abhängigen Ansprüche enthalten jeweils besonders vorteilhafte Ausgestaltungen und Weiterbildungen der Erfindung, wobei insbesondere auch die erfindungsgemäße Zähler-Schaltungsanordnung entsprechend den abhängigen Verfahrensansprüchen weitergebildet sein kann.The dependent claims each contain particularly advantageous embodiments and developments of the invention, wherein in particular also the counter circuit arrangement according to the invention the dependent method claims can be trained.

Vorzugsweise wird die Ziffern-Kodierungsregel so gewählt, dass die Ziffern des gray-kodierten Zählerstands in den drit ten Datenworten in einem erweiterten ausgeglichenen Gray-Code kodiert sind. Dadurch kann eine besonders gute Verteilung der Bit-Änderungen innerhalb der einzelnen Ziffern gewährleistet werden.Preferably the digit encoding rule is chosen so that the digits of the gray-coded meter reading in the third data words in an extended balanced Gray code are encoded. This can be a particularly good distribution of bit changes within the individual digits.

Besonders bevorzugt ist der Ordinalzahl-Zählerstand und damit auch der gray-kodierte Zählerstand jeweils durch eine Ordinalzahl-Ziffer zu einer Basis n definiert, die eine Potenz von 2 ist, d. h. die Ziffern sind jeweils zu einer Basis 2m = n definiert. Beispielsweise kann n = 16 gewählt werden, so dass die Ziffern in Form von Hexadezimalzahlen definiert sind. Wie in einem Artikel von G. Bhat und C. D. Savage „Balance Gray-Codes" in der Zeitschrift „The Electronic Journal of Combinatorics", Vol. 3, Nr. 1, 1996, beschrieben wird, ist es möglich, einen 2n-Bit-Code zu konstruieren, in dem die Anzahl der Bit-Änderungen total ausgeglichen ist. Zwar gibt es für solche total ausgeglichene Gray-Codes in der Regel keine einfachen Abbildungsvorschriften zwischen den Ordinalzahlen und dem korrespondierenden ausgeglichenen Gray-Code. Daher ist es beispielsweise auch nicht auf einfache Weise möglich, den Zählerstand direkt in einen derartigen total ausgeglichenen Gray-Code zu konvertieren, da ansonsten jede Konvertierungsrichtung mit Hilfe sehr großer Tabellen konvertiert werden muss und schon bei einem einfachen üblichen 32-Bit-Zähler diese Tabellen den Rahmen der meisten technischen Systeme sprengen würde. Da jedoch hier lediglich die einzelnen Ziffern des bereits gray-kodierten Zählerstands in dem erweiterten ausgeglichenen Gray-Code kodiert sind (und beispielsweise übliche Hexadezimalziffern in einem einfachen 4-Bit-Datenwort jeweils kodiert sein können) reicht eine sehr einfache, kleine Tabelle zur Konvertierung der Ziffern zur Basis n = 2m in einem total ausgeglichenen Gray-Code aus. Daher wird vorzugsweise die Ziffern-Kodierungsregeln und somit auch die inverse Ziffern-Kodierungsregeln in einer Tabelle, beispielsweise einer üblichen Look-Up-Table, in einem Speicher der Rechnereinrichtung bzw. einem Speicher, auf den die Rechnereinheit Zugriff hat, hinterlegt.Particularly preferably, the ordinal number counter reading and thus also the gray-coded counter reading are respectively defined by an ordinal number to a base n, which is a power of 2, ie the digits are respectively defined to a base 2 m = n. For example, n = 16 can be chosen so that the digits are defined in the form of hexadecimal numbers. As described in an article by G. Bhat and CD Savage "Balance Gray Codes" in The Electronic Journal of Combinatorics, Vol. 3, No. 1, 1996, it is possible to use a 2 n- bit Code in which the number of bit changes is totally balanced. Although there are generally no simple mapping rules between the ordinal numbers and the corresponding balanced Gray code for such totally balanced Gray codes. Therefore, for example, it is not easy to convert the count directly into such a totally balanced Gray code, since otherwise every conversion direction using very large tables must be converted and even in a simple conventional 32-bit counter these tables would go beyond the scope of most technical systems. However, since only the individual digits of the already gray-coded counter reading are coded here in the extended balanced Gray code (and, for example, customary hexadecimal digits in a simple 4-bit data word can be coded in each case), a very simple, small table is sufficient for converting the Digits to base n = 2 m in a totally balanced Gray code. Therefore, preferably the number coding rules and thus also the inverse number coding rules are stored in a table, for example a usual look-up table, in a memory of the computer device or a memory to which the computer unit has access.

Grundsätzlich ist es aber auch möglich, den Zählerstand bzw. den gray-kodierten Zählerstand durch Ziffern zu einer Basis zu definieren, die nicht eine Potenz von 2 ist, beispielsweise als Dezimalzahlen. Dann ist der erweiterte Gray-Code, in dem die einzelnen Ziffern kodiert werden, zwar nicht vollständig ausgeglichen, jedoch ist die Verteilung der Bit-Änderungen auf die einzelnen Bit-Stellen im Datenwort schon erheblich besser als bei den bisher bekannten Zählern, so dass letztlich eine Lebensdauererhöhung des Zählers gegenüber herkömmlichen Zählern erreicht werden kann.Basically but it is also possible the counter reading or the gray-coded counter reading Digits to define a base that is not a power of 2 is, for example, as decimal numbers. Then the advanced one Gray code in which the individual digits are encoded, not Completely balanced, however, is the distribution of bit changes to the individual bit positions in the data already significantly better as with the previously known counters, so that ultimately a lifespan increase of the counter over conventional meters can be achieved.

Wie oben erwähnt, handelt es sich bei einem erweiterten Gray-Code um einen Code, bei dem die Ziffer-Kodierungsregel für eine Anzahl von aufeinanderfolgenden Zyklen, welche eine zu kodierende Ziffer durchläuft, jeweils unterschiedliche Zyklus-Kodierungsregeln umfasst, die nacheinander zyklisch oder reflektiert zyklisch angewendet werden. Dabei wird vorzugsweise dafür gesorgt, dass die Anzahl der Zyklus-Kodierungsregeln der Anzahl oder einem Vielfachen der Anzahl der Bits eines einzelnen der dritten Datenworte, d. h. der zur binären Speicherung des dritten Datenworts notwendigen Bits, entspricht. Um den erweiterten Gray-Code möglichst unkompliziert zu halten, ist es dabei bevorzugt, dass die Anzahl der Zyklus-Kodierungsregeln genau der Anzahl der Bits entspricht, d. h. es wird beispielsweise bei einer binären 4-Bit-Kodierung einer Hexadezimalziffer ein erweiterter Gray-Code mit genau vier verschiedenen Zyklus-Kodierungsregeln verwendet. Welche der Zyklus-Kodierungsregeln angewandt wird, hängt davon ab, in welchem Zählzyklus sich der Zähler bezüglich dieser Ziffer gerade befindet und in welcher Richtung der Zyklus gerade durchlaufen wird. Ein konkretes Beispiel hierzu wird noch in der Figurenbeschreibung erläutert.As mentioned above, an extended Gray code is a code that uses the digit encoding rule for one Number of consecutive cycles, one to be coded Number goes through, each comprises different cycle coding rules, one after the other cyclically or reflected cyclically. It is preferred ensured, that the number of cycle encoding rules is the number or one Multiples of the number of bits of a single one of the third data words, d. H. the to the binary Storage of the third data word necessary bits, corresponds. To the extended Gray code as possible To keep it straightforward, it is preferred that the number the cycle encoding rules correspond exactly to the number of bits, d. H. For example, in a 4-bit binary encoding, it becomes a hexadecimal digit an extended Gray code with exactly four different cycle encoding rules used. Which of the cycle encoding rules is used depends on in which counting cycle the counter regarding this Numeral is straight and in which direction the cycle is straight is going through. A concrete example for this is still in the Description of the figures explained.

Grundsätzlich können nahezu beliebig lange Datenworte genutzt werden. Da sich aber, wie bereits beschrieben, eine Repräsentation der einzelnen Ziffern des Zählerstands durch Ordinal zahlen zur Basis 16, d. h. in Form von Hexadezimalziffern besonders gut eignet, ist die Länge der ersten Datenworte, die Länge der zweiten Datenworte und die Länge der dritten Datenworte jeweils 4 Bit. Durch ein 4-Bit-Datenwort lässt sich eine Hexadezimalziffer optimal darstellen.Basically, almost Any length of data words are used. But, as already described, a representation the individual digits of the meter reading by ordinal pay to base 16, d. H. in the form of hexadecimal digits especially good, is the length the first data words, the length the second data words and the length the third data words each 4 bits. Through a 4-bit data word let yourself optimally represent a hexadecimal digit.

Um mit solchen 4-Bit-Datenworten einen Zählerstand eines üblichen 32-Bit-Zählers, wie er heutzutage in den meisten Fällen eingesetzt wird, zu kodieren, sind jeweils acht Datenworte in einer Gruppe, d. h. acht erste Datenworte, acht zweite Datenworte und acht dritte Datenworte erforderlich.Around with such 4-bit data words a count of a usual 32-bit counter, as it is used in most cases today to encode are each eight data words in a group, d. H. eight first data words, eight second data words and eight third data words required.

Da die meisten Speicher so aufgebaut sind, dass sie jeweils byte-weise beschrieben werden können, beträgt die Länge der Speicherworte vorzugsweise jeweils 1 Byte (d. h. 8 Bit), so dass zur Kodierung eines 32-Bit-Zählers vier Speicherworte erforderlich sind.There Most of the memories are constructed in such a way that they are each byte-wise can be described is the length the memory words are preferably each 1 byte (i.e., 8 bits), so that four memory words are required to encode a 32-bit counter are.

Grundsätzlich kann die Erfindung aber auch an Zählern mit anderen Speicherlängen bzw. Datenwortlängen und Speicherwortlängen eingesetzt werden. Beispielsweise könnte ein 20 Bit langer Zählerstand in vier Speicherworten mit je 5 Bit hinterlegt sein. Diese könnten dann zur Verarbeitung und Inkrementierung nach dem erfindungsgemäßen Verfahren in jeweils Gruppen von fünf ersten, zweiten und dritten Datenworten von jeweils 4 Bit Länge umgewandelt werden.Basically the invention but also on counters with other memory lengths or data word lengths and memory word lengths be used. For example, could be a 20-bit counter count be stored in four memory words with 5 bits each. These could then for processing and incrementing according to the inventive method in each groups of five converted first, second and third data words of 4 bits in length become.

Grundsätzlich kann auch die Zähler-Kodierungsregel in Form einer Look-Up-Table definiert sein, anhand derer der gesamte Zählerstand in einen gray-kodierten Zählerstand umgesetzt werden kann. Es kann dann ein beliebiger Gray-Code eingesetzt werden.Basically also the counter encoding rule be defined in the form of a look-up table, on the basis of which the entire meter reading in a gray-coded counter reading can be implemented. It can then be used any Gray code.

Bei einem bevorzugten Ausführungsbeispiel ist die Zähler-Kodierungsregel so gewählt, dass der durch eine Ordinalzahl zur Basis n definierte Zählerstand in einen zyklisch reflektierten Gray-Code kodiert wird. Die Anwendung eines solchen zyklisch reflektierten Gray-Codes kann den Vorteil haben, dass er einfacher berechenbar ist als andere Gray-Codes. Bei einem einfach berechenbaren, zyklisch reflektierten Gray-Code besteht beispielsweise die bevorzugte Möglichkeit, dass die Zähler-Kodierungsregel und die inverse Zähler-Kodierungsregel jeweils durch einen Berechnungsalgorithmus vorgegeben sind und zur Konvertierung der Gruppe von ersten Datenworten in die Gruppe von zweiten Datenworten und umgekehrt jeweils eine Berechnung mit Hilfe des entsprechenden Berechnungsalgorithmus durchgeführt wird. Das heißt, es ist dann nicht erforderlich, zur Konvertierung auf eine relativ große Look-Up-Table zuzugreifen, welches mehr Zeit erfordern würde als die Berechnung mit einer einfachen numerischen Kodierungsregel bzw. inversen Kodierungsregel. Es könnten dann auch sehr lange Zähler in einfachen technischen Systemen implementiert werden.at a preferred embodiment the counter encoding rule like this selected that the count defined by an ordinal number to the base n is encoded in a cyclically-reflected Gray code. The application Such a cyclically-reflected Gray code may have the advantage have it easier to calculate than other Gray codes. at an easily calculable, cyclically-reflected Gray code for example, the preferred way that the counter coding rule and the inverse counter encoding rule are each predetermined by a calculation algorithm and for Conversion of the group of first data words into the group of second data words and vice versa each calculation using help the corresponding calculation algorithm is performed. This means, It is then not necessary to convert to a relative size Look-Up-Table, which would take more time than that Calculation with a simple numerical coding rule or inverse coding rule. It could then very long counters be implemented in simple technical systems.

Die Erfindung wird im Folgenden unter Hinweis auf die beigefügten Figuren anhand von Ausführungsbeispielen noch einmal näher erläutert. Es zeigen:The The invention will be described below with reference to the attached figures based on embodiments once again closer explained. Show it:

1 eine schematische Darstellung eines möglichen Verfahrensablaufs zur Kodierung eines Zählerstands in den im nicht-flüchtigen Speicher zu hinterlegenden Speicherworten gemäß einem Ausführungsbeispiel des erfindungsgemäßen Verfahrens, 1 3 a schematic representation of a possible method sequence for coding a meter reading into the memory words to be stored in the non-volatile memory according to an exemplary embodiment of the method according to the invention,

2 ein einfaches Ausführungsbeispiel für einen reflektierten zyklischen Gray-Code einer dreistelligen Zahl zur Basis B = (2, 3, 4), 2 a simple embodiment for a reflected cyclic Gray code of a three-digit number to the base B = (2, 3, 4),

3 ein Ausführungsbeispiel für einen erweiterten ausgeglichenen Gray-Code für eine Ordinalzahl zur Basis n = 16, 3 an embodiment for an extended Gray balanced code for an ordinal number based on n = 16,

4 eine Blockdarstellung wesentlicher Komponenten und ihres Zusammenwirkens eines Ausführungsbeispiels einer erfindungsgemäßen Zähler-Schaltungsanordnung, 4 a block diagram of essential components and their interaction of an embodiment of a counter circuit arrangement according to the invention,

5a und 5b ein konkretes Ausführungsbeispiel eines möglichen erfindungsgemäßen Verfahrensablaufs bei der Inkrementierung eines 32-Bit-Zählers, 5a and 5b a concrete embodiment of a possible method sequence according to the invention when incrementing a 32-bit counter,

5c eine Darstellung der Schritte Z(4) bis Z(7) des Verfahrensablaufs gemäß 5b bei einer weiteren Inkrementierung des Zählerstands. 5c a representation of the steps Z (4) to Z (7) of the procedure according to 5b at a further increment of the meter reading.

Bei dem in 1 dargestellten Ausführungsbeispiel eines möglichen erfindungsgemäßen Verfahrens handelt es sich um die Kodierung eines 20-Bit-Zählerstands, welcher in vier Speicherworten SW im nichtflüchtigen Speicherbaustein hinterlegt wird, die jeweils eine Länge von 5 Bit aufweisen. Dementsprechend wird der Zähler als Ordinalzahl bzw. in kodierter Form durch fünf Ziffern beschrieben, welche jeweils in Form von einzelnen Datenworten DW1, DW2, DW3 mit 4 Bit Länge im Arbeitsspeicher hinterlegt sind. Dabei gibt es eine Gruppe von fünf ersten Datenworten DW1, welche die Ziffern des gesamten Zählers als Ordinalzahl repräsentieren, eine Gruppe von fünf zweiten Datenworten DW2, welche jeweils die Ziffern der reflektiert gray-codierten Zählerstände als Ordinalzahlen repräsentieren, und eine Gruppe von fünf dritten Datenworten DW3, in denen die einzelnen Ziffern noch einmal in einem erweiterten Gray-Code kodiert sind.At the in 1 illustrated embodiment of a possible method according to the invention is the coding of a 20-bit counter reading, which is stored in four memory words SW in the non-volatile memory module, each having a length of 5 bits. Accordingly, the counter is described as an ordinal number or in coded form by five digits, which are each stored in the form of individual data words DW 1 , DW 2 , DW 3 with 4-bit length in the working memory. There is a group of five first data words DW 1 , which represent the digits of the total counter as ordinal, a group of five second data words DW 2 , which respectively represent the digits of the reflected gray coded counts as ordinal numbers, and a group of five third data words DW 3 , in which the individual numbers are encoded again in an extended Gray code.

Zur Inkrementierung bzw. Dekrementierung werden die in 1 gezeigten Permutations- bzw. Kodierungsschritte jeweils von oben nach unten durchlaufen.For incrementing or decrementing, the in 1 in each case from top to bottom through the permutation or coding steps shown.

D. h. es wird zunächst der kodierte Zählerstand, welcher in den Speicherworten SW hinterlegt ist, eingelesen und es werden die einzelnen Bits dieses Zählerstands auf die dritten Datenworte DW3 gemäß einer bestimmten Permutationsregel verteilt. Diese einzelnen dritten Datenworte DW3 enthalten dann jeweils die einzelnen Ziffern des gray-kodierten Zählerstands in einem erweiterten Gray-Code. Danach erfolgt eine inverse Ziffern-Kodierung, so dass die einzelnen Ziffern wieder in ihre Ordinalzahlen zurückkonvertiert werden, die in Form der einzelnen zweiten Datenworte DW2 im Arbeitsspeicher hinterlegt sind. Die in den einzelnen zweiten Datenworten abgelegten Ziffern sind dann folglich die Ziffern des gray-kodierten Zählerstands. In einem weiteren Schritt erfolgt dann die Rückkodierung des kompletten Zählertands an sich, um diesen dann in Form von ersten Datenworten DW1 im Arbeitsspeicher zu hinterlegen. Dieser Zählerstand als Ordinalzahl wird dann inkrementiert bzw. dekrementiert. Anschließend erfolgt wieder eine Zählerkodierung zur Erzeugung der geänderten zweiten Datenworte DW2, eine Kodierung der einzelnen Ziffern zur Erzeugung der geänderten dritten Datenworte DW3 und schließlich die Permutation der Bits zur Verteilung der einzelnen Bits der dritten Datenworte DW3 auf die Speicherworte SW. Diese neuen Speicherworte werden dann mit dem ursprünglich hinterlegten Zählerstand verglichen, und es werden die Speicherworte überschrieben, die sich geändert haben.Ie. First, the encoded counter reading, which is stored in the memory words SW, is read in, and the individual bits of this counter reading are distributed to the third data words DW 3 in accordance with a specific permutation rule. These individual third data words DW 3 then each contain the individual digits of the gray-coded counter reading in an extended Gray code. This is followed by an inverse number coding, so that the individual digits are converted back into their ordinals, which are stored in the form of the individual second data words DW 2 in the main memory. The digits stored in the individual second data words are then the digits of the gray-coded meter reading. In a further step, the entire counter value is then recoded, in order to deposit it in the form of first data words DW 1 in the main memory. This counter reading becomes ordinal then incremented or decremented. Subsequently, a counter coding for generating the changed second data words DW 2 , a coding of the individual digits for generating the modified third data words DW 3 and finally the permutation of the bits for distribution of the individual bits of the third data words DW 3 to the memory words SW. These new memory words are then compared with the originally stored counter reading, and the memory words which have changed are overwritten.

Durch die erfindungsgemäße Kodierung ist dabei dafür gesorgt, dass sich bei jedem Inkrementionsschritt bzw. Dekrementionsschritt genau nur eines der Speicherworte ändert und dass bei einem Hochzählen des Zählers oder Runterzählen des Zählers die Änderungen auf alle Speicherworte gleich verteilt sind.By the coding according to the invention is there for it ensured that at each incrementation step or decrementing step exactly only one of the memory words changes and that when counting up the counter or counting down of the meter The changes are distributed equally to all memory words.

Eine besonders bevorzugte Vorgehensweise und Kodierung wird im Folgenden erläutert, wobei hierzu der Weg von der Kodierung des Zählerstands als ursprüngliche Ordinalzahl in den letztlich in den Speicherworten kodierten Zählerstand beschrieben wird:
Wird ein Zähler fortlaufend inkrementiert, so führt dies zu einer Folge, bei der dasjenige Byte, welches die niederwertigste Ziffer enthält, sich am häufigsten ändert, das Byte mit der nächst höheren Ziffer am zweithäufigsten und das Byte mit der höchstwertigen Ziffer am seltensten. Im Allgemeinen nimmt dabei die Anzahl der Änderungen pro Ziffer logarith misch zur Basis der Zifferndarstellung ab. Weiterhin kommt es zwangsläufig dazu, dass sich gelegentlich mehr als eine Ziffer auf einmal ändern kann. Beispielsweise ändern sich beim Sprung von der Zahl 19999 auf die Zahl 20000 sämtliche Ziffern. Somit würden sich auch sämtliche Bytes des Zählerstands ändern.
A particularly preferred procedure and coding will be explained in the following, in which case the way from the coding of the counter reading as the original ordinal number in the counter reading ultimately coded in the memory words will be described:
If a counter is incremented continuously, this results in a sequence in which the byte containing the least significant digit changes most frequently, the byte with the next highest digit the second most, and the byte with the most significant digit the least. In general, the number of changes per digit decreases logarithmically from the base of the numerical representation. Furthermore, it inevitably happens that sometimes more than one digit can change at once. For example, during the jump from the number 19999 to the number 20000 all digits change. Thus, all bytes of the meter would change.

Dieser letztere Effekt kann dadurch vermieden werden, dass der Zählerstand in Form eines Gray-Codes abgespeichert wird. In einem Gray-Code ist sichergestellt, dass sich aufeinanderfolgende Zählerstände jeweils nur um ein Zeichen unterscheiden. Bei dem in 1 dargestellten Ausführungsbeispiel wird ein reflektierter zyklischer Gray-Code angewendet. Ein möglicher reflektierter zyklischer Gray-Code ist in 2 dargestellt. Dabei ist für jede Ziffer eine eigene Basis angegeben. Das heißt, die Basis kann hier als ein Vektor B = (bn-1, bn-2, bj, ..., b0) mit der Basis b jeder einzelnen Ziffer angegeben werden. In 2 ist diese Basis B = (2, 3, 4), d. h. die Ziffern der letzten Spalte der Ordinalzahl und des Gray-Codes laufen jeweils von 0 bis 3, die Ziffern der mittleren Spalte von 0 bis 2 und die der ersten Spalte von 0 bis 1. Der auf der rechten Seite dargestellte Gray-Code ist ein sog. reflektierter Gray-Code, weil er durch eine Spiegelung von Zahlenfolgen entsteht, so dass die Ziffern in den einzelnen Spalten jeweils hoch- und wieder runtergezählt werden. So durchlaufen beispielsweise in der letzten Spalte die Ziffern die Folge 0, 1, 2, 3, 3, 2, 1, 0, 0, 1, 2, 3, 3 ... usw. Der Gray-Code heißt zudem „zyklisch", weil nach der letzten Zahl wieder mit der ersten Zahl des Gray-Codes weitergezählt werden kann und sich trotzdem nur ein einzelnes Bit ändert. Ein solcher zyklischer Gray-Code kann immer dann erzeugt werden, wenn die Basis bn-1 der höchstwertigen Ziffer gradzahlig ist.This latter effect can be avoided by storing the count in the form of a Gray code. A Gray code ensures that consecutive counter readings are only one character each. At the in 1 illustrated embodiment, a reflected cyclic Gray code is applied. One possible reflected cyclic Gray code is in 2 shown. Each number is given its own base. That is, the base may B = b each point are given (0 b n-1, b n-2, b j, ..., b) to the base here as a vector. In 2 is this base B = (2, 3, 4), ie the digits of the last column of the ordinal number and the Gray code run from 0 to 3, the digits of the middle column from 0 to 2 and those of the first column from 0 to 1. The Gray code shown on the right is a so-called reflected Gray code, because it is created by mirroring sequences of numbers so that the numbers in each column are counted up and down. For example, in the last column, the numbers go through the sequence 0, 1, 2, 3, 3, 2, 1, 0, 0, 1, 2, 3, 3 ... etc. The Gray code is also called "cyclic". because after the last number can be counted again with the first number of the Gray code and nevertheless only a single bit changes, such a cyclic Gray code can be generated whenever the base b n-1 of the highest-order digit is even-numbered is.

Ein zyklischer reflektierter Gray-Code zu einer beliebigen gegebenen Basis B kann definiert werden, indem eine Konstruktionsvorschrift angegeben wird, die aus einer gegebenen Ordinalzahl der Basis B die Darstellung als Gray-Code der Basis B eindeutig erzeugt und indem entsprechend eine inverse Konstruktionsvorschrift angegeben wird, die aus einem gegebenen Gray-Code die korrespondierende Ordinalzahl eindeutig erzeugt.One cyclic Gray reflected code to any given Base B can be defined by a design rule given from a given ordinal number of the base B the representation as Gray code of the base B is clearly generated and by accordingly indicating an inverse design specification becomes, from a given Gray code, the corresponding ordinal number clearly generated.

Als Zähler-Kodierungsregel zur Konvertierung einer Zahl Z in einen korrespondierenden Gray-Code G kann vorzugsweise folgende Konstruktionsvorschrift verwendet werden: Für alle Ziffern gi mit i = 0, 1, 2, ..., n – 2 gilt, falls die Zahl zi+1 + zi+2 + ... + zm gerade ist: gi = zi sonst: gi = (bi – 1) – zi (1)und für i = n – 1 gilt: gn-1 = zn-1 As a counter coding rule for converting a number Z into a corresponding Gray code G, the following design rule can preferably be used: For all numbers g i with i = 0, 1, 2, ..., n - 2, if the number z i + 1 + z i + 2 + ... + z m straight is: g i = z i otherwise: g i = (b i - 1) - z i (1) and for i = n-1, g n-1 = z n-1

Dabei ist m definiert als die Position der ersten Ziffer von Z mit geradzahliger Basis, falls Z aus Ziffern unterschiedlicher Basis besteht, und m:= n – 1, falls Z vollständig aus Ziffern ungeradzahliger Basis besteht.there m is defined as the position of the first digit of Z with even number Basis, if Z consists of numbers of different bases, and m: = n - 1, if Z is complete consists of digits of odd base.

Umgekehrt kann als inverse Zähler-Kodierungsregel folgende Konstruktionsvorschrift angegeben werden, die die Zahl im Gray-Code G wieder in die korrespondierende Ordinalzahl Z zurückkonvertiert: Für alle Ziffern zi mit i = 0, 1, 2, ..., n – 2 gilt, falls die Zahl gi+1 + gi+2 + ... + gn-1 gerade ist: zi = gi sonst: zi = (bi – 1) – gi (2)und für i = n – 1 gilt: zn-1 = gn-1 Conversely, as an inverse counter coding rule, the following design rule can be given, which converts the number in gray code G back into the corresponding ordinal number Z: For all numbers z i with i = 0, 1, 2, ..., n - 2, if the number g i + 1 + g i + 2 + ... + g n-1 straight is: z i = g i otherwise: z i = (b i - 1) - g i (2) and for i = n-1: z n-1 = g n-1

Die Konstruktionsvorschrift (1) gilt für Ziffern beliebiger Basis bzw. Zahlen mit beliebigem Basisvektor. Auch der in 2 als Beispiel angegebene Gray-Code zur Basis B = (2, 3, 4) wurde mit dieser Konstruktionsregel erzeugt. In der Praxis werden in den meisten technische Anwendungen Ordinalzahlen eingesetzt, deren Ziffern ausschließlich zu einer geradzahli gen Basis definiert sind. In diesem Fall reduziert sich die Konstruktionsregel (1) auf die vereinfachte Form. Für alle Ziffern gi mit i = 0, 1, 2, ..., n – 2 gilt, falls die Zahl zi+1 gerade ist: gi = zi sonst: gi = (bi – 1) – zi (1a)und für i = n – 1 gilt: gn-1 = zn-1 The design rule (1) applies to digits of any basis or numbers with any basis vector. Also the in 2 Gray code given as example for base B = (2, 3, 4) was generated using this design rule. In practice, ordinal numbers are used in most technical applications whose numbers are defined exclusively on an even-numbered basis. In this case, the design rule (1) reduces to the simplified form. For all numbers g i with i = 0, 1, 2, ..., n - 2, if the number z i + 1 straight is: g i = z i otherwise: g i = (b i - 1) - z i (1a) and for i = n-1, g n-1 = z n-1

Werden nur Zahlen eingesetzt, deren Ziffern zu einer ungeradzahligen Basis definiert sind, gilt folgende Konstruktionsregel: Für alle Ziffern gi mit i = 0, 1, 2, ..., n – 2 gilt, falls die Zahl zi+1 + zi+2 + ... + zn-1 gerade ist: gi = zi sonst: gi = (bi – 1) – zi (1b)und für i = n – 1 gilt: gn-1 = zn-1 If only numbers are used whose numbers are defined on an odd-numbered basis, the following design rule applies: For all numbers g i with i = 0, 1, 2, ..., n - 2, if the number z i + 1 + z i + 2 + ... + z n-1 straight is: g i = z i otherwise: g i = (b i - 1) - z i (1b) and for i = n-1, g n-1 = z n-1

Bei einem besonders bevorzugten Ausführungsbeispiel kann zur Realisierung eines 32-Bit-Zählers der Zählerstand in einer achtstelligen hexadezimalen Ordinalzahl repräsentiert werden, d. h. die einzelnen Ziffern sind jeweils Hexadezimalzahlen, die jeweils in einem 4 Bit langen Datenwort kodiert werden können.at a particularly preferred embodiment For example, to realize a 32-bit counter, the count may be in an eight-digit hexadecimal Ordinal number represents be, d. H. the individual numbers are each hexadecimal numbers, each of which can be coded in a 4-bit long data word.

Ein solcher 32-Bit-Zähler wird also mit vier Speicherworten à 8 Bit und jeweils acht 4 Bit langen ersten Datenworten DW1, zweiten Datenworten DW2 und dritten Datenworten DW3 realisiert.Such a 32-bit counter is thus realized with four 8-bit memory words each having eight 4-bit first data words DW 1 , second data words DW 2 and third data words DW 3 .

Durch diese Zählerkodierung der hexadezimalen Ordinalzahl des Zählerstands in den hexadezimalen reflektierten zyklischen Gray-Code bei der Umwandlung der Gruppe der ersten Datenworte DW1 in die Gruppe der zweiten Datenworte DW2 wird bereits sichergestellt, dass sich zwei aufeinander folgende Zählerstände nur um eine Ziffer unterscheiden. Jedoch ändert sich dabei nach wie vor die niederwertigste Ziffer am häufigsten und die Anzahl der Änderungen der anderen Ziffern nimmt logarithmisch zur Basis ab.By this counter coding of the hexadecimal ordinal number of the counter reading in the hexadecimal gray cyclic gray code during conversion of the group of first data words DW 1 into the group of second data words DW 2 , it is already ensured that two consecutive counter readings differ by only one digit. However, the least significant digit still changes most frequently and the number of changes in the other digits decreases logarithmically to the base.

Grundsätzlich wäre es nun möglich, die Ziffern innerhalb des Permutationsschritts so auf die verschiedenen Speicherworte zu verteilen, dass sich die Änderungen der niederwertigsten Ziffer auf die einzelnen Speicherworte aufteilen. Da jedoch die Ziffern selbst als Binärzahl gespeichert sind, werden oftmals mehrere Bits der Zifferndarstellung beim Inkrementieren geändert. Aus diesem Grund werden hier erfindungsgemäß auch die Ziffern des bereits gray-kodierten Zählerstands noch einmal mit einem Gray-Code kodiert. Dies erfolgt bei der Umwandlung mit Hilfe der Ziffer-Kodierungsregel der einzelnen zweiten Datenworte DW2 in die jeweils zugehörigen dritten Datenworte DW3. Hierzu wird ein erweiterter ausgeglichener Gray-Code verwendet, der in einer Look-Up-Table hinterlegt ist. Ein ausgeglichener Gray-Code ist dadurch definiert, dass die Anzahl der Bit-Änderungen beim Durchlaufen eines vollständigen Zyklus aus mehreren Sequenzen, beispielsweise bei einer Hexadezimalzahl von 0...15 und 15...0, gleich ist. Da im vorliegenden Ausführungsbeispiel einzelne hexadezimale Ziffern des Zählerstands ja bereits in einem zyklisch reflektierten Gray-Code kodiert sind, werden sie immer von 0 bis 15 und wieder zurück zur 0 gezählt.In principle, it would now be possible to distribute the digits within the permutation step to the different memory words in such a way that the changes of the least significant digit are distributed among the individual memory words. However, since the digits themselves are stored as a binary number, many bits of the digit representation are often changed on incrementing. For this reason, according to the invention, the digits of the already gray-coded meter reading are coded once again with a Gray code. This takes place during the conversion with the aid of the digit coding rule of the individual second data words DW 2 into the respectively associated third data words DW 3 . For this purpose, an extended balanced Gray code is used, which is stored in a look-up table. A balanced Gray code is defined as equaling the number of bit changes when passing through a complete cycle of multiple sequences, for example, at a hexadecimal number of 0 ... 15 and 15 ... 0. Since in the present embodiment individual hexadecimal digits of the count are already coded in a cyclically reflected Gray code, they are always counted from 0 to 15 and back to 0 again.

Ein für die praktische Realisierung der Erfindung verwendeter, erweiterter ausgeglichener Gray-Code ist in 2 dargestellt. Die ganz linke Spalte enthält die Ordinalzahl zur Basis 10. In der daneben stehenden zweiten Spalte ist die Ordinalzahl zur Basis 16, d. h. in der üblichen Definition als Hexadezimalzahl von 0 bis e, angegeben. Rechts daneben ist der erweiterte ausgeglichene Gray-Code zur Basis 2, d. h. als binärer Code mit jeweils 4 Bit Länge in vier Spalten dargestellt, welche jeweils vier verschiedenen Zyklus-Kodierungsregeln entsprechen. Bei einem Rauf- und Runterzählen der Ordinalzahl wird dieser Gray-Code jeweils entlang der angezeig ten Pfeilrichtungen spaltenweise mäanderförmig von der ersten Spalte in der obersten Zeile bis zur letzten Spalte in der obersten Zeile durchlaufen. Anschließend wird in diesem erweiterten Gray-Code entlang der Pfeilrichtung mäanderförmig wieder rückwärts gezählt.An expanded Gray balanced code used in the practice of the invention is disclosed in U.S. Patent Nos. 4,135,774; 2 shown. The leftmost column contains the ordinal number to the base 10. In the adjacent second column, the ordinal number to the base 16, ie in the usual definition as a hexadecimal number from 0 to e, indicated. To the right of this is the expanded, balanced Gray code for base 2, that is, a 4-bit binary code in four columns, each corresponding to four different cycle encoding rules. In an up and down counting the ordinal number of this gray code is in each case along the displayed th arrow directions column-wise meandering from the first column in the top row to the last column in the top row. Subsequently, in this extended Gray code, backwards in a meandering manner along the direction of the arrow.

Die Verwendung solcher unterschiedlicher Zyklus-Kodierungsregeln für vier aufeinanderfolgende Zyklen sorgt dafür, dass sich bei einem viermaligen Durchlaufen des Gesamtzyklus (viermal von 0 bis 15 und jeweils wieder zurück) sämtliche Bits gleich oft ändern. Für eine einzelne Spalte des Gray-Codes, d. h. für eine einzige Zyklus-Kodierungsregel, ist dies nicht der Fall. Dies lässt sich leicht an der ersten (linken) Gray-Code-Spalte ersehen. Beim Durchlaufen dieses Gray-Codes von 0 bis 15 ändert sich das linke niederwertigste Bit sowie die beiden Bits in der Mitte jeweils genau viermal, wogegen sich das höchstwertige linke Bit nur dreimal ändert. Daher werden insgesamt vier Folgen dieses Gray-Codes reflektiert untereinandergeschrieben (welches hier dem mäanderförmigen Durchlaufen der Spalten des Gray-Codes entspricht) und dabei die Spalten in den jeweiligen Zyklen derart vertauscht (permutiert), dass die Spalte mit den wenigsten Bit-Wechseln einmal an jeder Bit-Position vorkommt. Dabei werden einzelne Bit-Spalten (jeweils durch einen Unterstrich markiert) so invertiert, dass nach dem ersten Heraufzählen von 0 bis 15 und dem anschließenden Herunterzählen von 15 bis 0 die Bit-Darstellung für die 15 in beiden Folgen übereinstimmt und beim nächsten Heraufzählen von 0 bis 15 die Bit-Darstellung der 0 übereinstimmt und beim letzten Herunterzählen von 15 bis 0 wieder die Bit-Darstellung der 15.The Use of such different cycle encoding rules for four consecutive cycles Cycles ensures that in a four-time through the entire cycle (four times from 0 to 15 and back again) change all bits the same number of times. For a single Column of the Gray code, d. H. For a single cycle coding rule, this is not the case. This is easy at the first (left) Gray code column. When going through this Gray code changes from 0 to 15 the left least significant bit as well as the two bits in the Center exactly four times, whereas the most significant left bit changes only three times. Therefore a total of four episodes of this Gray code are reflected in each other (which here meandering through the Columns of the Gray code corresponds) and thereby the columns in the respective cycles are so permuted (permuted) that the column with the fewest bit changes occurring once at each bit position. there are individual bit columns (each marked by an underscore) inverted so that after the first counting from 0 to 15 and the subsequent counting down of 15 to 0 the bit representation for the 15 in both episodes matches and the next incrementing from 0 to 15 the bit representation matches 0 and the last one countdown from 15 to 0 again the bit representation of the 15.

Dadurch wird sichergestellt, dass für einen kompletten Zählzyklus 0-15-0-15-0, wie er beim Inkrementieren des gray-kodierten Zählerstands in den einzelnen Ziffern jeweils vorkommt, die Anzahl der Bit-Wechsel für jedes Bit der Bit-Positionen 1 bis 4 gleich ist.This ensures that for a complete counting cycle 0-15-0-15-0, like when incrementing the gray-coded meter reading into the each digit occurs, the number of bit changes for each bit of the bit positions 1 to 4 is the same.

Wie 3 zeigt, ist für eine solche 4 Bit lange Darstellung der Hexadezimalziffern nur eine sehr kleine Look-Up-Table erforderlich, so dass der Ziffern-Konvertierungsschritt sehr schnell, effektiv und ohne großen Rechenaufwand durchgeführt werden kann. Es muss lediglich beim Zählen des Gray-Code-Zählers festgestellt werden, in welchem Zyklus des Herauf- oder Herunterzählens einer jeden Ziffer man sich gerade befindet, und dann der in der Look-Up-Table definierte Gray-Code des jeweiligen Zyklus (d. h. die passende Zyklus-Kodierungsregel) verwendet werden. Diese Position in der Serie lässt sich für jede Ziffer aus der unmittelbar zugehörigen nächst höherwertigen Ziffer des zyklischen Gray-Codes des Zählerstands berechnen.As 3 For such a 4-bit representation of the hexadecimal digits, only a very small look-up table is required so that the digit conversion step can be carried out very quickly, effectively and without great computation. It only needs to be determined when counting the Gray code counter which cycle of counting up or down each digit is currently in, and then the gray code of the particular cycle defined in the lookup table (ie appropriate cycle coding rule). This position in the series can be calculated for each digit from the immediately adjacent next higher-order digit of the cyclic Gray code of the meter reading.

Bei dem hier dargestellten Gray-Code zur Umrechnung einer Hexadezimalziffer in einen 4 Bit langen Gray-Code gemäß 3 lässt sich diese Bestimmung durch die jeweils höherwertige Ziffer sehr einfach realisieren, indem die jeweils höherwertige Ziffer in einen binären 2 Bit langen, zyklisch reflektierten Gray-Code kodiert wird, der die Folge 0, 1, 2, 3, 3, 2, 1, 0, 0, 1 ... usw. durchläuft. Dieser so ermittelte Gray-Code der höherwertigen Ziffer gibt dann automatisch an, welche Zyklus-Kodierungsregel, d. h. welche der in 3 nebeneinander angeordneten Spalten für die Konvertierung der niederwertigeren Ziffer verwendet werden muss. Hierbei ist durch die Kodierung der höherwertigen Ziffer im binären, zyklisch reflektierten 2-Bit-Gray-Code sichergestellt, dass auch die Richtung berücksichtigt wird, die gerade entlang der in 3 dargestellten Pfeile mäanderförmig durch die Spalten durchlaufen wird.In the case of the Gray code shown here, for converting a hexadecimal digit into a 4-bit Gray code according to 3 can this determination by the higher-order digit very easily realized by the higher-order digit is encoded into a binary 2-bit long, cyclically reflected Gray code, the sequence 0, 1, 2, 3, 3, 2, 1, 0, 0, 1 ... etc. goes through. This Gray code of the higher-order digit determined in this way then automatically indicates which cycle coding rule, ie which of the cycle codes in 3 adjacent columns must be used for the conversion of the lower order digit. In this case, the coding of the higher-order digit in the binary, cyclically reflected 2-bit Gray code ensures that the direction is also taken into account, which is just along the in 3 shown arrows meandering through the columns.

Lediglich für die höchstwertige Ziffer des Zählers lässt sich diese Position im Zyklus nicht so bestimmen, da es ja keine höherwertigere Ziffer gibt. Daher kann für die höchstwertige Ziffer immer ein zuvor festgelegter Zyklus, beispielsweise – ohne Beschränkung der Allgemeinheit – immer die erste Zyklus-Konvertierungsregel angenommen werden. Da jedoch der Gray-Code der einzelnen Ziffern bereits ausgeglichen ist, ist die Anzahl der Bit-Wechsel des höchstwertigen Bits, der höchstwertigen Ziffer des Zählers und damit auch die Änderung des zugehörigen Speicherworts bei einer Verteilung der einzelnen Bits der Ziffern auf die verschiedenen Speicherworte nur um 1 geringer als die der übrigen Bits bzw. Speicherworte. Dies ist jedoch bereits die ausgeglichenste Anzahl an Bit-Wechseln überhaupt, da z. B. bei einer Anzahl von 232 möglichen Zuständen eines 32 Bit-Zählers genau 232 – 1 Zustandswechsel auftreten können, genauso wie beim Hochzählen eines Dezimalzählers von 1 bis 10 genau neun Zustandswechsel eintreten.Only for the most significant digit of the counter, this position can not be determined in the cycle, since there is no higher-order digit. Therefore, for the most significant digit, a predetermined cycle can always be adopted, for example, without loss of generality, the first cycle conversion rule. However, since the Gray code of the individual digits is already balanced, the number of bit changes of the most significant bit, the most significant digit of the counter and thus the change of the associated memory word in a distribution of the individual bits of the digits to the various memory words only 1 less than the remaining bits or memory words. However, this is already the most balanced number of bit changes ever, since z. For example, in a number of 2 32 possible states of a 32-bit counter, exactly 2 32 - 1 state changes may occur, just as when incrementing a decimal counter from 1 to 10, exactly nine state changes occur.

Werden dann, wie in 1 dargestellt, die einzelnen Bits der erweitert gray-kodierten Ziffern des gray-kodierten Zählerstands in den dritten Datenworten DW3 so auf die Speicherworte SW verteilt, dass jedes der Speicherworte SW genau 1 Bit eines jeden der dritten Datenworte DW3 enthält, so ist insgesamt dafür gesorgt, dass die Änderungen der einzelnen Speicherworte SW beim Inkrementieren des Zählers über einen kompletten Zyklus vollständig ausgeglichen sind und so die maximale Lebensdauer erreichbar ist, soweit sie durch die Anzahl der Schreibvorgänge bestimmt wird.Will then, as in 1 as shown, the individual bits of the extended gray-coded digits of the gray-coded counter in the third data words DW 3 are distributed to the memory words SW such that each of the memory words SW contains exactly 1 bit of each of the third data words DW 3 , as a whole provided that the changes of the individual memory words SW are completely compensated for a complete cycle when the counter is incremented, and thus the maximum service life can be achieved, as far as it is determined by the number of write operations.

Anstelle eines ausgeglichenen erweiterten Gray-Codes kann aber auch ein beliebiger anderer erweiterter Gray-Code zur Darstellung der einzelnen Ziffern verwendet werden. Wird beispielsweise für die Zifferndarstellung kein erweiterter ausgeglichener, sondern z. B. ein erweiterter einfacher reflektierter Gray-Code verwendet, so ist die Anzahl der Bit-Änderungen der einzelnen Ziffern im Allgemeinen ebenfalls ausgeglichen. Nur bei Änderungen der höchstwertigen Ziffer wird die Anzahl der Bit-Änderungen unterschiedlich sein und logarithmisch zur gewählten Basis abnehmen. Bei Ziffern, die wie hier in dem bevorzugten Ausführungsbeispiel durch 4 Bit dargestellt werden, tritt dieser Fall erst bei der ersten Änderung der höchstwertigen Ziffer auf, also nach 228 Zustands wechseln. Auch nach allen 232 – 1 Zustandswechseln wird dasjenige Byte, welches das niederwertigste Bit der höchstwertigen Ziffer enthält, nur 16 Änderungen mehr erfahren haben als dasjenige Byte (Speicherwort), welches das höchstwertige Bit der höchstwertigen Ziffer enthält. Bei Zahlen dieser Größenordnung spielt das in der praktischen Realisierung keine Rolle mehr, so dass im realen Einsatz tatsächlich auch ein anderer erweiterter Gray-Code verwendet werden kann.Instead of a balanced extended Gray code, however, any other extended Gray code can also be used to represent the individual digits. For example, for the numerical representation no extended balanced, but z. For example, if an extended single-reflection Gray code is used, the number of bit changes of each digit is generally also balanced. Only when changing the most significant digit will the number of bit changes be different and decrease logarithmically to the chosen base. For digits that are represented by 4 bits as here in the preferred embodiment, this case occurs only at the first change of the most significant digit, so after 2 28 change state. Even after all 2 32 - 1 state changes, the byte containing the least significant bit of the most significant digit will only have undergone 16 more changes than the byte (memory word) containing the most significant bit of the most significant digit. In the case of numbers of this magnitude, this no longer plays a role in the practical implementation, so that actually another extended Gray code can also be used in real use.

4 zeigt schematisch eine Zähler-Schaltungsanordnung 1 („Zähler"), mit der das erfindungsgemäße Verfahren umgesetzt werden kann. Bestandteil dieses Zählers 1 ist ein nichtflüchtiger Speicher 2, hier ein EEPROM, in dem jeweils der Zählerstand in Form von Speicherworten von beispielsweise 1 Byte Länge eingeschrieben werden. Weiterer wesentlicher Bestandteil dieses Zählers 1 ist eine Recheneinheit 5, hier ein Logikbaustein in Form eines FPGA, in dem die nachfolgend erläuterten Module, beispielsweise in Form von Programmabschnitten, einprogrammiert sind. Dieser Logikbaustein 5 enthält u. a. einen Arbeitsspeicher 6, in dem der aktuell zu bearbeitende Zählerstand in Form von binären Datenworten hinterlegt sein kann und auf den sämtliche Module Zugriff haben. Erhält diese Rechnereinheit 5 einen Inkrementations- oder Dekrementationsbefehl IB, so werden zunächst die Speicherworte SW von einer Leseschnittstelle 7 ausgelesen und im Arbeitsspeicher 6 abgelegt. In einem Permutationsmodul 10a erfolgt dann die in 1 in der ersten Stufe dargestellte Permutation der Bits, d. h. eine Verteilung der Bits der Speicherworte SW auf die einzelnen dritten Datenworte DW3. Als nächstes werden von einem Ziffern-Konvertierungsmodul 11a die einzelnen Ziffern mit einer inversen Ziffern-Kodierungsregel dekodiert, um die einzelnen Ziffern des Zählerstands in den zweiten Datenworten DW2 als Ordinalzahlen im Arbeitsspeicher 6 abzulegen. Anschließend wird von einem Zähler-Konvertierungsmodul 12a mit einer inversen Zähler-Kodierungsregel der gesamte Zählerstand konvertiert und in den ersten Datenworten DW1 im Arbeitsspeicher 6 abgelegt, welche jeweils die Ziffern des Zählers in unkodierter Form als Ordinalzahlen enthalten. Von einem Inkrementierungs-/Dekrementierungsmodul 13 wird dann der Zählerstand je nach Inkrementierungs-/Dekrementierungsbefehl IB inkrementiert oder dekrementiert. Anschließend wird wiederum von dem Zähler-Konvertierungsmodul 12b der Zählerstand in den reflektierten Gray-Codes kodiert und aus den ersten Datenworten DW1 so die geänderten zweiten Datenworte DW2 erzeugt. Danach werden vom Ziffern-Konvertierungsmodul 11b die einzelnen Ziffern, d. h. die einzelnen Datenworte DW2, in den erweiterten ausgeglichenen Gray-Code kodiert und so die Datenworte DW3 erzeugt. 4 schematically shows a counter circuit arrangement 1 ("Counter") with which the method according to the invention can be implemented 1 is a non-volatile memory 2 , here an EEPROM, in each of which the count is written in the form of memory words, for example, 1 byte in length. Another essential component of this meter 1 is an arithmetic unit 5 , here a logic module in the form of an FPGA, in which the modules explained below, for example in the form of program sections, are programmed. This logic module 5 contains, inter alia, a working memory 6 , in which the current counter reading can be stored in the form of binary data words and to which all modules have access. Receives this computer unit 5 an incrementation or decrement command IB, so first are the memory words SW from a read interface 7 read out and in memory 6 stored. In a permutation module 10a then takes place in 1 in the first stage Asked permutation of the bits, ie a distribution of the bits of the memory words SW to the individual third data words DW 3rd Next will be a digit conversion module 11a the individual digits are decoded with an inverse number coding rule to the individual digits of the count in the second data words DW 2 as ordinals in the working memory 6 store. Subsequently, by a counter conversion module 12a with an inverse counter coding rule, the entire counter reading is converted and in the first data words DW 1 in the main memory 6 filed, each containing the digits of the counter in uncoded form as ordinals. From an increment / decrement module 13 Then, the count is incremented or decremented depending on the increment / decrement command IB. Subsequently, turn from the counter conversion module 12b the counter reading is coded in the reflected Gray codes and the changed second data words DW 2 are generated from the first data words DW 1 . After that are from the digit conversion module 11b the individual digits, ie the individual data words DW 2 , encoded in the extended balanced Gray code and thus generates the data words DW 3 .

Die einzelnen Bits dieser Datenworte DW3 werden dann von einem Permutationsmodul 10b wieder gleichmäßig auf die einzelnen Speicherworte SW verteilt.The individual bits of these data words DW 3 are then from a permutation module 10b again evenly distributed to the individual memory words SW.

Wie bereits weiter oben erläutert, erfolgen die Ziffernkonvertierung und die inverse Ziffernkonvertierung mit Hilfe einer Look-Up-Table LUT, z. B. wie sie in 3 dargestellt ist. Diese kann in einem nichtflüchtigen Speicher 4 hinterlegt sein, auf den das Ziffern-Konvertierungsmodul 11a, 11b Zugriff hat. Für die Zählerkonvertierung bzw. inverse Zählerkonvertierung sind dagegen jeweils ein bestimmter Berechnungsalgorithmus BA bzw. inverse Berechnungsalgorithmen BA' vorgegeben, beispielsweise die oben definierten Berechnungsalgorithmen (1) bzw. (1a) und (2). Diese können ebenfalls in einem nichtflüchtigen Speicher 3 hinterlegt sein. Bei den nichtflüchtigen Speichern 3, 4 kann es sich auch um einen gemeinsamen Speicher handeln bzw. können auch beide oder einer von beiden Speichern 3, 4 mit dem Speicher 2 zur nichtflüchtigen Speicherung des Zählerstands kombiniert sein.As already explained above, the digit conversion and the inverse digit conversion with the aid of a look-up table LUT, z. B. as in 3 is shown. This can be stored in a non-volatile memory 4 be deposited on the the digit conversion module 11a . 11b Has access. For counter conversion or inverse counter conversion, on the other hand, a specific calculation algorithm BA or inverse calculation algorithms BA 'are predefined, for example the calculation algorithms (1) or (1a) and (2) defined above. These can also be stored in non-volatile memory 3 be deposited. For non-volatile memories 3 . 4 it can also be a shared memory or can also both or one of both stores 3 . 4 with the memory 2 combined for non-volatile storage of the meter reading.

Die Permutationsmodule 10a, 10b sowie die Ziffern-Konvertierungsmodule 11a, 11b und die Zähler-Konvertierungsmodule 12a, 12b können jeweils komplett unterschiedliche Module sein, sie können aber auch jeweils gemeinsam in einem Permutationsmodul bzw. Ziffern-Konvertierungsmodul oder Zähler- Konvertierungsmodul realisiert sein, so wie dies hier angedeutet ist.The permutation modules 10a . 10b as well as the digit conversion modules 11a . 11b and the counter conversion modules 12a . 12b can each be completely different modules, but they can also be implemented together in a permutation module or digit conversion module or counter conversion module, as indicated here.

Der im Arbeitsspeicher 6 nach der Inkrementierung in Form von neuen Speicherworten SW' hinterlegte Zählerstand wird dann an ein Vergleichermodul 9 übergeben, welches die neuen Speicherworte SW' mit den alten Speicherworten SW, die dieses Vergleichermodul 9 beispielsweise von der Leseschnittstelle 7 erhalten hat oder welche zusätzlich zu den geänderten Speicherworten SW' im Arbeitsspeicher 6 hinterlegt sind, vergleicht, um zu prüfen, welches Speicherwort sich bei der Inkrementierung geändert hat. Es wird dann nur dieses geänderte Speicherwort SW'' von der Speicherschnittstelle 8 im nichtflüchtigen Speicher 2 überschrieben.The in-memory 6 after the increment in the form of new memory words SW 'stored count is then to a comparator module 9 pass which the new memory words SW 'with the old memory words SW, the this comparator module 9 for example, from the read interface 7 has received or in addition to the changed memory words SW 'in memory 6 are compared to check which memory word has changed during incrementing. It will then only this changed memory word SW '' from the memory interface 8th in non-volatile memory 2 overwritten.

Ein kompletter Zählvorgang an einem 32-Bit-Zähler mit vier Speicherworten A, B, C, D (im Folgenden auch Speicher-Bytes genannt) wird im Folgenden an den 5a und 5b erläutert. Hierbei bestehen die einzelnen Ziffern des Speicherstands sowohl in der Ordinalzahl als auch im Gray-Code aus jeweils 4 Bits.A complete counting process on a 32-bit counter with four memory words A, B, C, D (hereinafter also referred to as memory bytes) is referred to below 5a and 5b explained. Here are the individual digits of the memory both in the ordinal number and in the Gray code of 4 bits.

Die Kodierung der einzelnen Ziffern erfolgt gemäß dem oben angegebenen, anhand von 3 dargestellten erweiterten ausgeglichenen Gray-Code. Die Ordinalzahlen des Zählers selbst sind dabei gemäß dem reflektierten Gray-Code zur Basis B = 2n mit n = 16 kodiert, d. h. die Ziffern sind Hexadezimalzahlen.The coding of each digit is carried out according to the above, based on 3 illustrated extended balanced Gray code. The ordinals of the counter itself are coded according to the reflected Gray code to the base B = 2 n with n = 16, ie the digits are hexadecimal numbers.

Im Schritt Z(0) ist zunächst der Zählerstand noch in den vier Speicherworten D, C, B, A von jeweils 1 Byte Länge gespeichert. Die Buchstaben a0 bis a7, b0 bis b7, c0 bis c7 und d0 bis d7 geben dabei jeweils die Bit-Stelle in den einzelnen Speicherworten A, B, C, D an. Unmittelbar darunter ist als Beispiel ein binärer Wert eingetragen.In step Z (0) , the counter reading is initially stored in the four memory words D, C, B, A, each of 1 byte length. The letters a 0 to a 7 , b 0 to b 7 , c 0 to c 7 and d 0 to d 7 indicate in each case the bit position in the individual memory words A, B, C, D. Immediately below is a binary value as an example.

Im nächsten Schritt Z(1) sind dann die einzelnen Ziffern im ausgeglichenen Gray-Code nach Umsortierung der einzelnen Bit-Stellen auf die acht dritten Datenworte DW3 gezeigt, welche jeweils eine Länge von 4 Bit aufweisen. Wie hier zu sehen ist, enthält die niederwertigste Ziffer die Bits a0, b0, c0, d0, die nächsthöherwertige Ziffer die Bits a1, b1, c1, d1 usw.In the next step Z (1) , the individual digits in the balanced Gray code are then shown after re-sorting the individual bit positions to the eight third data words DW 3 , which each have a length of 4 bits. As can be seen here, the least significant digit contains the bits a 0 , b 0 , c 0 , d 0 , the next higher digit the bits a 1 , b 1 , c 1 , d 1 , etc.

Im nachfolgenden Schritt Z(2) sind dann die einzelnen Ziffern als binär kodierte Ordinalzahlen (in Form der zweiten Datenworte DW2) dargestellt, wie sie nach der Konvertierung aus dem ausgeglichenen Gray-Code mit Hilfe der inversen Ziffern-Kodierungsregel erzeugt werden können. Zusätzlich sind hier die einzelnen Ziffern auf der linken Seite über den Bit-Darstellungen der zweiten Datenworte DW2 dieses gray-kodierten Zählerstands als hexadezimale Ordinalzahlen angegeben.In the following step Z (2) then the individual digits are represented as binary coded ordinal numbers (in the form of the second data words DW 2 ), as they can be generated after the conversion from the balanced Gray code using the inverse digit encoding rule. In addition, here the individual digits on the left side over the bit representations of the second data words DW 2 of this gray-coded counter reading are given as hexadecimal ordinal numbers.

Im Schritt Z(3) wird dann der Zählerstand nach der inversen Zählerkonvertierung in Form der ersten Datenworte DW1 angegeben. Hierbei handelt es sich um den nicht gray-kodierten Original-Zählerstand als Ordinalzahl. Auch hier ist der Zählerstand wieder zusätzlich in Form von acht Hexadezimalziffern angegeben.In step Z (3) , the count after the inverse counter conversion is then specified in the form of the first data words DW 1 . This is the non-gray coded original counter stood as ordinal number. Again, the meter reading is additionally given in the form of eight hexadecimal digits.

Im nächsten Schritt Z(4) erfolgt dann eine Inkrementierung des Zählerstands um den Wert 1. Die durch diese Inkrementierung betroffenen Ziffern sind sowohl in der Hexadezimalform als auch in der Binärdarstellung jeweils durch ein umlaufendes Kästchen markiert. Wie hier zu sehen ist, wurde die drittniedrigste Ziffer von dem hexadezimalen Wert 5 auf den Wert 6 geändert, damit haben sich automatisch auch die beiden niederwertigeren Ziffern, welche vorher jeweils durch ein „f" dargestellt waren, auf den Wert „0" geändert. Dementsprechend sind auch die drei ganz rechten, diese Ziffern darstellenden binärkodierten ersten Datenworte DW1 geändert worden.In the next step Z (4) , the counter reading is then incremented by the value 1. The digits affected by this incrementing are marked in the hexadecimal form as well as in the binary representation by a circulating box. As can be seen here, the third lowest digit has been changed from the hexadecimal value 5 to the value 6, so that automatically the two lower order digits previously represented by an "f" have also been changed to the value "0". Accordingly, the three rightmost binary coded first data words DW 1 representing these numbers have also been changed.

Im Schritt Z(5) werden diese ersten Datenworte DW1 dann wieder mit Hilfe des zyklischen Gray-Codes, wie er oben anhand der Berechnungsregel (1) angegeben ist, umgerechnet. Wie aus den 5a und 5b zu ersehen ist, ist aufgrund der Gray-Kodierung des Zählerstands durch die Inkrementierung nur noch eine Ziffer, nämlich die drittniedrigste Ziffer, betroffen. Das heißt, lediglich in dem zweiten Datenwort DW2, welches die drittniederwertigste Ziffer betrifft, gibt es eine Änderung gegenüber dem entsprechenden Datenwort DW2 vor der Inkrementierung (siehe Schritt Z(2)). Allerdings sind in dieser Ziffer insgesamt 2 Bits durch die Änderung betroffen.In step Z (5) , these first data words DW 1 are then again using the cyclic Gray code, as above using the calculation rule ( 1 ) is converted. Like from the 5a and 5b can be seen, is due to the Gray coding of the count by incrementing only one digit, namely the third lowest digit affected. That is, only in the second data word DW 2 , which relates to the third least significant digit, there is a change from the corresponding data word DW 2 before the incrementation (see step Z (2) ). However, in this figure a total of 2 bits are affected by the change.

Im nächsten Schritt Z(6) werden nun die einzelnen Ziffern gemäß der ebenfalls oben angegeben Regel in einen erweiterten ausgeglichenen Gray-Code gebracht, d. h. die zweiten Datenworte DW2 werden jeweils wieder in die dritten Datenworte DW3 umgewandelt. Ein Vergleich des drittniedrigsten, durch die Inkrementierung geänderten dritten Datenworts DW3 mit dem entsprechenden dritten Datenwort DW3 im Schritt Z(1) zeigt, dass sich nun durch die Inkrementierung lediglich ein einzelnes Bit geändert hat.In the next step Z (6) , the individual digits are now brought into an extended, balanced Gray code in accordance with the rule also indicated above, ie the second data words DW 2 are respectively converted back into the third data words DW 3 . A comparison of the third lowest, modified by the incrementing third data word DW 3 with the corresponding third data word DW 3 in step Z (1) shows that now only a single bit has changed due to the incrementation.

Anschließend erfolgt wieder im Schritt Z(7) eine Verteilung der einzelnen Bits der dritten Datenworte DW3 auf die Speicherworte D, C, B, A. Da sich nur ein Bit eines dritten Datenworts DW3 durch die Inkrementierung geändert hat, ändert sich folglich durch die Inkrementierung auch nur eines der Zählerstand-Speicherworte SW, hier das Speicherwort C. Dieses muss dann im nichtflüchtigen Speicher überschrieben werden.Subsequently, again in step Z (7), the individual bits of the third data words DW 3 are distributed to the memory words D, C, B, A. Since only one bit of a third data word DW 3 has changed as a result of the incrementation, the result changes accordingly the incrementation of only one of the counter reading memory words SW, here the memory word C. This must then be overwritten in the non-volatile memory.

5c zeigt die Schritte Z(4) bis Z(7) bei einer nachfolgenden weiteren Inkrementierung. Hierbei ändert sich der inkrementierte Zählerstand als Ordinalzahl nur in der niederwertigsten Ziffer, welche wieder von 0 auf 1 gesetzt wird (siehe Hexadezimaldarstellung), d. h. es ändert sich dementsprechend nur das ganz rechte Datenwort DW1, welches die niederwertigste Ziffer darstellt. 5c shows the steps Z (4) to Z (7) in a subsequent further incrementation. Here, the incremented count changes as ordinal only in the least significant digit, which is again set from 0 to 1 (see hexadecimal representation), ie it changes accordingly only the rightmost data word DW 1 , which represents the least significant digit.

Bei der Rückkodierung in den reflektierten Gray-Code gibt es hier keine Änderungen. Ebenso ist bei der Kodierung dieser Ziffer in den erweiterten ausgeglichenen Gray-Code sichergestellt, dass sich wieder nur ein einzelnes Bit der gesamten Ziffern ändert. Entsprechend ändert sich bei den inkrementierten Zählerstand-Speicherworten wieder nur ein einzelnes Speicherwort SW, nämlich in diesem Fall das Speicherwort A.at the recoding There are no changes in the reflected Gray code here. Similarly, when coding this digit in the advanced balanced Gray code ensures that again only a single bit the entire digits changes. Correspondingly changes at the incremented counter reading memory words again only a single memory word SW, namely in this case the memory word A.

Wie hier gezeigt ist, kann mit dem erfindungsgemäßen Verfahren ein 32-Bit-Zähler realisiert werden, der nicht auf Bit-Ebene, sondern sogar auf Byte-Ebene ausgeglichen ist. Es wird also letztlich ein vierstelliger, total ausgeglichener Gray-Code zur Basis 28 = 256 zur Verfügung gestellt. Durch das dreistufige Verfahren ist dabei sichergestellt, dass die jeweiligen Konvertierungen relativ einfach durchgeführt werden können. So kann sowohl die Gray-Kodierung des Zählerinhalts in der ersten Stufe mit den oben beschriebenen Rechenregeln als auch die Konvertierung der einzelnen Ziffern in einen erweiterten ausgeglichenen Gray-Code mit Hilfe einer sehr kleinen Tabelle einfach und schnell durchführbar werden. Ein weiterer Vorteil kann darin bestehen, dass die Differenz in der Anzahl der Schreibzugriffe auf die einzelnen Speicherworte innerhalb eines nicht abgeschlossenen Teilzyklus durch die Anzahl der Ziffern-Bits bestimmt wird, d. h. der Bits, welche nötig sind, um eine einzelne Ziffer zu beschreiben. Durch eine entsprechende Wahl dieses Parameters, wie hier beispielsweise durch die Verwendung von 4-Bit-Ziffern, kann dementsprechend auch diese Differenz klein gehalten werden. Durch die schnelle und einfache Konvertierung können auch lange Zähler in den korrespondierenden Gray-Code bzw. in die korrespondierende Ordinalzahl umgesetzt werden.As shown here, the method of the present invention can realize a 32-bit counter that is balanced not at the bit level but even at the byte level. So it is ultimately a four-digit, totally balanced Gray code to base 2 8 = 256 provided. The three-stage process ensures that the respective conversions can be carried out relatively easily. Thus, both the gray coding of the counter content in the first stage with the above-described calculation rules and the conversion of the individual digits into an extended balanced Gray code with the help of a very small table can be made simple and fast. A further advantage may be that the difference in the number of write accesses to the individual memory words within an incomplete subcycle is determined by the number of digit bits, ie the bits which are necessary to describe a single digit. By an appropriate choice of this parameter, as here for example by the use of 4-bit digits, this difference can be kept small accordingly. Due to the quick and easy conversion even long counters can be converted into the corresponding Gray code or into the corresponding ordinal number.

Es wird abschließend noch einmal darauf hingewiesen, dass es sich bei dem vorhergehend detailliert beschriebenen Verfahrensablauf sowie bei dem dargestellten Zähler lediglich um Ausführungsbeispiele handelt, welche vom Fachmann in ver schiedenster Weise modifiziert werden können, ohne den Bereich der Erfindung zu verlassen. So kann die Erfindung insbesondere auch für unterschiedlichste Wortlängen der Datenworte bzw. der Speicherworte eines Speicherbausteins verwendet werden.It will be final once again noted that it is the previous one described in detail process flow as well as in the illustrated counter only to exemplary embodiments which is modified by the expert in ver different ways can be without departing from the scope of the invention. So can the invention especially for different word lengths the data words or the memory words of a memory module used become.

Claims (10)

Verfahren zum Betreiben eines Zählers, bei dem ein aktueller Zählerstand jeweils in Form einer Gruppe von binären Speicherworten in einem Speicher hinterlegt wird, wobei zur Inkrementierung oder Dekrementierung des Zählerstands jeweils folgende Verfahrensschritte durchgeführt werden: a) Auslesen der Speicherworte (SW) des Zählerstands aus dem Speicher (2), b) Umordnung von Bits der Speicherworte (SW) unter Verwendung einer inversen Permutationsregel zur Erzeugung einer Gruppe von dritten Datenworten (DW3), welche jeweils in einem erweiterten Gray-Code codierte Ziffern eines in einem Gray-Code codierten Zählerstand repräsentieren, c) Konvertieren der einzelnen dritten Datenworte (DW3) unter Verwendung einer inversen Ziffern-Kodierungsregel jeweils in zweite Datenworte (DW2), welche jeweils die Ziffern des im Gray-Code codierten Zählerstands repräsentieren, d) Konvertieren der Gruppe von zweiten Datenworten (DW2) unter Verwendung einer inversen Zähler-Kodierungsregel zur Erzeugung einer Gruppe von ersten Datenworten (DW1), welche jeweils die Ziffern des durch eine Ordinalzahl zu einer Basis n definierten Zählerstands (ZS) repräsentieren, e) Inkrementieren oder Dekrementieren des Zählerstands, f) Konvertieren der Gruppe von ersten Datenworten (DW1) in eine Gruppe von zweiten Datenworten (DW2) unter Verwendung der Zähler-Kodierungsregel, wobei der durch eine Ordinalzahl zu einer Basis n definierte Zählerstand wieder in einem Gray-Code kodiert wird und die zweiten Datenworte (DW2) jeweils die Ziffern des gray-codierten Zählerstands repräsentieren, g) Konvertieren der einzelnen zweiten Datenworte (DW2) jeweils in dritte Datenworte (DW3) unter Verwendung der Ziffern-Kodierungsregel, wobei jeweils die Ziffern des im Gray-Code codierten Zählerstands in einem erweiterten Gray-Code in den dritten Datenworten (DW3) kodiert werden, h) Umordnung von Bits der dritten Datenworte (DW3) unter Verwendung der Permutationsregel zur Erzeugung von Speicherworten (SW'), so dass die Bits der dritten Datenworte (DW3) jeweils auf die Speicherworte (SW') verteilt sind, i) Vergleichen der so erzeugten Speicherworte (SW') mit den im Speicher (2) hinterlegten Speicherworten (SW) und j) Speichern derjenigen Speicherworte (SW''), welche durch die Inkrementierung oder Dekrementierung geändert wurden.Method for operating a counter, in which a current counter reading is stored in the form of a group of binary memory words in a memory, wherein the following method steps are carried out for incrementing or decrementing the counter reading: a) reading the memory words (SW) of the counter reading from the memory ( 2 b) rearranging bits of the memory words (SW) using an inverse permutation rule to generate a set of third data words (DW 3 ) each representing digits encoded in an extended Gray code of a count coded in a Gray code, c ) Converting the individual third data words (DW 3 ) using an inverse numerical coding rule into second data words (DW 2 ), which respectively represent the digits of the count coded in Gray code, d) converting the group of second data words (DW 2 ) using an inverse counter encoding rule to generate a set of first data words (DW 1 ) each representing the digits of the count (ZS) defined by an ordinal number to a base n, e) incrementing or decrementing the count, f) converting the group of first data words (DW 1) in a group of second data words (DW 2) using the Z hler encoding rule, wherein the encoded by an ordinal number to a base n defined count back into a Gray code and the second data words (DW 2) respectively represent the digits of the Gray coded count, g) converting the single second data words (DW 2 ) in each case in third data words (DW 3 ) using the digit coding rule, wherein in each case the digits of the gray code encoded count are encoded in an extended Gray code in the third data words (DW 3 ), h) rearrangement of bits the third data words (DW 3 ) using the permutation rule for generating memory words (SW '), so that the bits of the third data words (DW 3 ) in each case to the memory words (SW') are distributed, i) comparing the memory words thus generated ( SW ') with those in the memory ( 2 ) stored memory words (SW) and j) storing those memory words (SW ''), which were changed by the incrementing or decrementing. Verfahren nach Anspruch 1, dadurch gekennzeichnet, dass die Ziffern-Kodierungsregel so gewählt wird, dass die Ziffern des im Gray-Code kodierten Zählerstands in den dritten Datenworten (DW3) in einem erweiterten ausgeglichenen Gray-Code kodiert sind.A method according to claim 1, characterized in that the digit encoding rule is selected so that the digits of the encoded in Gray code count in the third data words (DW 3 ) are encoded in an extended balanced Gray code. Verfahren nach Anspruch 1 oder 2, dadurch gekennzeichnet, dass der Zählerstand durch eine Ordinalzahl zu einer Basis n definiert ist, die eine Potenz von 2 ist.Method according to claim 1 or 2, characterized that the meter reading is defined by an ordinal number to a base n, which is a Power of 2 is. Verfahren nach einem der Ansprüche 1 bis 3, dadurch gekennzeichnet, dass die Ziffern-Kodierungsregel in einer Tabelle (LUT) hinterlegt ist.Method according to one of claims 1 to 3, characterized that the numeric coding rule is stored in a table (LUT) is. Verfahren nach einem der Ansprüche 1 bis 4, dadurch gekennzeichnet, dass die Ziffern-Kodierungsregel für eine Anzahl von aufeinanderfolgenden Zyklen, welche ein zu kodierende Ziffer durchläuft, jeweils unterschiedliche Zyklus-Kodierungsregeln umfasst, wobei die Anzahl der Zyklus-Kodierungsregeln der Anzahl oder einem Vielfachen der Anzahl der Bits eines einzelnen der dritten Datenworte entspricht.Method according to one of claims 1 to 4, characterized that the digit encoding rule for a number of consecutive cycles, which passes through a number to be coded, each different Cycle coding rules wherein the number of cycle encoding rules is the number or one Multiples the number of bits of a single one of the third data words equivalent. Verfahren nach einem der Ansprüche 1 bis 5, dadurch gekennzeichnet, dass die Länge der ersten Datenworte (DW1), die Länge der zweiten Datenworte (DW2) und die Länge der dritten Datenworte (DW3) jeweils vier Bit beträgt.Method according to one of claims 1 to 5, characterized in that the length of the first data words (DW 1 ), the length of the second data words (DW 2 ) and the length of the third data words (DW 3 ) is four bits each. Verfahren nach einem der Ansprüche 1 bis 6, dadurch gekennzeichnet, dass die Zähler-Kodierungsregel so gewählt wird, dass der durch eine Ordinalzahl zu einer Basis n definierte Zählerstand in einem zyklischen reflektierten Gray-Code kodiert wird.Method according to one of claims 1 to 6, characterized that the counter coding rule so chosen becomes that defined by an ordinal number to a base n meter reading is encoded in a cyclic gray-reflected code. Verfahren nach einem der Ansprüche 1 bis 7, dadurch gekennzeichnet, dass die Zähler-Kodierungsregel und die inverse Zähler-Kodierungsregel jeweils durch einen Berechnungsalgorithmus (BA, BA') vorgegeben sind und zur Konvertierung der Gruppe von ersten Datenworten (DW1) in die Gruppe von zweiten Datenworten (DW2) und umgekehrt jeweils eine Berechnung mit Hilfe des entsprechenden Berechnungsalgorithmus durchgeführt wird.Method according to one of Claims 1 to 7, characterized in that the counter coding rule and the inverse counter coding rule are respectively predetermined by a calculation algorithm (BA, BA ') and for converting the group of first data words (DW 1 ) into the group of second data words (DW 2 ) and vice versa each calculation is carried out with the aid of the corresponding calculation algorithm. Zähler-Schaltungsanordnung (1), mit einem nichtflüchtigen Speicher (2), um einen aktuellen Zählerstand jeweils in Form einer Gruppe von binären Speicherworten zu hinterlegen, und einer Recheneinheit (5) mit einem Arbeitsspeicher (6), welche Recheneinheit (5) folgende Komponenten umfasst: a) eine Leseschnittstelle (7) zum Auslesen der Speicherworte (SW) des Zählerstands aus dem Speicher (2) und Ablegen in dem Arbeitsspeicher (6), b) ein erstes Permutationsmodul (10a) zur Umordnung von Bits der Speicherworte (SW) unter Verwendung einer inversen Permutationsregel zur Erzeugung einer Gruppe von dritten Datenworten (DW3), welche jeweils in einem erweiterten Gray-Code codierte Ziffern eines in einem Gray-Code codierten Zählerstands repräsentieren, c) ein erstes Ziffern-Konvertierungsmodul (11a) zum Konvertieren der einzelnen dritten Datenworte (DW3) unter Verwendung einer inversen Ziffern-Kodierungsregel jeweils in zweite Datenworte (DW2), welche jeweils die Ziffern des im Gray-Code codierten Zählerstands repräsentieren, d) ein erstes Zählerstand-Konvertierungsmodul (12a) zum Konvertieren der gesamten Gruppe von zweiten Datenworten (DW2) unter Verwendung einer inversen Zähler-Kodierungsregel zur Erzeugung einer Gruppe von ersten Datenworten (DW1), welche jeweils die Ziffern des durch eine Ordinalzahl zu einer Basis n definierten Zählerstands repräsentieren, e) ein Inkrementierungs-/Dekrementierungsmodul (13) zum Inkrementieren oder Dekrementieren des Zählerstands, f) ein zweites Zählerstand-Konvertierungsmodul (12b) zum Konvertieren der gesamten Gruppe von ersten Datenworten (DW1) unter Verwendung der Zähler-Kodierungsregel in eine Gruppe von zweiten Datenworten (DW2), wobei der durch eine Ordinalzahl zu einer Basis n definierte Zählerstand wieder in einem Gray-Code kodiert wird und die zweiten Datenworte (DW2) jeweils die Ziffern des gray-codierten Zählerstands repräsentieren, g) ein zweites Ziffern-Konvertierungsmodul (11b) zum Konvertieren der einzelnen zweiten Datenworte (DW2) unter Verwendung der Ziffern-Kodierungsregel jeweils in dritte Datenworte (DW3), wobei jeweils die Ziffern des im Gray-Code codierten Zählerstands in einem erweiterten Gray-Code in den dritten Datenworten (DW3) kodiert werden, h) ein zweites Permutationsmodul (10b) zur Umordnung von Bits der dritten Datenworte (DW3) unter Verwendung der Permutationsregel zur Erzeugung von Speicherworten (SW), so dass die Bits der dritten Datenworte (DW3) jeweils auf die Speicherworte (SW') verteilt sind, i) ein Vergleichermodul (9) zum Vergleichen der so im Arbeitsspeicher (6) erzeugten Speicherworte (SW') mit den im nichtflüchtigen Speicher (2) hinterlegten Speicherworten (SW) und j) eine Speicherschnittstelle (8) zum Speichern derjenigen Speicherworte (SW'') im nichtflüchtigen Speicher (2), welche durch die Inkrementierung oder Dekrementierung geändert wurden.Counter circuit arrangement ( 1 ), with a non-volatile memory ( 2 ), in order to store a current counter reading in the form of a group of binary memory words, and a computing unit ( 5 ) with a working memory ( 6 ), which arithmetic unit ( 5 ) comprises the following components: a) a read interface ( 7 ) for reading the memory words (SW) of the counter reading from the memory ( 2 ) and storing in the main memory ( 6 ), b) a first permutation module ( 10a ) for rearranging bits of the memory words (SW) using an inverse permutation rule to generate a set of third data words (DW 3 ) each representing digits coded in an extended Gray code of a count coded in a Gray code, c) first digit conversion module ( 11a ) for converting the individual third data words (DW 3 ) using an inverse numerical coding rule into second data words (DW 2 ), which respectively represent the digits of the count coded in the Gray code, d) a first meter reading conversion module ( 12a ) for converting the entire set of second data words (DW 2 ) using an inverse counter encoding rule to create a group of first data words (DW 1 ), which respectively represent the digits of the count defined by an ordinal number to a base n, e) an increment / decrement module ( 13 ) for incrementing or decrementing the meter reading, f) a second meter reading conversion module ( 12b ) for converting the entire group of first data words (DW 1 ) into a group of second data words (DW 2 ) using the numerator coding rule, wherein the count defined by an ordinal number to a base n is coded again in a Gray code, and the second data words (DW 2 ) each represent the digits of the gray-coded counter reading, g) a second digit conversion module ( 11b ) for converting the individual second data words (DW 2 ) using the digit coding rule in each case in third data words (DW 3 ), wherein in each case the digits of the gray code encoded count in an extended Gray code in the third data words (DW 3 ), h) a second permutation module ( 10b ) for rearranging bits of the third data words (DW 3 ) using the permutation rule for generating memory words (SW), so that the bits of the third data words (DW 3 ) are respectively distributed to the memory words (SW '), i) a comparator module ( 9 ) for comparing the so in the main memory ( 6 ) generated memory words (SW ') with those in the non-volatile memory ( 2 ) stored memory words (SW) and j) a memory interface ( 8th ) for storing those memory words (SW '') in the nonvolatile memory ( 2 ), which have been changed by incrementing or decrementing. Computerprogrammprodukt, welches direkt in einen Speicher einer programmierbaren Recheneinheit (5) einer Zähler-Schaltungsanordnung (1) ladbar ist, mit Programmcode-Mitteln, um alle Schritte eines Verfahrens nach einem der Ansprüche 1 bis 8 auszuführen, wenn das Programm auf der Recheneinheit (5) ausgeführt wird.Computer program product, which directly into a memory of a programmable computing unit ( 5 ) a counter circuit arrangement ( 1 ) is loadable with program code means to perform all the steps of a method according to one of claims 1 to 8, when the program on the arithmetic unit ( 5 ) is performed.
DE200710024410 2007-05-25 2007-05-25 Method for operating a counter and counter circuitry Expired - Fee Related DE102007024410B4 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
DE200710024410 DE102007024410B4 (en) 2007-05-25 2007-05-25 Method for operating a counter and counter circuitry

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
DE200710024410 DE102007024410B4 (en) 2007-05-25 2007-05-25 Method for operating a counter and counter circuitry

Publications (2)

Publication Number Publication Date
DE102007024410A1 DE102007024410A1 (en) 2008-11-27
DE102007024410B4 true DE102007024410B4 (en) 2009-04-23

Family

ID=39877165

Family Applications (1)

Application Number Title Priority Date Filing Date
DE200710024410 Expired - Fee Related DE102007024410B4 (en) 2007-05-25 2007-05-25 Method for operating a counter and counter circuitry

Country Status (1)

Country Link
DE (1) DE102007024410B4 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2180083A (en) * 1985-09-06 1987-03-18 Motorola Inc Non-volatile electronic counters
DE69132626T2 (en) * 1990-11-02 2002-04-18 France Telecom, Paris Binary coding method with uniform switching distribution of the binary elements and incrementing-decrementing method therefor
DE10144077A1 (en) * 2001-09-07 2003-03-27 Philips Corp Intellectual Pty binary counter
US20040113822A1 (en) * 2002-12-16 2004-06-17 Hongato Jiang Scalable gray code counter and applications thereof
US20040141580A1 (en) * 2003-01-21 2004-07-22 Maletsky Kerry D. Method for counting beyond endurance limitations of non-volatile memories

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2180083A (en) * 1985-09-06 1987-03-18 Motorola Inc Non-volatile electronic counters
DE69132626T2 (en) * 1990-11-02 2002-04-18 France Telecom, Paris Binary coding method with uniform switching distribution of the binary elements and incrementing-decrementing method therefor
DE10144077A1 (en) * 2001-09-07 2003-03-27 Philips Corp Intellectual Pty binary counter
US20040113822A1 (en) * 2002-12-16 2004-06-17 Hongato Jiang Scalable gray code counter and applications thereof
US20040141580A1 (en) * 2003-01-21 2004-07-22 Maletsky Kerry D. Method for counting beyond endurance limitations of non-volatile memories

Also Published As

Publication number Publication date
DE102007024410A1 (en) 2008-11-27

Similar Documents

Publication Publication Date Title
DE69323020T2 (en) Decoder for variable length codes
DE2725395C3 (en) Device for real-time transformation of m words of bit length n arranged in rows into n words of bit length n arranged in columns
DE69132626T2 (en) Binary coding method with uniform switching distribution of the binary elements and incrementing-decrementing method therefor
DE4314741C2 (en) Decoder for units of Huffman encoded data
DE69529546T2 (en) Sequential interleaver and address generator with reduced memory requirements
DE3525898C2 (en)
DE2264090B2 (en) Data compression
DE2031040B2 (en) PROCEDURE FOR DETERMINING ACCESS OF SEVERAL USERS TO A UNIT OF A DATA PROCESSING SYSTEM AND ARRANGEMENT FOR PERFORMING THE PROCEDURE
DE2805294C2 (en) Coding transmission system for facsimile signals
DE2900586C2 (en) Arrangement for decoding code words of variable length
DE102007051192B4 (en) A memory device employing tri-level cells and associated method for managing
DE2357654C2 (en) Associative memory
EP0029490B1 (en) Method of converting linear-coded digital signals into non-linear coded digital signals according to a multiple segment characteristic responding to the a law or the mu law
DE102007024410B4 (en) Method for operating a counter and counter circuitry
DE19917016A1 (en) Circuit for conversion of parallel data stream into series one and vice versa and for intermediate storage and clocked transmission of data stream
DE2158011C3 (en) Digital display system
EP0769853B1 (en) Logic block for a viterbi decoder
DE102008009768B4 (en) Incrementing counter with extended write lifetime
DE19718479C1 (en) Chip card with memory access maximization and protocol
DE102005042135B3 (en) Random number generating device for e.g. smart card, has memory device storing bit issued from noise source in memory areas of device, and reading device to read bits from areas, if predetermined bits are stored in one of areas
DE2233164B2 (en) Partial amendment of stored data - using logic circuit transferring part of bit sequence between registers
EP1293938B1 (en) Binary counter with permuted storage
DE1808159B2 (en) DEVICE FOR CONVERTING DUAL NUMBERS IN BINARY CODED DECIMAL NUMBERS IN PARALLEL DISPLAY
DE3417816A1 (en) Programmable switching network
DE2017879B2 (en) Free access memory array

Legal Events

Date Code Title Description
OP8 Request for examination as to paragraph 44 patent law
8320 Willingness to grant licenses declared (paragraph 23)
8364 No opposition during term of opposition
R119 Application deemed withdrawn, or ip right lapsed, due to non-payment of renewal fee