TWI623200B - Decoding device and decoding method for absolute positioning code - Google Patents

Decoding device and decoding method for absolute positioning code Download PDF

Info

Publication number
TWI623200B
TWI623200B TW105133434A TW105133434A TWI623200B TW I623200 B TWI623200 B TW I623200B TW 105133434 A TW105133434 A TW 105133434A TW 105133434 A TW105133434 A TW 105133434A TW I623200 B TWI623200 B TW I623200B
Authority
TW
Taiwan
Prior art keywords
look
circuit
result value
output
clock signal
Prior art date
Application number
TW105133434A
Other languages
Chinese (zh)
Other versions
TW201739173A (en
Inventor
陳建文
陳泳昌
黃煥祺
Original Assignee
財團法人工業技術研究院
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 財團法人工業技術研究院 filed Critical 財團法人工業技術研究院
Priority to US15/395,344 priority Critical patent/US10243668B2/en
Priority to US15/395,843 priority patent/US9871595B2/en
Priority to CN201710288206.2A priority patent/CN107314743B/en
Priority to CN201710288921.6A priority patent/CN107314780B/en
Publication of TW201739173A publication Critical patent/TW201739173A/en
Application granted granted Critical
Publication of TWI623200B publication Critical patent/TWI623200B/en

Links

Abstract

一種定位絕對碼的解碼裝置,包括線性回授移位暫存器、查表電路、計數器、以及計算電路。線性回授移位暫存器包括n個暫存器,以第一頻率載入定位絕對碼,並根據時脈信號進行移位運算,時脈信號具有不小於第一頻率的第二頻率。查表電路根據n個暫存器儲存的值,輸出查表結果值以及查表有效旗標,查表結果值具有k種不同資料,k≦(2n-1)。計數器根據查表有效旗標進行重置,並且根據時脈信號進行計數運算以產生計數結果值。當查表有效旗標指示為有效時,計算電路根據查表結果值以及計數結果值計算產生解碼結果。 A decoding device for locating an absolute code, comprising a linear feedback shift register, a look-up table circuit, a counter, and a calculation circuit. The linear feedback shift register includes n registers, loads the positioning absolute code at the first frequency, and performs a shift operation according to the clock signal, the clock signal having a second frequency not less than the first frequency. The look-up table circuit outputs the look-up result value and the check-table effective flag according to the values stored by the n registers, and the result of the look-up table has k different kinds of data, k≦(2 n -1). The counter is reset according to the lookup table valid flag, and the counting operation is performed according to the clock signal to generate a count result value. When the lookup table valid flag indication is valid, the calculation circuit calculates a decoding result according to the lookup table result value and the count result value.

Description

定位絕對碼的解碼裝置及解碼方法 Decoding device and decoding method for locating absolute code

本發明係關於定位絕對碼的解碼裝置及應用於其上的解碼方法。 The present invention relates to a decoding apparatus for locating an absolute code and a decoding method applied thereto.

光學編碼器(例如:旋轉編碼器、光學尺,本說明書以下將以光學尺通稱光學編碼器)依輸出型式可分為增量型(incremental)輸出以及絕對型(absolute)輸出。其中絕對輸出型光學尺具有可以直接讀出位移座標的絕對值、沒有累積誤差、電源切除後位置資訊不會丟失等優點,廣泛使用於數控機床、伺服傳動、機器人等需要檢測位移的裝置設備。而藉由光學尺讀取到的信號,需經由對應的解碼器以取得待測物品的位置資訊,因此,如何設計適用於絕對型輸出光學尺的解碼裝置以及解碼方法,乃目前業界致力的課題之一。 Optical encoders (for example, rotary encoders, optical scales, and optical encoders in the present specification will be referred to as optical encoders in the following description) can be classified into an incremental output and an absolute output depending on the output type. The absolute output type optical scale has the advantages of directly reading the absolute value of the displacement coordinate, no cumulative error, and the position information is not lost after the power is cut off, and is widely used in equipments such as numerical control machine tools, servo drives, and robots that need to detect displacement. The signal read by the optical scale needs to obtain the position information of the object to be tested through the corresponding decoder. Therefore, how to design a decoding device and a decoding method suitable for the absolute output optical scale is a current problem in the industry. one.

本發明是有關於定位絕對碼的解碼裝置及應用於其上的解碼方法。 The present invention relates to a decoding apparatus for positioning an absolute code and a decoding method applied thereto.

根據本發明一實施範例,提出一種定位絕對碼的解碼裝置,包括線性回授移位暫存器、查表電路、計數器、以及計算電路。線性回授移位暫存器包括n個暫存器,n個暫存器以第一頻率載入定位絕對碼,並根據時脈信號進行移位運算,時脈信號具有第二頻率,第二頻率不小於第一頻率。查表電路根據n個暫存器儲存的值,對應輸出查表結果值以及查表有效旗標,其中查表結果值具有k種不同資料,k≦(2n-1),查表有效旗標指示查表結果值是否有效。計數器根據查表有效旗標進行重置,並且根據時脈信號進行計數運算以產生計數結果值。當查表有效旗標指示為有效時,計算電路根據查表結果值以及計數結果值計算產生解碼結果。 According to an embodiment of the present invention, a decoding apparatus for positioning an absolute code is provided, including a linear feedback shift register, a look-up table circuit, a counter, and a calculation circuit. The linear feedback shift register includes n registers, n registers load the positioning absolute code at the first frequency, and perform a shift operation according to the clock signal, the clock signal has a second frequency, and the second The frequency is not less than the first frequency. The table lookup circuit is based on the values stored in the n registers, corresponding to the output checklist result value and the check table valid flag, wherein the check result value has k different data, k≦(2 n -1), check table effective flag Indicates whether the result of the table check is valid. The counter is reset according to the lookup table valid flag, and the counting operation is performed according to the clock signal to generate a count result value. When the lookup table valid flag indication is valid, the calculation circuit calculates a decoding result according to the lookup table result value and the count result value.

另根據本發明一實施範例,提出一種定位絕對碼的解碼方法,包括下列步驟。提供線性回授移位暫存器,包括n個暫存器,n個暫存器以第一頻率載入定位絕對碼。根據時脈信號以線性回授移位暫存器進行移位運算,時脈信號具有第二頻率,第二頻率不小於第一頻率。使用查表,根據n個暫存器儲存的值,對應輸出查表結果值以及查表有效旗標,其中查表結果值具有k種不同資料,k≦(2n-1),查表有效旗標指示查表結果值是否有效。根據時脈信號進行計數運算以產生計數結果值,其中計數結果值根據查表有效旗標進行重置。當查表有效旗標指示為有效時,根據查表結果值以及計數結果值計算產生一解碼結果。 In addition, according to an embodiment of the present invention, a decoding method for locating an absolute code is provided, including the following steps. A linear feedback shift register is provided, including n registers, and n registers load the positioning absolute code at a first frequency. The shift operation is performed by linearly returning the shift register according to the clock signal, and the clock signal has a second frequency, and the second frequency is not less than the first frequency. Using the look-up table, according to the values stored in the n registers, the output check result value and the check table valid flag, wherein the check result value has k different materials, k≦(2 n -1), the check table is valid. The flag indicates whether the result of the lookup table is valid. The counting operation is performed according to the clock signal to generate a counting result value, wherein the counting result value is reset according to the look-up table valid flag. When the lookup table valid flag indication is valid, a decoding result is generated according to the lookup table result value and the count result value calculation.

為了對本發明之上述及其他方面有更佳的瞭解,下 文特舉較佳實施例,並配合所附圖式,作詳細說明如下: In order to better understand the above and other aspects of the present invention, The preferred embodiment is described in detail with reference to the accompanying drawings.

1‧‧‧解碼裝置 1‧‧‧Decoding device

100、100_F、100_G‧‧‧線性回授移位暫存器 100, 100_F, 100_G‧‧‧ linear feedback shift register

102‧‧‧查表電路 102‧‧‧Table lookup circuit

104‧‧‧計數器 104‧‧‧ counter

106‧‧‧計算電路 106‧‧‧Computation circuit

108‧‧‧時脈開關電路 108‧‧‧clock switch circuit

200‧‧‧回授多工器 200‧‧‧Responsible multiplexer

210、310‧‧‧多工器 210, 310‧‧‧Multiplexer

212、312‧‧‧邏輯互斥或閘 212, 312‧‧‧ logical mutual exclusion or gate

A‧‧‧第一控制資料 A‧‧‧First control data

B‧‧‧第二控制資料 B‧‧‧Second control data

C‧‧‧計數結果值 C‧‧‧ count result value

CLK‧‧‧時脈信號 CLK‧‧‧ clock signal

CalF(1)~CalF(3)、CalG(1)~CalG(3)‧‧‧運算邏輯電路 Cal F (1)~Cal F (3), Cal G (1)~Cal G (3)‧‧‧Operational logic circuit

R(1)~R(4)‧‧‧暫存器 R(1)~R(4)‧‧‧ register

S(1)~S(2)‧‧‧切換開關 S(1)~S(2)‧‧‧Switch

S400、S402、S404、S406、S408‧‧‧步驟 S400, S402, S404, S406, S408‧‧‧ steps

VF‧‧‧查表有效旗標 VF‧‧‧Table effective flag

X‧‧‧定位絕對碼 X‧‧‧ Positioning absolute code

Y‧‧‧查表結果值 Y‧‧‧Check results

Z‧‧‧解碼結果 Z‧‧‧ decoding results

第1A圖繪示單軌絕對值輸出型光學直線柵尺的示意圖。 FIG. 1A is a schematic diagram showing a monorail absolute value output type optical linear scale.

第1B圖繪示單軌絕對值輸出型光學圓柵尺的示意圖。 FIG. 1B is a schematic view showing a monorail absolute value output type optical circular scale.

第2A圖繪示線性回授移位暫存器的示意圖。 FIG. 2A is a schematic diagram showing a linear feedback shift register.

第2B圖繪示如第2A圖的線性回授移位暫存器所產生資料序列的示意圖。 FIG. 2B is a schematic diagram showing a sequence of data generated by the linear feedback shift register of FIG. 2A.

第3圖繪示依照本發明一實施例的解碼裝置示意圖。 FIG. 3 is a schematic diagram of a decoding apparatus according to an embodiment of the invention.

第4圖繪示依照本發明另一實施例的解碼裝置示意圖。 FIG. 4 is a schematic diagram of a decoding apparatus according to another embodiment of the present invention.

第5A圖繪示依照本發明一實施例的彈性線性回授移位暫存器示意圖。 FIG. 5A is a schematic diagram of an elastic linear feedback shift register according to an embodiment of the invention.

第5B圖繪示如第5A圖運算邏輯電路的示意圖。 FIG. 5B is a schematic diagram of the arithmetic logic circuit as shown in FIG. 5A.

第6A圖繪示依照本發明另一實施例的彈性線性回授移位暫存器示意圖。 FIG. 6A is a schematic diagram of an elastic linear feedback shift register according to another embodiment of the present invention.

第6B圖繪示如第6A圖運算邏輯電路的示意圖。 FIG. 6B is a schematic diagram of the arithmetic logic circuit as shown in FIG. 6A.

第7圖繪示依照本發明一實施例的對LFSR所產生資料序列以固定間隔進行取樣的示意圖。 FIG. 7 is a schematic diagram of sampling a data sequence generated by an LFSR at regular intervals according to an embodiment of the invention.

第8圖繪示依照本發明一實施例的查表電路的資料對應關係示意圖。 FIG. 8 is a schematic diagram showing the correspondence relationship of data of the look-up table circuit according to an embodiment of the invention.

第9圖繪示依照本發明一實施例的查表電路的真值表示意圖。 FIG. 9 is a schematic diagram of a truth table of a table lookup circuit according to an embodiment of the invention.

第10圖繪示依照本發明一實施例的查表電路的電路實作示意圖。 FIG. 10 is a schematic diagram showing the circuit implementation of the look-up table circuit according to an embodiment of the invention.

第11圖繪示依照本發明一實施例的解碼過程示意圖。 FIG. 11 is a schematic diagram of a decoding process according to an embodiment of the invention.

第12圖繪示依照本發明一實施例的解碼方法流程圖。 FIG. 12 is a flow chart of a decoding method according to an embodiment of the invention.

為了獲得一位置資訊,絕對輸出型光學尺以多組光電感測器來讀取一組位置資訊。由於必須考量到雜訊的抑制、判別正反轉、以及防止誤讀來提高可靠度,因此絕對輸出型光學尺在編碼方式上多採用多軌格雷碼(Gray code)編碼。格雷碼與一般二進位碼最大的差異在於格雷碼每次只變動一個位元,因此不易產生誤讀。 In order to obtain a position information, the absolute output type optical scale reads a set of position information by using a plurality of sets of photo-electrical sensors. Since the noise suppression, discriminating the positive and negative, and preventing misreading must be considered to improve the reliability, the absolute output optical scale uses the multi-track Gray code in the encoding method. The biggest difference between the Gray code and the general binary code is that the Gray code only changes one bit at a time, so it is not easy to cause misreading.

然而,以多軌排列產生格雷碼的做法,即使引入非常微小的偏角量,它也可能造成讀頭訊號的相位差,產生位置誤判,因此漸漸發展成為單軌絕對值輸出型光學尺。單軌絕對輸出型光學尺的刻度可以使用M序列碼(maximum length sequence,MLS)進行編碼,MLS是一種偽隨機二元序列(pseudorandom binary sequence),可利用線性回授移位暫存器(linear feedback shift registers,LFSR)產生。對於使用LFSR編碼的光學尺,在解碼端也可以利用線性回授移位暫存器來還原編碼的順序以得到位置資訊。 However, the practice of generating a Gray code in a multi-track arrangement, even if a very small amount of declination is introduced, it may cause a phase difference of the read head signal, causing a positional misjudgment, and thus gradually develops into a monorail absolute value output type optical scale. The scale of the monorail absolute output optical scale can be encoded using a maximum length sequence (MLS), which is a pseudorandom binary sequence that can be used with a linear feedback shift register (linear feedback) Shift registers, LFSR) are generated. For an optical scale encoded with LFSR, a linear feedback shift register can also be used at the decoding end to restore the order of encoding to obtain position information.

