TW436690B - Modulo address generating device and method for accessing a ring buffer - Google Patents

Modulo address generating device and method for accessing a ring buffer Download PDF

Info

Publication number
TW436690B
TW436690B TW84105166A TW84105166A TW436690B TW 436690 B TW436690 B TW 436690B TW 84105166 A TW84105166 A TW 84105166A TW 84105166 A TW84105166 A TW 84105166A TW 436690 B TW436690 B TW 436690B
Authority
TW
Taiwan
Prior art keywords
address
offset
circuit
ring buffer
difference
Prior art date
Application number
TW84105166A
Other languages
Chinese (zh)
Inventor
Huang-Jung Chen
Shr-Chang Shiu
Original Assignee
Winbond Electronics 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 Winbond Electronics Corp filed Critical Winbond Electronics Corp
Priority to TW84105166A priority Critical patent/TW436690B/en
Application granted granted Critical
Publication of TW436690B publication Critical patent/TW436690B/en

Links

Landscapes

  • Record Information Processing For Printing (AREA)

Abstract

The present invention provides a device and method for generating a modulo address for accessing a ring buffer. In accordance with the method and device, a buffer length (L), a current access address (A) and a difference magnitude (M) of the current access address and the next access address are input. The difference magnitude (M) can be positive or negative. In the operating process, the current address (A) is first decomposed into a base (B) and an offset (a). Then, based on the length (L) and difference magnitude (M), the present invention generates an absolute offset and a wrap offset. One of these two offsets is added to or combined with the base (B) to generate the next access address. The selection of the offset is determined by one of the two comparison operations. In details, based on the sign of the difference magnitude (M), the absolute offset is compared with a predefined value representing the starting address of the buffer, or the absolute offset is compared with a predefined value representing the ending address of the buffer. In a second embodiment, the selection of the offset to be added to the base (B) is based on a wrap flag produced by the circuit.

Description

經濟部t夹標隼局員工消費合作社印製 Α7 ____5L__ 五、發明説明(I ) 本發明有關一裝置及方法’供產生一模數(modulo)位 址,尤其指存取環式緩衝器的一模數位址產生裝置及方 法。 使用模數位址產生器以存取環式緩衝器的基本概念為 一已知習知的技術,一般而言,一環式緩衝器具有一預定 的長度L。在傳統的環式緩衝器中,其下一個存取位址的 產生是將目前位址A加上差量Μ °當差量Μ被一次次的加 入後,最後其存取位址會超過環式緩衝器終點位置對應的 —位址値。當這種情形發生時’模數定址法會迫使存取位 址自動地折回(wrap)至起點位置。同樣地,如果差量厘為 負,最後其存取位址會小於環式缓衝器起點位置對應的— 位址値。當這種情形發生時’模數定址法會迫使存取位址 自動地折回至終點位置。 模數位址產生法常以軟體方式運作。但以軟體方式產 生模數位址相當慢,且不適合某些運用場合,如數位信號 處理(DSP)應用,因其要求快速的位址產生。模數位址產生 法亦得以硬體方式運作。如美國專利號4,8〇〇524即揭示 —以硬體方式運作的模數位址產生器。 圖不説明- 第一圖為本發明第一實施例電路的邏輯圖。 第二圖為本發明第二實施例電路的邏輯圖。 第二圖揭示採模數位址法存取的一環式緩衝器。 詳細説明: 第一圖揭示本發明的電路100包含暫存器10、12及 14 ; 一起首壹位(leading one)元件 16 ;及(AND)閘 18、 20;反相器22; —選擇器26; —加法器28; —選擇器30 ; 1Printed by the employee ’s consumer cooperative of the t-labelled bureau of the Ministry of Economic Affairs A7 ____5L__ 5. Description of the invention (I) The present invention relates to a device and method 'for generating a modulo address, especially a method for accessing a ring buffer. Device and method for generating analog address. The basic concept of using an analog-to-digital address generator to access a ring buffer is a known and conventional technique. Generally, a ring buffer has a predetermined length L. In the traditional ring buffer, the next access address is generated by adding the current address A plus the difference M ° When the difference M is added again and again, the access address will eventually exceed the ring type The address of the buffer end corresponds to the address 位. When this happens, the 'modulo addressing method will force the access address to wrap automatically to the starting position. Similarly, if the difference is negative, the final access address will be smaller than the address corresponding to the starting position of the ring buffer — address 値. When this happens, the 'modulo addressing method will force the access address to automatically return to the end position. Modulo address generation often operates in software. However, the generation of analog address by software is quite slow, and it is not suitable for some applications, such as digital signal processing (DSP) applications, because it requires fast address generation. The modular address generation method also operates in hardware. For example, U.S. Patent No. 4,800,524 discloses-a modular address generator that operates in hardware. The figure does not explain-the first diagram is a logic diagram of the circuit of the first embodiment of the present invention. The second figure is a logic diagram of a circuit according to a second embodiment of the present invention. The second figure shows a ring buffer accessed by modulo address method. Detailed description: The first figure reveals that the circuit 100 of the present invention includes a register 10, 12 and 14; together a leading one element 16; and (AND) gates 18, 20; an inverter 22;-a selector 26;-adder 28;-selector 30; 1