於實作中,單軌絕對值輸出型光學尺包括直接柵尺與圓柵尺,第1A圖繪示單軌絕對值輸出型光學直線柵尺的示意圖,第1B圖繪示單軌絕對值輸出型光學圓柵尺的示意圖,由LFSR所產生的偽隨機二元序列依序刻畫於光學尺上,可由不同的透光程度區分0與1,例如可透光區域為1,遮光區域為0。在光學尺 的兩側可分別設置有光源及光感測器陣列,藉由光感測器陣列讀到的資料,可以經由後續的解碼處理得到所代表的光學尺絕對位置。如第1A圖及第1B圖所示,光感測器陣列可以藉由接收到的光而讀取柵尺上鄰近的多個碼,而能夠根據此資訊獲得絕對位置。直線柵尺可用以測量位移量,圓柵尺可設置於繞著一轉軸旋轉的圓盤,用以測量物體的旋轉量。 In practice, the monorail absolute value output type optical scale includes a direct scale and a circular scale, FIG. 1A shows a schematic diagram of a monorail absolute value output type optical linear scale, and FIG. 1B shows a monorail absolute value output type optical circle. The schematic diagram of the scale, the pseudo-random binary sequence generated by the LFSR is sequentially depicted on the optical scale, and can be distinguished by 0 and 1 by different degrees of light transmission, for example, the permeable area is 1 and the light-shielding area is 0. In the optical ruler The light source and the photo sensor array can be respectively disposed on both sides of the optical sensor array, and the absolute position of the optical scale represented by the subsequent decoding process can be obtained by the data read by the photo sensor array. As shown in FIGS. 1A and 1B, the photosensor array can read a plurality of adjacent codes on the scale by the received light, and can obtain an absolute position based on the information. A linear scale can be used to measure the amount of displacement, and a circular scale can be placed on a disk that rotates about a rotation axis to measure the amount of rotation of the object.

然而,隨著對於位置解析度的要求提升,光學尺需要增加偵測長度,亦即需要更多位元(bit)數的M序列偽隨機碼。而對於位元數很多的MLS,若是單純使用移位暫存器還原編碼順序,會造成位置資訊的獲得非常緩慢。更有甚者,移位暫存器還原編碼順序的演算法需與刻畫於光學尺尺身的MLS隨機碼匹配設計。若能發展一種可讀取多種版本尺身序列的讀頭架構,就可節省讀頭的開發費用。 However, as the requirements for position resolution increase, the optical scale needs to increase the detection length, that is, an M-sequence pseudo-random code requiring a larger number of bits. For MLS with a large number of bits, if you simply use the shift register to restore the encoding order, the location information will be very slow. What is more, the algorithm for shifting the encoding order of the shift register needs to be matched with the MLS random code depicted on the optical scale body. If you can develop a read head architecture that can read multiple versions of the ruler sequence, you can save on the development cost of the read head.

而對於位置絕對碼的解碼方法,另一種方式是採用查表(Lookup Table,LUT)的方式,將刻畫於光學尺身的每一個MLS隨機碼,產生唯一的對應順序訊號,使得解碼端獲得順序訊號時,立即知道光學尺讀頭與尺身的對應位置。其做法是利用安裝於光學尺讀頭的多組光電感測器,經由讀取光學尺尺身MLS隨機碼的訊號,輸入至LUT的位址匯流排(address bus);當LUT獲得有效的位址時,立即輸出一對應的資料至資料匯流排(data bus)。而此方法亦面臨相同的議題,隨著光學尺偵測長度的增加,更多位元數的M序列偽隨機碼使得LUT容量急速膨脹,佔據過大的記憶體空間與硬體面積,容量過大的LUT將造成光學尺讀頭尺寸與製作成本的困擾。 For the decoding method of the absolute position of the position, another way is to use a lookup table (LUT) method to generate a unique corresponding sequence signal for each MLS random code depicted on the optical ruler, so that the decoding end obtains the order. When the signal is received, the corresponding position of the optical ruler and the ruler is immediately known. The method is to input the signal to the LUT by using a plurality of sets of photo-inductors mounted on the optical scale read head, and input the signal to the LUT via the signal of the MLS random code of the optical scale; when the LUT obtains a valid bit At the address, a corresponding data is immediately output to the data bus. This method also faces the same problem. As the length of the optical scale detection increases, the M-series pseudo-random code of more bits makes the LUT capacity expand rapidly, occupying too large memory space and hardware area, and the capacity is too large. The LUT will cause problems with the size and manufacturing cost of the optical scale.

以下首先說明關於以LFSR相關操作的敘述,LFSR包括多個暫存器,其特徵在於暫存器的輸入是暫存器前一輸出狀態(previous state)的線性函數,在LFSR當中此線性函數常見為使用互斥或閘(XOR)實現。LFSR當中暫存器的初始值叫做「種子(seed)」,因為LFSR的運算是確定性的,所以由LFSR所生成的數據流完全可由LFSR當時或者之前的狀態決定。而且,由於LFSR的可能狀態是有限的,它會是一個重複的循環。因此通過適當的預選多項式處理,LFSR可以生成看起來是隨機的且循環周期非常長的序列。 The following is a description of the operation of the LFSR related operation. The LFSR includes a plurality of registers, characterized in that the input of the register is a linear function of the previous state of the register, which is common in the LFSR. Implemented using a mutex or gate (XOR). The initial value of the scratchpad in the LFSR is called "seed". Because the operation of the LFSR is deterministic, the data stream generated by the LFSR can be completely determined by the current or previous state of the LFSR. Moreover, since the possible state of the LFSR is limited, it will be a repeating loop. Thus with proper pre-selection polynomial processing, the LFSR can generate sequences that appear to be random and have very long cycle times.

具體而言,LFSR可以根據XOR回授點的位置,或稱作抽頭(tap)位置,而改變對應的多項式。對於包括n個暫存器的LFSR,當LFSR的抽頭位置對應到一個本原多項式(primitive polynomial)時,只要暫存器的初始狀態並非全部為0,則可以產生長度為(2n-1)的MLS。同樣的,當獲得一組「種子」時,可以利用LFSR的移位運算與計數,找出「種子」位於該LFSR生成的數據流的位置。 Specifically, the LFSR can change the corresponding polynomial according to the position of the XOR feedback point, or the tap position. For the LFSR including n registers, when the tap position of the LFSR corresponds to a primitive polynomial, as long as the initial state of the register is not all 0, the length (2 n -1) can be generated. MLS. Similarly, when a set of "seeds" is obtained, the shift operation and counting of the LFSR can be utilized to find out where the "seed" is located in the data stream generated by the LFSR.

第2A圖繪示線性回授移位暫存器的示意圖,此圖以包括4個暫存器的LFSR作為例子說明,如圖所示,暫存器R3的下一狀態為暫存器R3目前狀態以及暫存器R0目前狀態的XOR運算結果,此圖對應的本原多項式為(x 4+x 3+1)。第2B圖繪示如第2A圖的線性回授移位暫存器所產生資料序列的示意圖,如此位元長度為4的LFSR,可以序列產生長度為(24-1)=15的MLS。第2A圖所繪示的僅是一種LFSR的實作方式,此例中是向右移位的架構,於其他實施例中,LFSR亦可以使用向左移位的架構, 其操作原理類似,於此不再重複贅述。 FIG. 2A is a schematic diagram of a linear feedback shift register. The figure is illustrated by an LFSR including four registers. As shown in the figure, the next state of the register R3 is the current register R3. The state and the XOR operation result of the current state of the register R0, the primitive polynomial corresponding to this figure is ( x 4 + x 3 +1). FIG. 2B is a schematic diagram showing a data sequence generated by the linear feedback shift register of FIG. 2A. Such an LFSR having a bit length of 4 can sequentially generate an MLS having a length of (2 4 -1)=15. FIG. 2A illustrates only one implementation of the LFSR. In this example, the architecture is shifted to the right. In other embodiments, the LFSR may also use a left-shifting architecture, and the operation principle is similar. This is not repeated here.

如前所述,對於偵測長度很長的光學尺,若使用LFSR解碼則可能速度過於緩慢,使用LUT則可能所需硬體空間過大不利於降低成本,因此本發明提出一種混合式的解碼架構,以達成兼顧計算時間與硬體面積的優點。 As described above, for an optical scale with a long detection length, if LFSR decoding is used, the speed may be too slow, and if the LUT is used, the hardware space may be too large to reduce the cost, so the present invention proposes a hybrid decoding architecture. In order to achieve the advantages of both calculation time and hardware area.

第3圖繪示依照本發明一實施例的解碼裝置示意圖。定位絕對碼的解碼裝置1,包括線性回授移位暫存器100、查表電路102、計數器104、以及計算電路106。線性回授移位暫存器100包括n個暫存器,n個暫存器以第一頻率f1載入定位絕對碼X,並根據時脈信號CLK進行移位運算,時脈信號CLK具有第二頻率f2,第二頻率f2不小於第一頻率f1。查表電路102根據n個暫存器儲存的值,對應輸出查表結果值Y以及查表有效旗標VF,其中查表結果值Y具有k種不同資料,k≦(2n-1),查表有效旗標VF指示查表結果值Y是否有效(valid)。計數器104根據查表有效旗標VF進行重置(reset),並且根據時脈信號CLK進行計數運算以產生計數結果值C。當查表有效旗標VF指示為有效時,計算電路106根據查表結果值Y以及計數結果值C計算產生解碼結果Z。以下詳細說明各元件及相關操作情形。 FIG. 3 is a schematic diagram of a decoding apparatus according to an embodiment of the invention. The decoding device 1 for locating the absolute code includes a linear feedback shift register 100, a look-up table circuit 102, a counter 104, and a calculation circuit 106. The linear feedback shift register 100 includes n registers, and the n registers load the positioning absolute code X at the first frequency f 1 and perform a shift operation according to the clock signal CLK, and the clock signal CLK has The second frequency f 2 , the second frequency f 2 is not less than the first frequency f 1 . The lookup table circuit 102 correspondingly outputs the lookup result value Y and the table check valid flag VF according to the values stored by the n registers, wherein the table lookup result value Y has k different materials, k≦(2 n -1), The table check valid flag VF indicates whether the check result value Y is valid. The counter 104 performs a reset according to the look-up table valid flag VF, and performs a counting operation based on the clock signal CLK to generate a count result value C. When the look-up table valid flag VF indicates that it is valid, the calculation circuit 106 calculates the generated decoding result Z based on the look-up table result value Y and the count result value C. The components and related operating conditions are described in detail below.

線性回授移位暫存器100包括n個暫存器,暫存器例如可由具有預置(preset)功能的D型正反器(flip flop)實現,線性回授移位暫存器100可藉由預置D型正反器,將光學感測器讀取到的定位絕對碼X載入n個暫存器當中,作為n個暫存器的初始值,定位絕對碼X例如是具有n個位元的信號。此載入定位絕對碼X的動作可以操作於第一頻率f1,例如相關於所需求的光學 量測頻率。舉例而言,對於運動速度20m/s,以10μm週期變換來運算,第一頻率f1可以設定為2MHz,亦即,對於此解碼裝置1,解碼的運算頻寬需大於2MHz。 The linear feedback shift register 100 includes n registers, and the register can be implemented, for example, by a D-type flip flop having a preset function, and the linear feedback shift register 100 can be By presetting the D-type flip-flop, the positioning absolute code X read by the optical sensor is loaded into n registers as the initial value of n registers, and the absolute code X is, for example, n. One bit signal. This action of loading the absolute code X can be operated at a first frequency f 1 , for example in relation to the required optical measurement frequency. For example, for a motion speed of 20 m/s, which is calculated by a 10 μm period conversion, the first frequency f 1 can be set to 2 MHz, that is, for the decoding apparatus 1, the decoded operation bandwidth needs to be greater than 2 MHz.

查表電路102根據n個暫存器儲存的值進行查表,查表電路102內部可以儲存「部分的」線性回授移位暫存器100所序列產生的資料。舉例而言,線性回授移位暫存器100可產生長度為(2n-1)的MLS,則查表電路102可儲存完整的(2n-1)筆資料,或是這(2n-1)筆資料其中的k筆資料所對應的位置資訊,k≦(2n-1)。亦即,當線性回授移位暫存器100載入定位絕對碼X之後,使用定位絕對碼X不一定能從查表電路102找到對應的查表結果,因此查表電路102更包括一輸出接腳查表有效旗標VF,用以指示目前輸出的查表結果值Y是否有效。 The look-up table circuit 102 performs a lookup table based on the values stored in the n registers, and the look-up table circuit 102 can store the data generated by the "partial" linear feedback shift register 100. For example, the linear feedback shift register 100 can generate an MLS of length (2 n -1), and the lookup circuit 102 can store the complete (2 n -1) pen data, or this (2 n -1) The position information corresponding to the k-pen data in the pen data, k≦(2 n -1). That is, after the linear feedback shift register 100 is loaded with the positioning absolute code X, the use of the positioning absolute code X may not be able to find the corresponding look-up result from the look-up table circuit 102, so the look-up table circuit 102 further includes an output. The pin check table valid flag VF is used to indicate whether the currently output check result value Y is valid.

由於查表電路102可以僅存有部分MLS所對應的位置資訊,能夠有效減少查表電路102所需的硬體面積。若定位絕對碼X能夠從查表電路102找到對應的位置資訊時,解碼動作即已完成,可以根據查表結果值Y輸出位置資訊。反之,若定位絕對碼X無法從查表電路102找到對應的位置資訊時,輸出的查表有效旗標VF指示為無效,則計算電路106可以先不輸出結果,解碼動作尚未完成,此時可由線性回授移位暫存器100以及計數器104繼續後續的解碼操作運算。 Since the look-up table circuit 102 can only store the location information corresponding to the partial MLS, the hardware area required for the look-up table circuit 102 can be effectively reduced. If the positioning absolute code X can find the corresponding position information from the look-up table circuit 102, the decoding operation is completed, and the position information can be output according to the table look-up result value Y. On the other hand, if the positioning absolute code X cannot find the corresponding position information from the look-up table circuit 102, and the output table check valid flag VF indicates invalid, the calculation circuit 106 may not output the result first, and the decoding action is not completed yet. The linear feedback shift register 100 and the counter 104 continue the subsequent decoding operation operations.

在查表有效旗標VF指示為無效的情況下,線性回授移位暫存器100可以根據時脈信號CLK進行位移運算,將n個暫存器改變為下一狀態,根據位移運算後的結果再次進行查表,並且可重複進行如此的位移運算,直到在查表電路102成功找到 資料,輸出的查表有效旗標VF指示為有效為止。於此同時,計數器104可以進行計數而得到計數結果值C,以計算在上述的過程中,線性回授移位暫存器100進行了幾次位移運算。此計數結果值C相當於代表從起始的定位絕對碼X,要再經過幾次位移運算後,才可以從查表電路102成功找到對應資料,而找到有效的查表結果值Y。 In the case that the table look-up valid flag VF indication is invalid, the linear feedback shift register 100 can perform a displacement operation according to the clock signal CLK, and change n register registers to the next state, according to the displacement operation. The result is again checked, and such a displacement operation can be repeated until it is successfully found in the lookup circuit 102. Data, the output checklist valid flag VF indication is valid. At the same time, the counter 104 can count to obtain the count result value C to calculate that the linear feedback shift register 100 performs several shift operations in the above process. The result value C of the count is equivalent to representing the absolute code X from the initial position. After several times of displacement operation, the corresponding data can be successfully found from the look-up table circuit 102, and a valid look-up result value Y is found.

亦即,定位絕對碼X所真正對應的位置資料,與查表結果值Y之間,具有的差異量為C。因此,當查表有效旗標VF指示為有效時,計算電路106可以根據查表結果值Y以及計數結果值C,例如是透過加法運算(或是減法運算),將查表結果值Y(或是移位後的查表結果值Y、或是查表結果值Y的倍數)加上計算結果值C以產生解碼結果Z。同時,當查表有效旗標VF指示為有效時,表示此次解碼動作已結束,因此可對計數器104進行重置,例如將計算結果值C歸零,以利於下一次的解碼運算。 That is, the positional data corresponding to the absolute code X and the lookup result value Y have a difference of C. Therefore, when the look-up table valid flag VF indication is valid, the calculation circuit 106 can check the result value Y according to the look-up result value Y and the count result value C, for example, by addition (or subtraction). It is the result of the look-up table Y after the shift, or a multiple of the result Y of the look-up table.) The calculation result value C is added to generate the decoding result Z. Meanwhile, when the look-up table valid flag VF indication is valid, it indicates that the decoding operation has ended, so the counter 104 can be reset, for example, the calculation result value C is zeroed to facilitate the next decoding operation.