本紙張尺度遥用中國國家標準(CNS ) A4規格(210X_i^5&quot;T ----------^------ΐτ------^ (請先閲讀背面之注$項再填寫本頁) 經濟部中央標準局員工消費合作社印裝 4 3 66 9 0 A7 __________B7_ 五、發明説明(i ) 一比較器32 ; —加法器34及μ ; 一選擇器38、40及42 ; 一互斥或(exclusive 0R)閘44 ;及一或(0R)閘46。暫存 器10貯存一値A ’其代表環式缓衝器目前存取位址σ暫存 器12貯存一値L ’其代表環式緩衝器的長度。暫存器 貯存一値Μ,其代表下一個存取位置與目前位址a的差量。 差量Μ可正 '可負。上述a、L、Μ値將於下面敘述中配合 第三圖作説明。 第三圖揭示一個環式緩衝器3〇〇 ,其具有一基底位址 値Β及一長度L。對一已知環式緩衝器,其基底位址値β 皆相同。基底位址値Β、長度L、及目前存取位址Α具有下 列屬性: i) 2( n&lt;L&lt; = 2n ’其中n為整數 1〇3二111父2&quot;,其中111,11為整數 iii) B&lt;=A〈(B.L) 在下述例子中,所有的位址及長度皆以二進位代表。 例如,如果長度L為“1 〇〇〇,,(即8),目前位址A為” 1 0 1 〇”, 及差量Μ為+1,則下一個存取位址為α + Μ = ” 1011”且不發生 位址折回動作。如果,長度L為” 1〇〇〇”,目前位址A為” 1000” 而差量Μ為-1,則下一個存取位址為a + M二” 1001”且不發 生位址折回動作。 再者,假設長度L為” 1D00”,目前位址Α為,,1〇1〇”, 而差量Μ為+6,如果將6與目前位址A相加,所得到的存 取位址將會於環式緩衝器之外,亦即存取位址大於最大位 址値(1111 )。因此,必須將所產生的位址値折回環式緩 衝器的起始位置。以目前例子言,當折回動作發生時,下 _2 本紙張;dit用目家( CNS ) ( 210X297公釐) ----------f------^------^ (請先聞讀背面之注意事項再填寫本頁} Α7 Β7 43 66 9 Ο 五、發明说明(3) (請先閱讀背面之注意事項再填寫本頁) 一個被存取的位址為大+ 1*4 = ”1〇1〇”+6-8 = ”1000”。同樣的, 如果長度L為” 1 000”,目前位址値A為” 1 〇 1 (Γ而差量Μ為 -6時,則下一個被存取位址値為WM + L = ” 1 010” + (- 6)+8, 1100”,因為位址已折回至環式緩衝器的終點。 舉一例説明方程式i)、ii)、iii)中n、m、Β的求 法: 假設 L = 1100(即 12)、A = 1000101(即 69)、M = 101(即 5),由方程式i)得n = 4 ’由方程式ii)、iii)得υ = 4、B二 1 0 0 0 0 0 0 (即 6 4)。 下面將説明第一圖中電路100的運作情形。電路1〇〇 執行四個主要功能:(1)它分解目前位址A成B分量値 (component)及a分量植:;(2)它產生一絕對偏移値 (absolute offset)及一折回偏移値(wrap offset): (3) 依據兩個比較動作其中之一,它將兩偏移値其中之一加入 基底位址値B ; (4)它產生一折回旗標。 電路100將目前位址A分解成一基底位址値B及一偏移 値” a”,此偏移値為目前位址A與基底位址B的偏移量。在 所述實施例’ B値及a値兩者皆為14位元寬。但亦可採用 其他不同位元寬度。 經濟部中央標準局員工消費合作社印製 目前位址A的分解方法如下所述。起首壹位元件1 β輸 出一遮罩(mask)信號S,其於低位元為卜而於高位元為〇。 詳言之,遮罩信號S中1値的數量取決於長度値L。在一實 施例中,起首壹位元件1 6可以為一個記憶體,例如一個唯 讀記憶體(ROM),其包含一個索引表,依照輸入l値而產生 輸出值。 本紙張尺度適用中國國家揉準(CNS ) A4規格(210X297公兼)This paper uses China National Standard (CNS) A4 specifications (210X_i ^ 5 &quot; T ---------- ^ ------ ΐτ ------ ^) (Please read the (Note the $ items and then fill out this page) Printed by the Consumer Cooperatives of the Central Standards Bureau of the Ministry of Economic Affairs 4 3 66 9 0 A7 __________B7_ V. Description of the invention (i) A comparator 32;-Adder 34 and μ; A selector 38, 40 And 42; an exclusive OR gate 44; and an OR gate 46. The register 10 stores a 値 A ', which represents the current access address of the ring buffer σ and the register 12 stores One L 'represents the length of the ring buffer. The buffer stores one μM, which represents the difference between the next access position and the current address a. The difference M can be positive or negative. The above a, L M and M will be described in conjunction with the third figure in the following description. The third figure reveals a ring buffer 300, which has a base address ZB and a length L. For a known ring buffer, The base address 値 β is the same. The base address 値 B, the length L, and the current access address A have the following properties: i) 2 (n &lt; L &lt; = 2n ', where n is an integer 103 and 111 2 &quot; of which 1 11,11 is an integer iii) B &lt; = A <(B.L) In the following example, all addresses and lengths are represented by binary. For example, if the length L is “100,” (that is, 8), the current address A is “10 10”, and the difference M is +1, then the next access address is α + M = "1011" and no address reversal action occurs. If the length L is "1000", the current address A is "1000" and the difference M is -1, the next access address is a + M Second, "1001" and no address reversal action occurs. Furthermore, assume that the length L is "1D00", the current address A is, 1010 ", and the difference M is +6, if 6 is compared with the current position Add the address A, and the obtained access address will be outside the ring buffer, that is, the access address is greater than the maximum address 値 (1111). Therefore, the generated address must be folded back to the starting position of the ring buffer. In the current example, when the turn-back action occurs, _2 papers are used; dit uses CNS (210X297 mm) ---------- f ------ ^ --- --- ^ (Please read the precautions on the back before filling in this page} Α7 Β7 43 66 9 Ο V. Description of the invention (3) (Please read the precautions on the back before filling in this page) An accessed bit The address is large + 1 * 4 = "1〇1〇" + 6-8 = "1000". Similarly, if the length L is "1 000", the current address 値 A is "1 〇1 (Γ and the difference When M is -6, the next accessed address is WM + L = ”1 010” + (-6) +8, 1100 ”, because the address has been returned to the end of the ring buffer. For example Explain how to calculate n, m, and B in equations i), ii), and iii): Suppose L = 1100 (that is, 12), A = 1000101 (that is, 69), and M = 101 (that is, 5). = 4 'from equations ii) and iii), υ = 4, and B = 1 0 0 0 0 0 0 0 (that is, 6 4). The operation of the circuit 100 in the first figure will be described below. The circuit 100 performs four main functions: (1) it decomposes the current address A into B components 値 (component) and a component): (2) it generates an absolute offset 値 (absolute offset) and a return offset Wrap offset: (3) According to one of two comparison actions, it adds one of the two offsets 値 to the base address 値 B; (4) It generates a foldback flag. The circuit 100 decomposes the current address A into a base address 値 B and an offset 値 ”a”, and the offset 値 is an offset between the current address A and the base address B. In the embodiment 'B' and a 'both are 14 bits wide. However, other different bit widths can be used. Printed by the Consumers' Cooperative of the Central Bureau of Standards of the Ministry of Economic Affairs. The first one-bit element 1 β outputs a mask signal S, which is BU in the low bit and 0 in the high bit. In detail, the number of 1 値 in the mask signal S depends on the length 値 L. In an embodiment, the first one-bit component 16 may be a memory, such as a read-only memory (ROM), which contains an index table and generates an output value according to the input l 値. This paper size is applicable to China National Standard (CNS) A4 (210X297)