如上所述,每一次的解碼動作可能需要線性回授移位暫存器100多次的位移運算以及計數器104多次的累加,因此,線性回授移位暫存器100位移運算以及計數器104累加所根據的時脈信號CLK的第二頻率f2,應大於或等於線性回授移位暫存器100載入定位絕對碼X的第一頻率f1。而第一頻率f1與第二頻率f2的關係,則與查表電路102所存的資料間隔相關,若查表電路102所存的資料在偽隨機序列碼中間隔較遠,則代表可能需要經過較多次的線性回授移位暫存器100位移運算以及計數器104累加,才能成功找到資料,因此應給予第一頻率f1與第二頻率f2較大的差異量;反之,若查表電路102所存的資料較多,彼此在偽 隨機序列碼中間隔較近,則可以給予第一頻率f1與第二頻率f2較小的差異量。同理,亦可以根據查表電路102的操作速度,決定查表電路102應儲存的資料間隔。 As described above, each decoding operation may require linearly shifting the shift register of the shift register 100 multiple times and accumulating the counter 104 multiple times. Therefore, the linear feedback shift register 100 shift operation and the counter 104 accumulate The second frequency f 2 of the clock signal CLK according to it should be greater than or equal to the first frequency f 1 of the linear feedback shift register 100 loaded with the positioning absolute code X. The relationship between the first frequency f 1 and the second frequency f 2 is related to the data interval stored in the look-up table circuit 102. If the data stored in the look-up table circuit 102 is far apart in the pseudo-random sequence code, the representative may need to go through More than one linear feedback shift register 100 shift operation and counter 104 accumulate to successfully find the data, so the difference between the first frequency f 1 and the second frequency f 2 should be given; otherwise, if the table is checked The circuit 102 stores more data, and is closer to each other in the pseudo random sequence code, so that the difference between the first frequency f 1 and the second frequency f 2 can be given. Similarly, the data interval to be stored by the look-up table circuit 102 can also be determined according to the operating speed of the look-up table circuit 102.

舉例而言,若第一頻率f1是2MHz,查表電路102找資料的速度可操作於400MHz,考量實際硬體因素以及安全係數範圍,可以將查表電路102所儲存的資料間隔設定為50~100,即線性回授移位暫存器100可以經過至多50~100次位移運算後,成功在查表電路102找到對應的位置資料。 For example, if the first frequency f 1 is 2 MHz, the speed at which the look-up circuit 102 finds data can be operated at 400 MHz. Considering the actual hardware factor and the safety factor range, the data interval stored by the look-up table circuit 102 can be set to 50. ~100, that is, the linear feedback shift register 100 can successfully find the corresponding position data in the look-up table circuit 102 after up to 50-100 displacement operations.

如第3圖所示的解碼裝置1所使用的解碼方法,可參考第12圖所繪示依照本發明一實施例的解碼方法流程圖,此解碼方法包括下列步驟。步驟S400:提供線性反饋移位暫存器,線性反饋移位暫存器包括n個暫存器,以第一頻率f1載入定位絕對碼X。步驟S402:根據時脈信號CLK以線性反饋移位暫存器進行移位運算,時脈信號CLK具有第二頻率f2,第二頻率f2不小於第一頻率f1。步驟S404:使用查表,根據n個暫存器儲存的值,對應輸出查表結果值Y以及查表有效旗標VF,其中查表結果值Y具有k種不同資料,k≦(2n-1),查表有效旗標VF指示查表結果值Y是否有效。步驟S406:根據時脈信號CLK進行計數運算以產生計數結果值C,其中計數結果值C根據查表有效旗標VF進行重置。步驟S408:當查表有效旗標VF指示為有效時,根據查表結果值Y以及計數結果值C計算產生解碼結果Z。 For the decoding method used by the decoding device 1 shown in FIG. 3, reference may be made to FIG. 12 for a flowchart of a decoding method according to an embodiment of the present invention. The decoding method includes the following steps. Step S400: providing a linear feedback shift register, the linear feedback shift register comprising n registers, loading the positioning absolute code X at the first frequency f 1 . Step S402: Perform a shift operation according to the clock signal CLK in a linear feedback shift register. The clock signal CLK has a second frequency f 2 , and the second frequency f 2 is not less than the first frequency f 1 . Step S404: using the lookup table, according to the values stored by the n registers, correspondingly outputting the lookup result value Y and the table check effective flag VF, wherein the table lookup result value Y has k different materials, k≦(2n-1) ), the table check valid flag VF indicates whether the check result value Y is valid. Step S406: Perform a counting operation according to the clock signal CLK to generate a count result value C, wherein the count result value C is reset according to the look-up table valid flag VF. Step S408: When the table lookup valid flag VF indication is valid, the decoding result Z is generated according to the lookup table result value Y and the count result value C.

使用如第3圖所示的解碼裝置以及第12圖所示的解碼方法,能夠結合LFSR硬體電路小與LUT速度快的優點。由於查表當中可以僅存有部分的資料,因此可以有效節省電路面積, 而對於查表當中未存的部分,則可以使用LFSR進行位移,直到找到資料為止。由於LUT的查表速度通常遠高於光學尺所需的解碼速度需求,因此使用容量較小的LUT,搭配操作需花費較多時間的LFSR,仍可以不致影響到所需的解碼速度,並能夠降低硬體成本。此外,此架構亦使得電路設計更具有彈性,當電路能夠給予的空間較大,則可以給予LUT較大容量,以加快速度;而當解碼速度的需求較為寬鬆,則可以給予LFSR較大長度,以降低LUT所需的電路面積。因此,本揭露的解碼裝置及方法於設計上具有彈性,可適用於多種應用的光學尺。 Using the decoding device shown in FIG. 3 and the decoding method shown in FIG. 12, it is possible to combine the advantages of a small LFSR hardware circuit and a fast LUT speed. Since only some of the data can be stored in the look-up table, the circuit area can be effectively saved. For the part that is not stored in the table, you can use the LFSR to shift until you find the data. Since the lookup speed of the LUT is usually much higher than the decoding speed required by the optical scale, using a LUT with a smaller capacity and a LFSR that takes more time to operate can still not affect the required decoding speed, and can Reduce hardware costs. In addition, this architecture also makes the circuit design more flexible. When the circuit can give a larger space, the LUT can be given a larger capacity to speed up. When the decoding speed is looser, the LFSR can be given a larger length. To reduce the circuit area required for the LUT. Therefore, the decoding device and method of the present disclosure are flexible in design and can be applied to optical scales for various applications.

第4圖繪示依照本發明一實施例的解碼裝置示意圖。與第3圖所示的實施例相較,此例中的解碼裝置2更包括時脈開關電路108。時脈開關電路108可根據原始時脈信號O_CLK及查表有效旗標VF產生閘控時脈信號(gated clock),並以閘控時脈信號作為傳送到線性回授移位暫存器100以及計數器104的時脈信號CLK。此時脈開關電路108可以在查表有效旗標VF指示為有效時(相當於代表解碼已完成),停止時脈輸出,使得時脈信號CLK停止振盪,如此線性回授移位暫存器100不再進行位移,且計數器104亦停止計數,如此更可確保解碼裝置2的運作正確,且由於解碼完成後,線性回授移位暫存器100及計數器104即相當於休息狀態,而能夠達到降低電路功率消耗的優點。 FIG. 4 is a schematic diagram of a decoding apparatus according to an embodiment of the invention. The decoding device 2 in this example further includes a clock switch circuit 108 as compared with the embodiment shown in FIG. The clock switch circuit 108 can generate a gated clock signal according to the original clock signal O_CLK and the table look-up valid flag VF, and transmit the gated clock signal as a gate feedback shift register 100 and The clock signal CLK of the counter 104. At this time, the pulse switch circuit 108 can stop the clock output when the table look-up valid flag VF indication is valid (corresponding to the representative decoding has been completed), so that the clock signal CLK stops oscillating, and thus linearly returns the shift register 100. The displacement is no longer performed, and the counter 104 also stops counting. This ensures that the operation of the decoding device 2 is correct, and since the decoding is completed, the linear feedback shift register 100 and the counter 104 are equivalent to the rest state, and can be achieved. The advantage of reducing circuit power consumption.

在一實施例中,線性回授移位暫存器100可彈性的控制抽頭位置以及編碼位元數,例如線性回授移位暫存器100可根據第一控制資料A改變位元長度,並可根據第二控制資料B改變回授點位置,即改變所使用的多項式。使用如此的線性回授移 位暫存器100,可以用一種讀頭硬體設計,符合多種版本尺身圖案解碼的需求,即以單一硬體同時滿足不同長度、不同解析度的應用需求。LFSR的電路實作可以選擇使用Galois架構或是Fibonacci架構,以下分別說明在這兩種架構之下,相關於彈性控制抽頭位置以及編碼位元數的控制電路實作方式。 In an embodiment, the linear feedback shift register 100 can flexibly control the tap position and the number of encoded bits. For example, the linear feedback shift register 100 can change the bit length according to the first control data A, and The position of the feedback point can be changed according to the second control data B, that is, the polynomial used is changed. Use such a linear feedback transfer The bit register 100 can be designed with a read head hardware, and meets the requirements of multiple versions of the figure pattern decoding, that is, the application requirements of different lengths and different resolutions are simultaneously supported by a single hardware. The LFSR circuit implementation can choose to use the Galois architecture or the Fibonacci architecture. The following describes the implementation of the control circuit related to the elastic control of the tap position and the number of coded bits under the two architectures.

第5A圖繪示依照本發明一實施例的彈性線性回授移位暫存器示意圖,此例中是使用右移的Galois架構,並以n=4作為範例說明。線性回授移位暫存器100_G包括n個暫存器R(1)~R(n)、回授多工器200、(n-1)個運算邏輯電路CalG(1)~CalG(n-1)。回授多工器200具有多個輸入端、一選擇控制端、及一輸出端,其中回授多工器200的選擇控制端耦接第一控制資料A,回授多工器200的多個輸入端分別耦接n個暫存器R(1)~R(n)的輸出端(例如是D型正反器的Q腳位)。第i(1≦i≦n-1)個運算邏輯電路CalG(i)根據第二控制資料B的第i個區段B(i),將第i個暫存器R(i)的輸入端(例如是D型正反器的D腳位)選擇性地耦接至下列接腳的其中之一:回授多工器200的輸出端、第(i+1)個暫存器R(i+1)的輸出端、以及回授多工器200的輸出端與第(i+1)個暫存器R(i+1)的輸出端執行邏輯互斥或(XOR)的運算結果。 FIG. 5A is a schematic diagram of an elastic linear feedback shift register according to an embodiment of the present invention. In this example, a right-shifting Galois architecture is used, and n=4 is taken as an example. The linear feedback shift register 100_G includes n register R(1)~R(n), feedback multiplexer 200, and (n-1) arithmetic logic circuits Cal G (1)~Cal G ( N-1). The feedback multiplexer 200 has a plurality of input terminals, a selection control terminal, and an output terminal, wherein the selection control terminal of the feedback multiplexer 200 is coupled to the first control data A, and the plurality of feedback multiplexers 200 are The input ends are respectively coupled to the output ends of the n register R(1)~R(n) (for example, the Q pin of the D-type flip-flop). The i-th (1≦i≦n-1) arithmetic logic circuit Cal G (i) inputs the i-th register R(i) according to the i-th sector B(i) of the second control data B The terminal (for example, the D pin of the D-type flip-flop) is selectively coupled to one of the following pins: the output of the feedback multiplexer 200, the (i+1)th register R ( The output of i+1) and the output of the feedback multiplexer 200 and the output of the (i+1)th register R(i+1) perform a logical exclusive or (XOR) operation result.

第5B圖繪示如第5A圖當中運算邏輯電路的示意圖,第5B圖所示為一種範例的實作方式,當然本發明並不限於此。在此例中,運算邏輯電路CalG包括多工器210以及XOR閘212。第i個運算邏輯電路CalG(i)的多工器210(i)根據第二控制資料B的第i個區段B(i)(可包括多個位元)從三個輸入中選擇其中一個輸出。 FIG. 5B is a schematic diagram of the arithmetic logic circuit as shown in FIG. 5A, and FIG. 5B is an exemplary implementation manner. Of course, the present invention is not limited thereto. In this example, the operational logic circuit Cal G includes a multiplexer 210 and an XOR gate 212. The multiplexer 210(i) of the i-th operation logic circuit Cal G (i) selects one of three inputs according to the i-th section B(i) of the second control material B (which may include a plurality of bits) An output.

根據第5A圖所示的例子,可以由第二控制資料B而決定每個暫存器的輸入是否直接連接到前一級暫存器,或是有經過回授信號XOR運算的結果,相當於決定LFSR的抽頭位置,即決定了使用的多項式。而第一控制資料A的位元寬度可相關於回授多工器200的輸入數量,以n=4為例,回授多工器200是四對一的多工器,則第一控制資料A可以是2位元的控制信號,以從四個輸入中選擇其中一個輸出,回授多工器200決定從哪一個暫存器作回授,即決定了串聯的暫存器數量。因此,第5A圖所示的線性回授移位暫存器100_G,可根據第一控制資料A改變位元長度,並根據第二控制資料B改變回授點位置。 According to the example shown in FIG. 5A, it can be determined by the second control data B whether the input of each register is directly connected to the previous stage register, or the result of the XOR operation of the feedback signal is equivalent to the decision. The tap position of the LFSR determines the polynomial used. The bit width of the first control data A may be related to the input quantity of the feedback multiplexer 200. Taking n=4 as an example, the feedback multiplexer 200 is a four-to-one multiplexer, and the first control data A can be a 2-bit control signal to select one of the four inputs, and the feedback multiplexer 200 determines which slave register to send back to, which determines the number of registers in series. Therefore, the linear feedback shift register 100_G shown in FIG. 5A can change the bit length according to the first control data A, and change the return point position according to the second control data B.

第6A圖繪示依照本發明一實施例的彈性線性回授移位暫存器示意圖,此例中是使用右移的Fibonacci架構,並以n=4作為範例說明。線性回授移位暫存器100_F包括n個暫存器R(1)~R(n)、(n-1)個運算邏輯電路CalF(1)~CalF(n-1)、(n-2)個切換開關S(1)~S(n-2)。 FIG. 6A is a schematic diagram of an elastic linear feedback shift register according to an embodiment of the present invention. In this example, a right-shifted Fibonacci architecture is used, and n=4 is taken as an example. The linear feedback shift register 100_F includes n register R(1)~R(n), (n-1) arithmetic logic circuits Cal F (1)~Cal F (n-1), (n -2) Switching switches S(1)~S(n-2).

第6B圖繪示如第6A圖運算邏輯電路的示意圖。第i個運算邏輯電路CalF(i)包括多工器310(i)以及邏輯互斥或(XOR)閘312(i),多工器310(i)具有第一輸入端、第二輸入端、控制選擇端、及輸出端,邏輯互斥或閘312(i)具有第一輸入端、第二輸入端、及輸出端,多工器310(i)的第一輸入端耦接邏輯互斥或閘312(i)的輸出端,多工器310(i)的第二輸入端耦接邏輯互斥或閘312(i)的第二輸入端,多工器310(i)的選擇控制端耦接第二控制信號B的第i個區段B(i)(可以是1個位元),邏輯互斥或閘312(i)的第一輸入端耦接第(i+1)個暫存器R(i+1)的輸出端。 FIG. 6B is a schematic diagram of the arithmetic logic circuit as shown in FIG. 6A. The i-th operational logic circuit Cal F (i) includes a multiplexer 310(i) and a logical exclusive OR (XOR) gate 312(i) having a first input and a second input a control mutex or an output terminal, the logic mutex or gate 312(i) has a first input terminal, a second input terminal, and an output terminal, and the first input terminal of the multiplexer 310(i) is coupled to the logic mutual exclusion Or the output of the gate 312(i), the second input of the multiplexer 310(i) is coupled to the second input of the logic mutex or gate 312(i), and the selection control terminal of the multiplexer 310(i) The i-th segment B(i) of the second control signal B (which may be 1 bit) is coupled, and the first input of the logical mutex or gate 312(i) is coupled to the (i+1)th temporary The output of the register R(i+1).

第i個切換開關S(i)根據第一控制資料A的第i個區段A(i)(可以是1個位元),將第(i+1)個暫存器R(i+1)的輸入端選擇性地耦接至下列接腳的其中之一:第(i+2)個暫存器R(i+2)的輸出端,以及第i個運算邏輯電路CalF(i)的多工器310(i)的輸出端。其中若i=1,第i個運算邏輯電路CalF(i)的邏輯互斥或閘312(i)的第二輸入端耦接第i個暫存器R(i)的輸出端;若2≦i≦n-1,第i個運算邏輯電路CalF(i)的邏輯互斥或閘312(i)的第二輸入端耦接第(i-1)個運算邏輯電路CalF(i-1)的多工器的輸出端。 The i-th switch S(i) will be the (i+1)th register R(i+1) according to the i-th segment A(i) of the first control data A (which may be 1 bit) The input terminal is selectively coupled to one of the following pins: the output of the (i+2)th register R(i+2), and the ith operational logic circuit Cal F (i) The output of the multiplexer 310(i). If i=1, the logical input of the i-th operational logic circuit Cal F (i) or the second input of the gate 312(i) is coupled to the output of the i-th register R(i); ≦i≦n-1, the logical mutex of the i-th operation logic circuit Cal F (i) or the second input terminal of the gate 312(i) is coupled to the (i-1)th operation logic circuit Cal F (i- 1) The output of the multiplexer.

根據第6A圖所示的例子,第二控制資料B決定每個暫存器的輸出是否會經過由回授路徑(由運算邏輯電路CalF串聯形成)的XOR運算,相當於決定LFSR的抽頭位置,即決定了使用的多項式。而第一控制資料A可以控制暫存器之間斷開的位置,在何處形成回授,即決定了串聯的暫存器數量。因此,第6A圖所示的線性回授移位暫存器100_F,可根據第一控制資料A改變位元長度,並根據第二控制資料B改變回授點位置。 According to the example shown in FIG. 6A, the second control data B determines whether the output of each register passes an XOR operation by a feedback path (separated by the arithmetic logic circuit Cal F in series), which is equivalent to determining the tap position of the LFSR. That determines the polynomial used. The first control data A can control the position of disconnection between the registers, and where the feedback is formed, which determines the number of registers in series. Therefore, the linear feedback shift register 100_F shown in FIG. 6A can change the bit length according to the first control data A, and change the return point position according to the second control data B.

在Fibonacci架構中,由於運算邏輯電路CalF形成的回授路徑包括多個串聯的XOR閘,成為電路延遲的關鍵路徑(critical path),此計算路徑存在於第一個暫存器與最後一個暫存器之間。相較之下,在Galois架構中,每個暫存器之間至多僅會經過一個運算邏輯電路CalG(包括一個XOR閘),因此關鍵路徑較短,可使得電路操作於較高的頻率。對於有較高速需求的應用,可以選擇使用Galois架構的LFSR。 In the Fibonacci architecture, the feedback path formed by the arithmetic logic circuit Cal F includes a plurality of XOR gates connected in series, which becomes a critical path of the circuit delay, and the calculation path exists in the first register and the last temporary Between the registers. In contrast, in the Galois architecture, there is at most one operational logic circuit Cal G (including an XOR gate) between each register, so the critical path is shorter, allowing the circuit to operate at a higher frequency. For applications with higher speed requirements, you can choose to use the LFSR of the Galois architecture.