q η ! L I A7 B7 經濟部中央標準局員工消費合作杜印繁 五、發明説明(4) 其詳如下表所示: L=〇〇 0000 0000 0000 則 S:00 0000 0000 0000 L=0〇 0000 0000 0001 則 S二〇〇〇〇〇〇〇〇〇〇〇001 L-00 0000 0000 0010 則 S=00 0000 0000 0001 L=00 0000 0000 0011 則 S=00 0000 0000 0011 L-00 0000 0000 0100 則 S=00 0000 0000 0011 L=00 οοοο 〇〇〇〇 01?? 則 S=00 0000 0000 0111 L=00 0000 0000 1000 則 S=00 0000 0000 0111 L-00 0000 0000 1??? 則 S=00 0000 0000 1111 L=〇〇 0000 0001 0000 則 S=00 0000 0000 1111 L二〇〇〇〇〇〇〇〇〇1 ???? 則 S:0 0 0 0 0 0 0 0 0 1 1 1 1 1 L-0 0 0 0 0 0 0 0 1 0 0 0 0 0 則 S = 0 0 0 0 0 0 0 0 0 1 mi L = 0 0 0 0 0 0 0 0 1 ? ???? 則 S = 0 0 0 0 0 0 0 0 1 1 mi L- 1 0 0 0 0 0 0 0 0 0 0 0 0 0 則 S = 01 1111 1111 mi L=l? ???????? ???? 則 S=ll 1111 1111 1111 在上述的實施例中,以問號?代表的位元不得同時為 例如,如果L,1 Ο Ο Γ (即9 ),遮罩信號S輸出値則為 00 0 000 000 0 1 1 1 1。同理若 L? 1 000 0”(即 1 6 ),則輸出信 號S為00 0000 0000 1111。遮覃信號s及目前位址A同時 為及(AND)閘20的輸入,及閘20輸出偏移値a。偏移値a 是由目前位址A値的最低η位元値所決定,其中 2(n — n&lt;L&lt; = 2n。目前位址Α及遮罩信號s的反相値被輸入至 及閘18,並因而輸出基底位址値B。由方程式ii)可知基 底位址値B的最低η位元皆為0。 以下舉一例説明Β値、a値的求法: 假設 L = 1100,吾人得到 S^llll,故 a = “S 及(AND)A,, 本紙張尺度適用中國國家標準(CMS &gt; A4規格(210X297公釐) —i .—I— I i L· n i -i ^ (請先閲蹟背面之注意事項再填寫本頁) 4 3 66 9 0 A7 B7 經濟部中央標率局員工消費合作社印«. 五、發明説明(5)二“0001 1 1 1 及 ΙΟΟΟΙΟΙΊΟΟΟΙΟΙ”,且 B = “N〇T(S)及 A” =“1110 0 0 0 及 1000101,’ =“1〇〇〇〇〇〇” 本發明產生一絕對偏移値(a + Μ)及一折回偏-移-値 U + M + -L)。加法器34產生絕對偏移値(a + M)。選擇器26具 有一第一輸入端輸入由反相器22送來的反相L値,以及一 第二輸入端輸入L値。依據一差量Μ的正、負位元信號24, 選擇器26分別選擇其第一輸入或第二輸入。在所述實施例 中’ Μ是以2 -補數(2‘s-complement)型式貯存,但亦可採 用其他適宜型式貯存。如果Μ為負値,信號24為”1”,而 如果.Μ為正値,則信號2 4為” 0 ”。因此,當Μ為正値時,選 擇器26輸出負L値,當Μ為負値時,輸出正L値。 加法器28的一第一輸入信號為選擇器26的輸出,一第 二輸入信號為差量Μ。因此,當Μ為正値時,加法器28的 輸出Κ信號為M-L,當Μ為負時,輸出Κ信號為K + L。加法 器36的第一輸入信號為偏移値a,一第二輸入信號為加法 器28的輸出K信號。因此,當Μ為正値時,加法器36輸出 折回偏移値(a + M-L),當Μ為負値時,輸出a + M + L。 當Μ為負時,選擇器30輸出”0”,當Μ為正時,選擇器 30輸出長度L。比較器32比較一第一及第二輸入,並於第 一輸入小於第二輸入時輸出”Γ (眞)。因選擇器30的輸出 取決於Μ之正負,因此比較器32之動作亦取決於Μ的正負。 詳言之,當Μ為負,比較器32比較”〇”與(a + Μ)。因此, 當Μ為負且0&lt;(a + M),比較器32輸出” Γ。此相當於:當(a + M) 的絕對偏移値導致環式緩衝器界限内的一個位址時,比較 器3 2輸出” Γ。因此,當ΪΙ為正時,比較器32比較” L,,與 5 本紙張尺度適用中圉國家標準(CNS ) A4規格(21〇X297公釐) (請先閲讀背面之注項再填寫本頁) -搫.q η! LI A7 B7 Consumption cooperation between employees of the Central Bureau of Standards of the Ministry of Economic Affairs Du Yinfan 5. Description of the invention (4) The details are shown in the following table: L = 〇〇0000 0000 0000 Then S: 00 0000 0000 0000 L = 0〇0000 0000 0001 S S 200000 00 00 00 00 001 L-00 0000 0000 0010 S = 00 0000 0000 0001 L = 00 0000 0000 0011 S = 00 0000 0000 0011 L-00 0000 0000 0100 S = 00 0000 0000 0011 L = 00 οοοο 〇〇〇〇01 ?? Then S = 00 0000 0000 0111 L = 00 0000 0000 1000 Then S = 00 0000 0000 0111 L-00 0000 0000 1 ??? Then S = 00 0000 0000 1111 L = 〇〇0000 0001 0000 then S = 00 0000 0000 1111 L L-0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 then S = 0 0 0 0 0 0 0 0 0 1 mi L = 0 0 0 0 0 0 0 1 ???? then S = 0 0 0 0 0 0 0 0 1 1 mi L- 1 0 0 0 0 0 0 0 0 0 0 0 0 0 Then S = 01 1111 1111 mi L = l? ???????? ???? Then S = ll 1111 1111 1111 In the above embodiment, a question mark? The representative bit must not be at the same time. For example, if L, 1 〇 Ο Γ (that is, 9), the output of the mask signal S is then 0 0 0 0 0 0 0 0 0 1 1 1 1. Similarly, if L? 1 000 0 ”(that is, 16), the output signal S is 00 0000 0000 1111. The cover signal s and the current address A are both inputs of the AND gate 20, and the gate 20 output bias. Shift 値 a. The offset 値 a is determined by the lowest n bit 値 of the current address A 其中, where 2 (n — n &lt; L &lt; = 2n. The inverse 値 of the current address A and the mask signal s is Input to the AND gate 18, and thus output the base address 値 B. From equation ii), it can be known that the lowest n bits of the base address 値 B are all 0. The following is an example to explain the calculation of B 値 and a 値: Suppose L = 1100 , I get S ^ llll, so a = "S and (AND) A, this paper size applies the Chinese national standard (CMS &gt; A4 specification (210X297 mm) —i. —I— I i L · ni -i ^ (Please read the notes on the back of the trace before filling out this page) 4 3 66 9 0 A7 B7 Printed by the Consumer Cooperative of the Central Standards Bureau of the Ministry of Economic Affairs «. V. Description of the invention (5) II" 0001 1 1 1 and ΙΟΟΙΙΙΙΟΟΟΙΙΙ " And B = "NOT (S) and A" = "1110 0 0 and 1000 101, '=" 100 000 000 "The present invention generates an absolute offset 値 (a + M) and a fold Offset-shift- 値 U + M + -L). The adder 34 generates an absolute offset 値 (a + M). The selector 26 has a first input terminal that receives the inverse L 値 from the inverter 22 And a second input terminal input L 値. Based on a positive and negative bit signal 24 of a difference M, the selector 26 selects its first input or second input respectively. In the embodiment, 'M is 2 -2's-complement type storage, but other suitable types of storage can also be used. If M is negative, signal 24 is "1", and if .M is positive, signal 24 is "0" Therefore, when M is positive 値, selector 26 outputs negative L 値, and when M is negative ,, it outputs positive L 値. A first input signal of adder 28 is the output of selector 26 and a second The input signal is the difference M. Therefore, when M is positive, the output K signal of the adder 28 is ML, and when M is negative, the output K signal is K + L. The first input signal of the adder 36 is biased. Shift a, a second input signal is the output K signal of the adder 28. Therefore, when M is positive ,, the adder 36 outputs a rollback offset 値 (a + ML), and when M is negative 値When M is negative, the selector 30 outputs "0". When M is positive, the selector 30 outputs the length L. The comparator 32 compares a first and a second input, and When the first input is smaller than the second input, "Γ (眞) is output. Since the output of the selector 30 depends on the sign of M, the operation of the comparator 32 also depends on the sign of M. In detail, when M is negative, the comparator 32 compares "0" with (a + M). Therefore, when M is negative and 0 &lt; (a + M), the comparator 32 outputs “Γ. This is equivalent to: when the absolute offset of (a + M) 値 causes an address within the limit of the ring buffer, Comparator 3 2 outputs “Γ”. Therefore, when ΪΙ is positive, the comparator 32 compares "L," and 5 paper sizes to apply the Chinese National Standard (CNS) A4 specification (21 × 297 mm) (Please read the note on the back before filling this page. )-搫.