以下詳細說明查表電路102所存的資料。第7圖繪示依照本發明一實施例的對LFSR所產生資料序列以固定間隔進 行取樣的示意圖,此處以n=4為例說明,LFSR使用本原多項式序列產生MLS的長度為15(=2n-1),MLS中每一個碼所對應的位置資訊如第7圖所示,是依序由0001排列到1111。而查表電路102可儲存第7圖此表格中的部分內容。舉例而言,查表電路102所儲存的k種資料,是以固定間隔m對(2n-1)個數據取樣而決定。如第7圖所示的例子,此固定間隔m=4,因此查表電路102可以成功找到定位絕對碼{1000}、{0111}、{1101}、{0100}所對應的位置資訊(如第7圖中深色的部分),若是LFSR暫存器的狀態並非屬於這四種,則查表電路102無法成功找到資料,所輸出的查表有效旗標VF會指定為無效。 The data stored in the look-up table circuit 102 will be described in detail below. FIG. 7 is a schematic diagram of sampling a data sequence generated by an LFSR at regular intervals according to an embodiment of the present invention. Here, n=4 is taken as an example to illustrate that the length of the MLS generated by the LFSR using the primitive polynomial sequence is 15 (=2). n -1), the position information corresponding to each code in the MLS is as shown in Fig. 7, which is sequentially arranged from 0001 to 1111. The look-up table circuit 102 can store part of the contents of the table in FIG. For example, the k types of data stored by the lookup table circuit 102 are determined by sampling (2 n -1) data at a fixed interval m. As in the example shown in FIG. 7, the fixed interval m=4, so the lookup table circuit 102 can successfully find the location information corresponding to the positioning absolute codes {1000}, {0111}, {1101}, {0100} (eg, In the dark part of the figure, if the state of the LFSR register does not belong to the four types, the look-up table circuit 102 cannot successfully find the data, and the output table valid flag VF is designated as invalid.

承接第7圖所示的例子,第8圖繪示依照本發明一實施例的查表電路的資料對應關係示意圖。由於查表電路102僅儲存有4筆資料,因此對應的資料不需要儲存全部的位元,在此例中,僅需儲存位置資訊從最高有效位(Most significant bit,MSB)數來的兩個位元,即足以代表4筆不同資料,如第8圖資料欄所示的儲存兩個位元即可。而在執行解碼時,可在讀取查表結果值Y之後,將查表結果值Y左移位2位元,再於最低有效位(Least significant bit,LSB)的兩位元補上01,即可還原原始的位置資訊。 Taking the example shown in FIG. 7, FIG. 8 is a schematic diagram showing the correspondence relationship of the data of the look-up table circuit according to an embodiment of the present invention. Since the look-up table circuit 102 only stores 4 pieces of data, the corresponding data does not need to store all the bits. In this example, only two pieces of position information from the Most Significant Bit (MSB) need to be stored. The bit, which is enough to represent 4 different data, can be stored as shown in the data bar of Figure 8. When performing the decoding, after reading the table lookup result value Y, the table lookup result value Y is shifted to the left by 2 bits, and then the least significant bit (LSB) is added to the 2 bits of the least significant bit (LSB). You can restore your original location information.

在一實施例中,固定間隔m的長度是2p,p為小於n的正整數,如第7圖以及第8圖所示的例子,n=4,p=2。以長度為2p的固定間隔進行取樣的優點為,可以直接截斷靠近LSB的p個位元,如第8圖所示的例子,是直接將第7圖的位置資訊靠近LSB的p個位元截斷。而在解碼還原時,亦可以直接將查表 結果值Y左位移p個位元即可。而截斷p個位元使得原始完整位置資訊所缺少的p個位元資訊,則可以由計數器104補上,亦即計數器104可以是p個位元的計數器,計算電路106可將查表結果值Y左位移p個位元後,加上計數器104所產生的p個位元的計數結果值C,以得到解碼結果Z。 In one embodiment, the fixed interval m has a length of 2 p and p is a positive integer less than n. As in the examples shown in Figures 7 and 8, n = 4, p = 2. The advantage of sampling at a fixed interval of 2 p is that the p bits close to the LSB can be directly truncated. As in the example shown in Fig. 8, the position information of Fig. 7 is directly brought close to the p bits of the LSB. Truncated. In the decoding and restoration, it is also possible to directly shift the result Y of the look-up table to the left by p bits. The p bits are truncated so that the p bit information missing from the original full position information can be complemented by the counter 104, that is, the counter 104 can be a counter of p bits, and the calculation circuit 106 can check the result value of the table. After Y is shifted to the left by p bits, the count result value C of the p bits generated by the counter 104 is added to obtain the decoding result Z.

如第7圖以及第8圖所示的例子,藉由使用固定間隔m=2p進行取樣,可以有效將查表的尺寸縮小為原本的(1/m),所截斷的p個位元越多,查表的尺寸可以越小。舉例而言,對於具有212個刻度的光學尺,可以藉由固定間隔m=24進行取樣,如此查表的尺寸可以縮小為1/16倍,大幅減少電路面積。當然,此處以m等於2的冪次方作為間隔取樣僅為示例性說明,於實作中m也可以是例如10、50、100等等的正整數。執行解碼時,計算電路106可將查表結果值Y乘以m之後,加上計數器104所產生的計數結果值C,以得到解碼結果Z。 As shown in Fig. 7 and Fig. 8, by using a fixed interval m = 2 p for sampling, the size of the look-up table can be effectively reduced to the original (1/m), and the truncated p-bits are more More, the size of the lookup table can be smaller. For example, for an optical scale with 2 12 scales, sampling can be performed by a fixed interval of m=2 4 , so that the size of the look-up table can be reduced to 1/16 times, and the circuit area is greatly reduced. Of course, sampling here with the power of m equal to 2 as an interval is merely an illustrative example, and in practice m may also be a positive integer such as 10, 50, 100, and the like. When the decoding is performed, the calculation circuit 106 may multiply the look-up result value Y by m, and add the count result value C generated by the counter 104 to obtain the decoding result Z.

查表電路102輸出查表結果值Y以及查表有效旗標VF,其電路實作可以有多種方式。舉例而言,查表電路102可以包括判斷電路,當查表電路102根據n個暫存器儲存的值無法成功找到對應的查表資料時,查表結果值Y為一預設輸出值Q,判斷電路可以藉由判斷預設輸出值Q及查表結果值Y是否相等,以產生查表有效旗標VF。在另一實施例中,當查表電路102無法成功找到對應的查表資料時,查表結果值Y可以維持前一個時脈所輸出的查表結果值Y。 The look-up table circuit 102 outputs the look-up result value Y and the look-up table effective flag VF, and the circuit implementation can be implemented in various ways. For example, the look-up table circuit 102 may include a determination circuit. When the look-up table circuit 102 cannot successfully find the corresponding look-up table data according to the values stored by the n registers, the look-up result value Y is a preset output value Q. The judging circuit can generate the table look-up valid flag VF by judging whether the preset output value Q and the look-up table result value Y are equal. In another embodiment, when the look-up table circuit 102 cannot successfully find the corresponding look-up table data, the look-up table result value Y can maintain the look-up result value Y output by the previous clock.

查表電路102可由記憶體電路實作,如第8圖的例子所示,當輸入記憶體的位址時,找到對應的資料。而由於查表 電路102所儲存的資料是經過取樣後的不連續資料,位址資訊並非規則性排列,且輸入的位址位元數與輸出的資料位元數可能不相等,因此在一實施例中,查表電路102可以藉由組合邏輯電路(combinational circuit)實現。 The look-up table circuit 102 can be implemented by a memory circuit. As shown in the example of FIG. 8, when the address of the memory is input, the corresponding data is found. Due to the lookup The data stored in the circuit 102 is the sampled discontinuous data, the address information is not regularly arranged, and the number of input address bits and the number of output data bits may not be equal, so in an embodiment, The table circuit 102 can be implemented by a combinational circuit.

第9圖繪示依照本發明一實施例的查表電路的真值表(truth table)示意圖。此範例是承接第7圖及第8圖,對於取樣的資料(表格中的深色部分),查表有效旗標VF設定為1,查表結果值Y則如同第8圖所示。而對於沒有取樣的資料(表格中的淺色部分),查表有效旗標VF設定為0,查表結果值Y則可以是隨意項x(don’t care term)。如第9圖所示的真值表,是4個輸入與3個輸出(查表結果值Y具有2位元、查表有效旗標VF具有1位元)的對應關係,可以由邏輯合成技術完成相對應的組合邏輯電路,由於具有隨意項x的彈性而能夠達到邏輯閘數量的最佳化。組合邏輯電路沒有記憶效應,可根據當下的輸入決定輸出的結果,並且可以針對特定的查表需求,而完成節省電路面積的硬體實現方式。 FIG. 9 is a schematic diagram of a truth table of a table lookup circuit according to an embodiment of the invention. This example is to take the 7th and 8th pictures. For the sampled data (dark part of the table), the table valid flag VF is set to 1, and the table lookup result value Y is as shown in Fig. 8. For the unsampled data (light color part of the table), the look-up table effective flag VF is set to 0, and the look-up table result value Y may be the don't care term. The truth table shown in Figure 9 is a correspondence between 4 inputs and 3 outputs (the table result value Y has 2 bits, and the table valid flag VF has 1 bit), which can be composed of logic synthesis technology. Completing the corresponding combinational logic circuit, the number of logic gates can be optimized due to the elasticity of the random term x. The combinatorial logic circuit has no memory effect, and can determine the output result according to the current input, and can complete the hardware implementation of saving the circuit area for a specific table lookup requirement.

在一實施例中,查表電路102可以使用可程式邏輯陣列(programmable logic array,PLA)實現,因此可以實現多種輸入(查表位址)與輸出(查表結果值Y及查表有效旗標VF)的對應關係,第10圖繪示依照本發明一實施例的查表電路的電路實作示意圖,PLA可實現多樣化的組合邏輯,可以根據實際的查表內容,控制第10圖範例中的開關切換。 In an embodiment, the look-up table circuit 102 can be implemented using a programmable logic array (PLA), so that multiple inputs (table address) and output can be implemented (check result value Y and table look-up valid flag) Corresponding relationship of VF), FIG. 10 is a schematic diagram showing the circuit implementation of the look-up table circuit according to an embodiment of the present invention. The PLA can implement diverse combinational logic, and can control the example in FIG. 10 according to the actual table lookup content. Switching of the switch.

以下使用一個範例說明本揭露的解碼裝置及方法於時序上的操作情形。第11圖繪示依照本發明一實施例的解碼過程 示意圖。在時間t0時,線性回授移位暫存器100載入的定位絕對碼X是0101,查表電路102無法找到此資料,因此查表有效旗標VF指示為無效,線性回授移位暫存器100進行位移運算,計數器104開始累加。時間t1時,經過位移後的線性回授移位暫存器100儲存的資料為1011,查表電路102仍然無法找到此資料,查表有效旗標VF指示還是無效,此時計數結果值為1。 An example of the operation of the decoding apparatus and method of the present disclosure in timing will be described below using an example. 11 is a diagram showing a decoding process according to an embodiment of the present invention. schematic diagram. At time t0, the positioning absolute code X loaded by the linear feedback shift register 100 is 0101, and the look-up table circuit 102 cannot find the data, so the table valid flag VF indication is invalid, and the linear feedback shift is temporarily suspended. The register 100 performs a displacement operation, and the counter 104 starts to accumulate. At time t1, the data stored in the shifted linear feedback shift register 100 is 1011, and the lookup circuit 102 still cannot find the data, and the table valid flag VF indication is still invalid, and the count result value is 1 at this time. .

時間t2時,再次經過位移後的線性回授移位暫存器100儲存的資料為0111,查表電路102成功找到此資料,對應的查表結果值Y例如是01,此時計數結果值C為2。由於查表有效旗標VF指示為有效,計算電路106可將查表結果值Y左位移2位元(或乘以4),並可補上原本截斷的2位元(“01”),再加上計數結果值C=2,而得到解碼結果Z=0101(01左位移2位元後補上01)+0010(2的二進位表示)=0111。可參考第7圖,當定位絕對碼X=0101時,對應的位置資訊即為0111。 At time t2, the data stored in the linear feedback feedback register 100 after the displacement is 0111 again, and the look-up table circuit 102 successfully finds the data, and the corresponding look-up result value Y is, for example, 01, and the result value C is counted at this time. Is 2. Since the lookup table effective flag VF indication is valid, the calculation circuit 106 can shift the lookup result value Y to the left by 2 bits (or multiply by 4), and can make up the originally truncated 2 bits ("01"), and then Adding the count result value C=2, and obtaining the decoding result Z=0101 (01 left shift 2 bits and then 01) +0010 (binary representation of 2)=0111. Referring to FIG. 7, when the absolute code X=0101 is located, the corresponding position information is 0111.

此時解碼動作已完成,計算電路106已成功輸出解碼結果Z,因此計算電路106可適當控制以使得後續時間的電路動作不再影響輸出結果。而如第4圖所示的實施例,解碼裝置2包括有時脈開關電路108,則可以在時間t3開始時,停止時脈信號振盪,使得線性回授移位暫存器100以及計數器104停止運算,確保電路工作正確,並且能夠減少功率消耗。 At this time, the decoding operation has been completed, and the calculation circuit 106 has successfully output the decoding result Z, so the calculation circuit 106 can be appropriately controlled so that the circuit action at a subsequent time no longer affects the output result. As in the embodiment shown in FIG. 4, the decoding device 2 includes the time-switching circuit 108, and the clock signal oscillation can be stopped at the beginning of time t3, so that the linear feedback shift register 100 and the counter 104 are stopped. The operation ensures that the circuit works correctly and reduces power consumption.

綜上所述,雖然本發明已以多個實施例揭露如上,然其並非用以限定本發明。本發明所屬技術領域中具有通常知識者,在不脫離本發明之精神和範圍內,當可作各種之更動與潤飾。因此,本發明之保護範圍當視後附之申請專利範圍所界定者為 準。 In the above, the present invention has been disclosed in the above embodiments, but it is not intended to limit the present invention. A person skilled in the art can make various changes and modifications without departing from the spirit and scope of the invention. Therefore, the scope of protection of the present invention is defined by the scope of the appended claims. quasi.

Claims (17)

一種定位絕對碼的解碼裝置,該解碼裝置包括:一線性回授移位暫存器,包括n個暫存器,該n個暫存器以一第一頻率載入一定位絕對碼,並根據一時脈信號進行移位運算,該時脈信號具有一第二頻率,該第二頻率不小於該第一頻率;一查表電路,根據該n個暫存器儲存的值,對應輸出一查表結果值以及一查表有效旗標,其中該查表結果值具有k種不同資料,k≦(2n-1),該查表有效旗標指示該查表結果值是否有效;一計數器,根據該查表有效旗標進行重置,並且根據該時脈信號進行計數運算以產生一計數結果值;以及一計算電路,當該查表有效旗標指示為有效時,該計算電路根據該查表結果值以及該計數結果值計算產生一解碼結果。 A decoding device for locating an absolute code, the decoding device comprising: a linear feedback shift register comprising n registers, wherein the n registers load a positioning absolute code at a first frequency, and according to a clock signal is subjected to a shift operation, the clock signal has a second frequency, and the second frequency is not less than the first frequency; a look-up table circuit, according to the value stored by the n register registers, corresponding to the output one look-up table The result value and a table check valid flag, wherein the check result value has k different materials, k ≦ (2 n -1), the check table valid flag indicates whether the check result value is valid; a counter, according to The look-up table valid flag is reset, and a counting operation is performed according to the clock signal to generate a count result value; and a calculating circuit is configured to perform the look-up table according to the look-up table when the look-up table valid flag indication is valid The result value and the count result value calculation yield a decoding result. 如申請專利範圍第1項所述之解碼裝置,更包括一時脈開關電路,該時脈開關電路根據一原始時脈信號及該查表有效旗標產生一閘控時脈信號,並以該閘控時脈信號作為該時脈信號。 The decoding device of claim 1, further comprising a clock switch circuit, wherein the clock switch circuit generates a gated clock signal according to an original clock signal and the look-up table effective flag, and the gate is The clock signal is controlled as the clock signal. 如申請專利範圍第1項所述之解碼裝置,其中該線性回授移位暫存器根據一第一控制資料改變位元長度,根據一第二控制資料改變回授點位置。 The decoding device of claim 1, wherein the linear feedback shift register changes the bit length according to a first control data, and changes the backpoint position according to a second control data. 如申請專利範圍第3項所述之解碼裝置,其中該線性回授移位暫存器更包括:一回授多工器,具有複數個輸入端、一選擇控制端、及一輸出端,其中該回授多工器的該選擇控制端耦接該第一控制資料, 該回授多工器的該複數個輸入端分別耦接該n個暫存器的輸出端;以及(n-1)個運算邏輯電路,其中的第i個運算邏輯電路根據該第二控制資料的第i位元,將第i個暫存器的輸入端選擇性地耦接至下列接腳的其中之一:該回授多工器的該輸出端、第(i+1)個暫存器的輸出端、以及該回授多工器的該輸出端與第(i+1)個暫存器的輸出端執行邏輯互斥或的運算結果。 The decoding device of claim 3, wherein the linear feedback shift register further comprises: a feedback multiplexer having a plurality of inputs, a selection control terminal, and an output terminal, wherein The selection control end of the feedback multiplexer is coupled to the first control data, The plurality of input ends of the feedback multiplexer are respectively coupled to the output ends of the n register registers; and (n-1) operation logic circuits, wherein the ith operation logic circuit is configured according to the second control data The i-th bit selectively couples the input of the i-th register to one of the following pins: the output of the feedback multiplexer, the (i+1)th temporary storage The output of the device, and the output of the feedback multiplexer and the output of the (i+1)th register are logically exclusive or the result of the operation. 如申請專利範圍第3項所述之解碼裝置,其中該線性回授移位暫存器更包括:(n-1)個運算邏輯電路,其中的第i個運算邏輯電路包括一多工器以及一邏輯互斥或閘,該多工器具有一第一輸入端、一第二輸入端、一控制選擇端、及一輸出端,該邏輯互斥或閘具有一第一輸入端、一第二輸入端、及一輸出端,該多工器的該第一輸入端耦接該邏輯互斥或閘的該輸出端,該多工器的該第二輸入端耦接該邏輯互斥或閘的該第二輸入端,該多工器的該選擇控制端耦接該第二控制信號的第i位元,該邏輯互斥或閘的該第一輸入端耦接第(i+1)個暫存器的輸出端;以及(n-2)個切換開關,其中第i個切換開關根據該第一控制資料的第i位元,將第(i+1)個暫存器的輸入端選擇性地耦接至下列接腳的其中之一:第(i+2)個暫存器的輸出端,以及第i個運算邏輯電路的該多工器的該輸出端;其中若i=1,第i個運算邏輯電路的該邏輯互斥或閘的該第二 輸入端耦接第i個暫存器的輸出端,若2≦i≦n-1,第i個運算邏輯電路的該邏輯互斥或閘的該第二輸入端耦接該第(i-1)個運算邏輯電路的該多工器的該輸出端。 The decoding device of claim 3, wherein the linear feedback shift register further comprises: (n-1) operational logic circuits, wherein the i-th operational logic circuit comprises a multiplexer and a logic mutual exclusion or gate, the multiplexer having a first input terminal, a second input terminal, a control selection terminal, and an output terminal, the logic mutual exclusion gate having a first input terminal and a second input The first input end of the multiplexer is coupled to the output end of the logic mutex or the gate, and the second input end of the multiplexer is coupled to the logic mutual exclusion or gate The second input end, the selection control end of the multiplexer is coupled to the i-th bit of the second control signal, and the first input end of the logic mutex or gate is coupled to the (i+1)th temporary storage And an (n-2) switch, wherein the i-th switch selectively selects the input of the (i+1)th register according to the i-th bit of the first control data Coupling to one of the following pins: an output of the (i+2)th register, and the output of the multiplexer of the i-th arithmetic logic circuit; Where i = 1, the logic of the ith operational logic circuit is mutually exclusive or the second of the gate The input end is coupled to the output end of the i-th register, and if 2≦i≦n-1, the logical input of the i-th operational logic circuit or the second input of the gate is coupled to the first (i-1) The output of the multiplexer of the operational logic circuit. 如申請專利範圍第1項所述之解碼裝置,其中該線性回授移位暫存器使用一本原多項式以序列產生(2n-1)個數據,該k種不同資料是根據一固定間隔對該(2n-1)個數據取樣而決定。 The decoding device of claim 1, wherein the linear feedback shift register uses a primitive polynomial to sequentially generate (2 n -1) data, the k different materials being based on a fixed interval This is determined by sampling (2 n -1) data. 如申請專利範圍第6項所述之解碼裝置,其中該固定間隔的長度是2p,p為小於n的正整數。 The decoding device of claim 6, wherein the fixed interval has a length of 2 p and p is a positive integer less than n. 如申請專利範圍第1項所述之解碼裝置,其中該查表電路包括一判斷電路,當該查表電路根據該n個暫存器儲存的值無法成功找到對應的查表資料時,該查表結果值為一預設輸出值,該判斷電路判斷該預設輸出值及該查表結果值是否相等以產生該查表有效旗標。 The decoding device of claim 1, wherein the look-up table circuit comprises a determining circuit, and when the look-up table circuit cannot successfully find the corresponding look-up table data according to the stored values of the n register registers, the checking The result of the table is a preset output value, and the determining circuit determines whether the preset output value and the result of the look-up table are equal to generate the table valid flag. 如申請專利範圍第1項所述之解碼裝置,其中該查表電路是一組合邏輯電路。 The decoding device of claim 1, wherein the look-up circuit is a combinational logic circuit. 如申請專利範圍第1項所述之解碼裝置,其中該計算電路根據該查表結果值及該計數結果值執行加法運算以產生該解碼結果。 The decoding device of claim 1, wherein the calculation circuit performs an addition operation based on the look-up result value and the count result value to generate the decoding result. 一種定位絕對碼的解碼方法,包括:提供一線性回授移位暫存器,包括n個暫存器,該n個暫存器以一第一頻率載入一定位絕對碼;根據一時脈信號以該線性回授移位暫存器進行移位運算,該 時脈信號具有一第二頻率,該第二頻率不小於該第一頻率;使用一查表,根據該n個暫存器儲存的值,對應輸出一查表結果值以及一查表有效旗標,其中該查表結果值具有k種不同資料,k≦(2n-1),該查表有效旗標指示該查表結果值是否有效;根據該時脈信號進行計數運算以產生一計數結果值,其中該計數結果值根據該查表有效旗標進行重置;以及當該查表有效旗標指示為有效時,根據該查表結果值以及該計數結果值計算產生一解碼結果。 A decoding method for locating an absolute code, comprising: providing a linear feedback shift register, comprising n temporary registers, wherein the n registers load a positioning absolute code at a first frequency; according to a clock signal Performing a shift operation by the linear feedback shift register, the clock signal having a second frequency, the second frequency being not less than the first frequency; using a lookup table, storing according to the n registers The value corresponds to the output of a look-up table result value and a look-up table valid flag, wherein the look-up table result value has k different kinds of data, k≦(2 n -1), and the look-up table valid flag indicates the look-up table result value Whether it is valid; performing a counting operation according to the clock signal to generate a count result value, wherein the count result value is reset according to the look-up table valid flag; and when the look-up table valid flag indication is valid, according to the check The table result value and the count result value calculation yield a decoding result. 如申請專利範圍第11項所述之解碼方法,更包括:根據一原始時脈信號及該查表有效旗標產生一閘控時脈信號,並以該閘控時脈信號作為該時脈信號。 The decoding method of claim 11, further comprising: generating a gated clock signal according to an original clock signal and the table valid flag, and using the gate clock signal as the clock signal . 如申請專利範圍第11項所述之解碼方法,更包括:根據一第一控制資料改變該線性回授移位暫存器的位元長度;以及根據一第二控制資料改變該線性回授移位暫存器的回授點位置。 The decoding method of claim 11, further comprising: changing a bit length of the linear feedback shift register according to a first control data; and changing the linear feedback transfer according to a second control data. The location of the callback point of the bit buffer. 如申請專利範圍第11項所述之解碼方法,其中該線性回授移位暫存器使用一本原多項式以序列產生(2n-1)個數據,該k種不同資料是根據一固定間隔對該(2n-1)個數據取樣而決定。 The decoding method of claim 11, wherein the linear feedback shift register uses a primitive polynomial to generate (2 n -1) data in a sequence, the k different materials being based on a fixed interval This is determined by sampling (2 n -1) data. 如申請專利範圍第14項所述之解碼方法,其中該固定間隔的長度是2p,p為小於n的正整數。 The decoding method of claim 14, wherein the fixed interval has a length of 2 p and p is a positive integer less than n. 如申請專利範圍第11項所述之解碼方法,其中當該查表 電路根據該n個暫存器儲存的值無法成功找到對應的查表資料時,該查表結果值為一預設輸出值,該解碼方法更包括判斷該預設輸出值及該查表結果值是否相等以產生該查表有效旗標。 The decoding method as described in claim 11, wherein the lookup table When the circuit cannot successfully find the corresponding lookup table data according to the value stored by the n registers, the result of the lookup table is a preset output value, and the decoding method further comprises determining the preset output value and the result of the lookup table. Whether they are equal to produce the valid flag of the lookup table. 如申請專利範圍第11項所述之解碼方法,其中根據該查表結果值以及該計數結果值計算產生該解碼結果的步驟,是根據該查表結果值及該計數結果值執行加法運算。 The decoding method of claim 11, wherein the step of generating the decoding result according to the table lookup result value and the count result value is performing an addition operation based on the lookup table result value and the count result value.
TW105133434A 2016-04-27 2016-10-17 Decoding device and decoding method for absolute positioning code TWI623200B (en)