、1T 線 A7 B7 五、發明説明(&amp; ) (a + M)。因此,當μ為正且L&lt;(a + M),比較器32輸出” Γ。 此相當於:當(a + (j)的絕對偏移値導致環式緩衝器界限外的 一個位址時,比較器32輸出”1”。 依據比較器32的輸出C及Μ値正、負,選擇器38、40 及42運作以決定偏移値na。偏移値na可能為絕對偏移値 或折回偏移値兩者其中之一。比較器32的輸出C由選擇信 號線33輸入至選擇器42,其輸出偏移値na。信號24,代 表Μ的正負,輸入至選擇器38。信號24的反相値則輸入至 選擇器40。選擇器38、40及42的運作摘述如下表: Μ的正負 比較 輸出C 偏移na (負二1,正二〇) 1 0&lt;(a+M) 1 0&lt;(a+M) 〇 L&lt;(a+M) 〇 L&lt;(a+M) 眞偽偽眞 Γν /IV /fv ^ίν 1 ο ο 1, 1T line A7 B7 5. &amp; Invention Description (a + M). Therefore, when μ is positive and L &lt; (a + M), the comparator 32 outputs "Γ. This is equivalent to: when (a + (j) 's absolute offset 値 results in an address outside the limit of the ring buffer The comparator 32 outputs "1". Depending on whether the outputs C and M of the comparator 32 are positive or negative, the selectors 38, 40, and 42 operate to determine the offset 値 na. The offset 値 na may be an absolute offset 折 or a return Offset 之一 One of the two. The output C of the comparator 32 is input to the selector 42 through the selection signal line 33, and its output is offset 値 na. The signal 24, which represents the sign of M, is input to the selector 38. The inverting input is input to the selector 40. The operations of the selectors 38, 40, and 42 are summarized in the following table: Positive and negative comparison output C of the offset C (negative two 1, positive two) 1 0 &lt; (a + M) 1 0 &lt; (a + M) 〇L &lt; (a + M) 〇L &lt; (a + M) 眞 False pseudo 眞 Γν / IV / fv ^ ίν 1 ο ο 1

a + M a + Μ + L a + M a + M — L ----------梦-- (請先閲讀背面之注意Ϋ項再填寫本頁) 經濟部中央標準局負工消費合作社印製 如表所示,輸出C並不指明絕對偏移値是否會產生一 個界限内的位址。同理,輸出C亦不直接指明絕對偏移値 或折回偏移値是否被採用為偏移値na。依據Μ値正負號, 輸出C的意義才被確認。或(〇R)閘4 6將基底位址Β與偏移 値na相加以產生一個下一個存取位址於信號線48上。此 信號線48之値由信號線50貯存於A暫存器10,成為新的 目前位址。 互斥或(Exclusive OR)閘44輸入一第一輸入信號c及 一第二輸入信號24。互斥或閘44的輸出代表下一個位址 線 本紙張尺度適用中國國家標準(CNS ) A4規格(210X297公嫠) ^3669 0 A7 B7 五、發明説明( 產生過程是否發生折回。因此,如果折回發生,間44於信 號49上輸出1 ’如果未發生’閘44於信號49上輸出,,〇”。 此信號49之値可被其他未示於第—圖中的元件所使用。 本發明亦可以軟體、韌體或類似方式實施D其較佳實 施方式為將軟體存在唯讀(R〇U)或隨機存取記憶雜(Mm) 中,並由一般用途電腦的中央處理器執行,或是由特殊用 途的電腦系統的中央處理器執行。以軟體運作時,則以下 列虛擬(pseudo)指令碼來説明: Break A into B and a if M&lt;0 then i f (a + M&gt; = 0) then na=a+M else na=a+M+L else if (a+M&gt;=L) then elsea + M a + Μ + L a + M a + M — L ---------- Dream-(Please read the note on the back before filling this page) Consumption cooperatives printed as shown in the table, the output C does not indicate whether the absolute offset 値 will produce an address within the bounds. Similarly, the output C does not directly indicate whether the absolute offset 値 or the rollback offset 値 is adopted as the offset 値 na. According to the sign of Μ, the meaning of output C is confirmed. The OR gate 46 adds the base address B and the offset 値 na to generate a next access address on the signal line 48. The signal line 48 is stored in the A register 10 by the signal line 50 and becomes the new current address. The exclusive OR gate 44 inputs a first input signal c and a second input signal 24. The output of the mutex OR gate 44 represents the next address line. The paper size applies the Chinese National Standard (CNS) A4 specification (210X297). ^ 3669 0 A7 B7 V. Description of the invention (Whether the return process occurs. Therefore, if the return Occurrence, the time 44 outputs 1 on the signal 49 'if it does not occur' the gate 44 is output on the signal 49, 0. "This signal 49 can be used by other components not shown in the figure-the present invention also It can be implemented in software, firmware, or similar methods. The preferred embodiment is to store the software in read-only (ROM) or random-access memory (Mm) and run by the central processing unit of a general-purpose computer, or It is executed by the central processing unit of a special-purpose computer system. When operating in software, it is explained by the following pseudo script: Break A into B and a if M &lt; 0 then if (a + M &gt; = 0) then na = a + M else na = a + M + L else if (a + M &gt; = L) then else

na=a+M-L na=a+M I---------^-- (請先閲讀背面之注$項再填寫本X ) 經濟部中央榇準局員工消費合作社印製na = a + M-L na = a + M I --------- ^-(Please read the note on the back before filling in this X) Printed by the Consumers' Cooperative of the Central Bureau of Standards, Ministry of Economic Affairs

Next—A二na+B Wrap=sign—bit xor C 如熟習本行業者所知悉,上述虛擬碼的流程相當於第 一圖電路的運作。 第二圖揭示本發明的電路200包含暫存器210、212 及214 :—起首壹位元件216 ;及(AND)閘218、220 :反 相器222 ;—選擇器226 ; —加法器228 ; —加法器234及 if 本紙張Wit咐賴家料(CNS) Qx 297公着) 4366 9 ο Α7 Β7__ 五、發明説明(8) 236 ; —選擇器260、262 ;或閘246。暫存器210貯存一 値A,其代表環式緩衝器目前存取位址。暫存器212貯存 一値L,其代表環式缓衝器的長度。暫存器214貯存一値Μ, 其代表下一個存取位置與目前位址Α的差量。差量Μ可正、 可負。上述A' L、Μ値將於下述兩段中配合第三圖作說 明。 下面將説明第一圖中電路200的運作情形。電路200 執行四個主要功能:(1)它分解目前位址Α成Β分量値 (component)及a分量値;(2)它產生一絕對偏移値及一折 回偏移値;(3)它產生一折回旗標;(4)依據折回旗標, 它將兩偏移値其中之一加入基底位址値B。第二圖中一些 元件運作情形與第一圖中者對應元件相同,其相關運作將 不再重複説明。 本發明第二實施例包含一個產生折回旗標264的電 路。當差量Μ為負時,如發生折回,加法器234的進位位 元270値為”1”,此因加法器234發生欠位(under f low)現 象。如沒發生折回,加法器234不造成欠位,而進位位元 270具有値。當Μ為正時,如發生折回,加法器236的 進位位元2 7 2具” 0 ”値,此因未發生欠位。如不發生折回, 加法器236造成欠位,因此進位位元272具”1”値。進位位 元信號272在輸入選擇器260前先作反相位操作。 當Μ為正時,Μ正、負信號224具” 0”値,當Μ為負時, Μ正、負信號224具” Γ値。依照Μ的正或負,選擇器260 選擇進位位元270及反相値272兩者其中之一,而成為折 回旗標264。因此,折回旗標264指示應採用折回偏移値 8_ 本紙張尺度逍用中國國家標率(CNS ) Α4规格(210X297^7 ---------^------1Τ------^ (請先Μ讀背面之注意事項再填寫本頁) 經濟部中央標隼局員工消費合作社印製 4366 9 Ο Α7 Β7__ 五、發明説明(巧) 或採用絕對偏移値。依折回旗標264,選擇器262選擇輸 出絕對偏移値、或折回偏移値至或(OR)閘246,供與基底 値B相加。 本發明亦可以軟體、韌體或類似方式實施◦其較佳實施 方式為將軟體貯存在唯讀(ROM)或隨機存取記憶體(ram) 中’並由一般用途電腦的中央處理器執行,或是由特殊用 途的電腦系統的中央處理器執行。以軟體運作時,則以下 列虛擬(pseudo)指令碼來説明:Next—A + na + B Wrap = sign—bit xor C As those familiar with this industry know, the process of the above virtual code is equivalent to the operation of the circuit in the first figure. The second figure reveals that the circuit 200 of the present invention includes a register 210, 212, and 214:-the first one-bit element 216; and (AND) gates 218, 220: an inverter 222;-a selector 226;-an adder 228 -Adder 234 and if this paper Wit instructs Lai Family Materials (CNS) Qx 297 (publication) 4366 9 ο Α7 Β7__ 5. Description of the invention (8) 236;-Selectors 260, 262; or gate 246. The register 210 stores a 値 A, which represents the current access address of the ring buffer. The register 212 stores one L, which represents the length of the ring buffer. The register 214 stores a μM, which represents the difference between the next access location and the current address A. The difference M can be positive or negative. The above A 'L and M 値 will be explained in conjunction with the third figure in the following two paragraphs. The operation of the circuit 200 in the first figure will be described below. The circuit 200 performs four main functions: (1) it decomposes the current address A into B components 値 (component) and a component 値; (2) it generates an absolute offset 値 and a folded-back offset 値; (3) it A foldback flag is generated; (4) According to the foldback flag, it adds one of the two offsets 値 to the base address 値 B. The operation of some components in the second diagram is the same as that of the corresponding components in the first diagram, and their related operations will not be repeated. A second embodiment of the present invention includes a circuit that generates a retrace flag 264. When the difference M is negative, if a foldback occurs, the carry bit 270 'of the adder 234 is "1". This is because the adder 234 is underflow. If no turn-back occurs, the adder 234 does not cause an underrun, and the carry bit 270 has 値. When M is positive, if a turn-back occurs, the carry bit 272 of the adder 236 has "0", because no underrun occurs. If no foldback occurs, the adder 236 causes an underbit, so the carry bit 272 has "1". The carry bit signal 272 is subjected to an inverse phase operation before being input to the selector 260. When M is positive, M positive and negative signals 224 have “0” 値, and when M is negative, M positive and negative signals 224 have “Γ”. Depending on whether M is positive or negative, selector 260 selects the carry bit 270. And inverse 値 272, which becomes the retracement flag 264. Therefore, the retracement flag 264 indicates that the retracement offset should be adopted 逍 8_ This paper is scaled to the Chinese National Standard (CNS) Α4 size (210X297 ^ 7 --------- ^ ------ 1Τ ------ ^ (Please read the precautions on the back before filling out this page) Printed by the Staff Consumer Cooperative of the Central Bureau of Standards of the Ministry of Economic Affairs 4366 9 〇 Α7 Β7__ 5. Description of the invention (Clever) Or use absolute offset 値. According to the return flag 264, the selector 262 selects to output the absolute offset 値, or the return offset 値 to the OR gate 246 for the base. Add B. The present invention can also be implemented in software, firmware or similar methods. The preferred embodiment is to store the software in read-only (ROM) or random access memory (ram) ' The CPU is executed by the central processing unit of a special-purpose computer system. When running by software, the following virtual (p seudo) instruction code to explain:

Break A into B and a if M&lt;0 then if (a+M &lt; 0) thenBreak A into B and a if M &lt; 0 then if (a + M &lt; 0) then

wrap=1 na= a+M+L elsewrap = 1 na = a + M + L else

wrap二0 na = a + M else if (a+M_L〈 0) then wrap = 0wrap two 0 na = a + M else if (a + M_L <0) then wrap = 0

na:a+M elsena: a + M else

wrap=l na= a+M-Lwrap = l na = a + M-L

Next—A=na+B 如熟習本行業者所知悉,上述虚擬碼的流程相當於第 二圖電路的運作。 本紙張尺度適用中國國家揉準(CNS ) Α4規格(210X297公釐) ----------^------tr------♦ (請先聞讀背面之注意事項再填寫本夏) 經濟部中央標準局員Η消費合作社印製Next—A = na + B As the person familiar with this industry knows, the above virtual code flow is equivalent to the operation of the circuit in the second figure. This paper size applies to China National Standard (CNS) Α4 specification (210X297 mm) ---------- ^ ------ tr ------ ♦ (Please read the (Notes need to be filled in this summer) Printed by the Central Standards Bureau of the Ministry of Economic Affairs and Consumer Cooperatives

Claims (1)

充 ^ 6 3 4 Ο 8 〇0 88 ABICD 經濟部智慧財產局員工消費合作社印製 六、申請專利範圍 專利範圍修正本( 2000/9 / 1 ) 1·—種用以存取環式緩衝器的下一個位址產生裝 置,包含: 一電路,供貯存環式緩衝器的一長度L; 一電路,供貯存環式緩衝器的一目前位址A; 一電路,供貯存目前位址A及下一個欲產生位址間的差 量Μ ; _分解電路,供將目前位址Α分解成一基底位址B及距 離此基底位址的偏移値a,該分解電路包含一起首壹位元 件,其以L値爲一輸入信號,供輸出一遮罩信號S,此遮 罩信號於其最低(n-I)位元具有&quot;K値,其中2s·1 &lt; LS 2&quot;; 一電路,依照長度L及差量Μ,決定一絕對偏移値; 一電路,依照長度L及差量Μ,決定一折回偏移値: 第一比較電路,其於差量Μ爲負値時運作,供決定該絕 對偏移値是否產生位於環式緩衝器內的一位址; 第二比較電路,其於差量Μ爲正値時運作,供決定該絕 對偏移値是否產生位於環式緩衝器之外的一位址; 加法電路,依照第一及第二比較電路兩者中其一而運 作,供將基底位址値Β加上絕對偏移値、折回偏移値兩者 其中之一,以產生所述下一個位址。 2. 如申請專利範圍第1項所述之裝置,其中分解電 路進一步包含一邏輯閘,其與貯存Α値之電路連結,並與 起首壹位元件連結,輸出偏移値a 3. 如申請專利範圔第1項所述之裝置,其中分解電 路進一步包含一邏輯閘,其與貯存A値之電路連結,並與 本紙張尺度適用中國國家標準(CNS)A4規格(210 X 297公釐) ------------· --------訂---------線 {請先閱讀背面之注意事項再填寫本頁) 43 66 9 0 頜 C8 D8 六、申請專利範圍 起首壹位元件連結,輸出基底値B。 (請先閱讀背面之;i意事項再填寫本頁) -^---------訂·--------~ 經濟部智慧財產局員工消費合作社印製 本紙張尺度適用中國國家標準(CNS)A4規格(210 X 297公釐)Charge ^ 6 3 4 〇 8 〇 0 88 ABICD Printed by the Consumer Cooperatives of the Intellectual Property Bureau of the Ministry of Economic Affairs 6. Application for Patent Scope Amendment of Patent Scope (2000/9 / 1) 1 · —A kind of access to ring buffer The next address generating device includes: a circuit for storing a length L of the ring buffer; a circuit for storing a current address A of the ring buffer; a circuit for storing the current address A and the next A decomposing circuit to generate the difference between addresses; _ decomposition circuit for decomposing the current address A into a base address B and an offset 値 a from the base address, the decomposition circuit includes a first-bit component, which Take L 値 as an input signal for outputting a mask signal S. This mask signal has &quot; K 値 in its lowest (nI) bit, where 2s · 1 &lt; LS 2 &quot;; a circuit according to the length L And the difference M to determine an absolute offset 値; a circuit to determine a folding offset 依照 according to the length L and the difference M: a first comparison circuit that operates when the difference M is negative 供 for determining the absolute Whether the offset 产生 produces a single bit address in the ring buffer; Circuit, which operates when the difference M is positive, for determining whether the absolute offset 产生 generates a bit address outside the ring buffer; the addition circuit, according to one of the first and second comparison circuits It operates for adding one of the base address 値 B to the absolute offset 値 and the folded-back offset 产生 to generate the next address. 2. The device as described in item 1 of the scope of the patent application, wherein the decomposition circuit further includes a logic gate, which is connected to the circuit storing Α ,, and is connected to the first-order component, and outputs an offset 値 a 3. If applied The device described in the first paragraph of the patent specification, wherein the decomposition circuit further includes a logic gate, which is connected to the circuit storing the A 适用, and applies the Chinese National Standard (CNS) A4 specification (210 X 297 mm) to this paper size. ------------ · -------- Order --------- Line {Please read the notes on the back before filling this page) 43 66 9 0 Jaw C8 D8 6. The scope of patent application starts from the first-bit component connection, and the output base 値 B. (Please read the back of the page; I will fill in this page first)-^ --------- Order · -------- ~ Printed paper scale Applicable to China National Standard (CNS) A4 (210 X 297 mm)
TW84105166A 1995-05-23 1995-05-23 Modulo address generating device and method for accessing a ring buffer TW436690B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW84105166A TW436690B (en) 1995-05-23 1995-05-23 Modulo address generating device and method for accessing a ring buffer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW84105166A TW436690B (en) 1995-05-23 1995-05-23 Modulo address generating device and method for accessing a ring buffer

Publications (1)

Publication Number Publication Date
TW436690B true TW436690B (en) 2001-05-28

Family

ID=21624810

Family Applications (1)

Application Number Title Priority Date Filing Date
TW84105166A TW436690B (en) 1995-05-23 1995-05-23 Modulo address generating device and method for accessing a ring buffer

Country Status (1)

Country Link
TW (1) TW436690B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113778520A (en) * 2021-09-09 2021-12-10 海光信息技术股份有限公司 Offset prefetch method, apparatus for performing offset prefetch, computing device, and medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113778520A (en) * 2021-09-09 2021-12-10 海光信息技术股份有限公司 Offset prefetch method, apparatus for performing offset prefetch, computing device, and medium

Similar Documents

Publication Publication Date Title
US5918252A (en) Apparatus and method for generating a modulo address
US8612651B2 (en) FIFO buffer
TW513859B (en) Modulo address generator circuit
JPH0357500B2 (en)
Drucker Exceptional Lie algebras and the structure of Hermitian symmetric spaces
TW436690B (en) Modulo address generating device and method for accessing a ring buffer
Guralnick¹ et al. Monodromy groups of polynomials
KR100434502B1 (en) Data extraction/insertion method for digital signal processor and device thereof
Common et al. The symmetric strong moment problem
O'Keefe et al. Ovoids with a pencil of translation ovals
Ramírez et al. Implementation of RNS-based distributed arithmetic discrete wavelet transform architectures using field-programmable logic
Marovich Faster MPEG-1 layer III audio decoding
Szekeres On the number of divisors of x2+ x+ A
JP2932714B2 (en) Address generator
TW317626B (en) Address calculating method of program counter and device thereof
TW293907B (en) Self-timer address locking and data latching circuit
Max Cayley numbers or alternative division algebras
KR940002692A (en) Interpolation circuit of tablet board
US6012078A (en) Calculation unit
KR940017139A (en) Digital Sine Wave Generator
Tan et al. Substitutions with cofinal fixed points
TW320795B (en) Appendix 1 of method for re-utilization of faulty RAM
JP2809635B2 (en) Image data processing device
DENNY II A LINEAR RIEMANN-STIELTJES INTEGRAL-EQUATION SYSTEM.
Konecný Real functions incrementally computable by finite automatons

Legal Events

Date Code Title Description
GD4A Issue of patent certificate for granted invention patent
MM4A Annulment or lapse of patent due to non-payment of fees