Priority Applications (4)

Application Number Priority Date Filing Date Title
US15/395,344 US10243668B2 (en) 2016-04-27 2016-12-30 Positioning measurement device and the method thereof
US15/395,843 US9871595B2 (en) 2016-04-27 2016-12-30 Decoding device and method for absolute positioning code
CN201710288206.2A CN107314743B (en) 2016-04-27 2017-04-27 Positioning sensing device and method
CN201710288921.6A CN107314780B (en) 2016-04-27 2017-04-27 Decoding device and decoding method for positioning absolute code

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
US201662328599P 2016-04-27 2016-04-27
US62/328,599 2016-04-27

Publications (2)

Publication Number Publication Date
TW201739173A TW201739173A (en) 2017-11-01
TWI623200B true TWI623200B (en) 2018-05-01

Family

ID=61022894

Family Applications (2)

Application Number Title Priority Date Filing Date
TW105133434A TWI623200B (en) 2016-04-27 2016-10-17 Decoding device and decoding method for absolute positioning code
TW105134040A TWI659194B (en) 2016-04-27 2016-10-21 Device and method for measuring position

Family Applications After (1)

Application Number Title Priority Date Filing Date
TW105134040A TWI659194B (en) 2016-04-27 2016-10-21 Device and method for measuring position

Country Status (1)

Country Link
TW (2) TWI623200B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI689706B (en) * 2018-12-21 2020-04-01 財團法人工業技術研究院 Processing device for position sensing
US10742183B2 (en) 2018-12-21 2020-08-11 Industrial Technology Research Institute Processing device for position sensing comprising a transforming differential current signal to a voltage signal performance

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5799010A (en) * 1995-06-30 1998-08-25 Interdigital Technology Corporation Code division multiple access (CDMA) communication system
US20030035489A1 (en) * 2001-07-27 2003-02-20 Gorday Paul E. Simple encoding/decoding technique for code position modulation
US20100027597A1 (en) * 2001-05-08 2010-02-04 Qst Holdings, Llc. Method and system for reconfigurable channel coding
US20110099411A1 (en) * 2009-10-22 2011-04-28 Via Technologies, Inc. USB Device and Correction Method Thereof
US20110103432A1 (en) * 2008-10-02 2011-05-05 Texas Instruments Incorporated Enhanced cross correlation detection or mitigation circuits, processes, devices, receivers and systems
US8665208B2 (en) * 2006-09-18 2014-03-04 Pen Laboratory Inc. Product having absolute positioning code pattern on a surface thereof and method for generating absolute positioning code pattern

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5572019A (en) * 1991-03-12 1996-11-05 Canon Kabushiki Kaisha Encoder with varying width light receiver and apparatus having the encoder
JPH09196705A (en) * 1996-01-23 1997-07-31 Mitsutoyo Corp Displacement measuring apparatus
DE10217726A1 (en) * 2002-04-17 2003-11-27 Heidenhain Gmbh Dr Johannes Optical position measuring device
US20070024865A1 (en) * 2005-07-26 2007-02-01 Mitchell Donald K Optical encoder having slanted optical detector elements for harmonic suppression
JP4724495B2 (en) * 2005-08-29 2011-07-13 キヤノン株式会社 Optical encoder
JP5755009B2 (en) * 2011-04-14 2015-07-29 キヤノン株式会社 Encoder

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5799010A (en) * 1995-06-30 1998-08-25 Interdigital Technology Corporation Code division multiple access (CDMA) communication system
US20100027597A1 (en) * 2001-05-08 2010-02-04 Qst Holdings, Llc. Method and system for reconfigurable channel coding
US7809050B2 (en) * 2001-05-08 2010-10-05 Qst Holdings, Llc Method and system for reconfigurable channel coding
US20030035489A1 (en) * 2001-07-27 2003-02-20 Gorday Paul E. Simple encoding/decoding technique for code position modulation
US8665208B2 (en) * 2006-09-18 2014-03-04 Pen Laboratory Inc. Product having absolute positioning code pattern on a surface thereof and method for generating absolute positioning code pattern
US20110103432A1 (en) * 2008-10-02 2011-05-05 Texas Instruments Incorporated Enhanced cross correlation detection or mitigation circuits, processes, devices, receivers and systems
US20110099411A1 (en) * 2009-10-22 2011-04-28 Via Technologies, Inc. USB Device and Correction Method Thereof

Also Published As

Publication number Publication date
TW201739173A (en) 2017-11-01
TW201738533A (en) 2017-11-01
TWI659194B (en) 2019-05-11

Similar Documents

Publication Publication Date Title
CN107314780B (en) Decoding device and decoding method for positioning absolute code
JP3592376B2 (en) Time interval measuring device
US4906992A (en) Single track absolute encoder
TWI623200B (en) Decoding device and decoding method for absolute positioning code
Das et al. A simple approach to design a binary coded absolute shaft encoder
KR950010385B1 (en) Absolute valve encoder
JP6338360B2 (en) Absolute encoder, signal processing method, and program
US6127948A (en) Bidirectional synthesis of pseudorandom sequences for arbitrary encoding resolutions
CN102263555A (en) Method for detecting failure of AD converter via parity forecasting
US8201060B2 (en) Methods and systems for rapid error correction of Reed-Solomon codes
JPH1073681A (en) Time measuring system and its time measuring method
JP3203909B2 (en) A / D converter
JP5481836B2 (en) Counter circuit and counter circuit control method
KR100188147B1 (en) Error detecting circuit used for code
CN1987800A (en) Coding circuit and digital signal processing circuit
Denic et al. Code reading synchronization method for pseudorandom position encoders
KR100954951B1 (en) Counting Circuit and address counter using the same
WO2023028967A1 (en) Absolute position measurement device
JP2665268B2 (en) Step-by-step decoding method and decoder for cyclic code
RU2502121C2 (en) Self-controlled automatic machine
CN109163743B (en) Coding and decoding algorithm of two-dimensional absolute position measuring sensor
CN113686365B (en) Absolute position measuring device
CN112947895B (en) Position reading obtaining method, position reading obtaining device, encoder and storage medium
SU401994A1 (en) DEVICE FOR DETERMINATION OF MINORANT BINARY CODES
JPH02284025A (en) One-track type absolute encoder