JP4374363B2 - ビットフィールド操作回路 - Google Patents
ビットフィールド操作回路 Download PDFInfo
- Publication number
- JP4374363B2 JP4374363B2 JP2006260613A JP2006260613A JP4374363B2 JP 4374363 B2 JP4374363 B2 JP 4374363B2 JP 2006260613 A JP2006260613 A JP 2006260613A JP 2006260613 A JP2006260613 A JP 2006260613A JP 4374363 B2 JP4374363 B2 JP 4374363B2
- Authority
- JP
- Japan
- Prior art keywords
- data
- bit
- offset
- mask
- amount
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F7/00—Methods or arrangements for processing data by operating upon the order or content of the data handled
- G06F7/76—Arrangements for rearranging, permuting or selecting data according to predetermined rules, independently of the content of the data
- G06F7/764—Masking
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F7/00—Methods or arrangements for processing data by operating upon the order or content of the data handled
- G06F7/38—Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation
- G06F7/48—Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation using non-contact-making devices, e.g. tube, solid state device; using unspecified devices
- G06F7/57—Arithmetic logic units [ALU], i.e. arrangements or devices for performing two or more of the operations covered by groups G06F7/483 – G06F7/556 or for performing logical operations
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F7/00—Methods or arrangements for processing data by operating upon the order or content of the data handled
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Computing Systems (AREA)
- Computational Mathematics (AREA)
- Mathematical Analysis (AREA)
- Mathematical Optimization (AREA)
- Pure & Applied Mathematics (AREA)
- Executing Machine-Instructions (AREA)
- Logic Circuits (AREA)
- Control Of Indicators Other Than Cathode Ray Tubes (AREA)
Description
レジスタ13aは、データBを出力し、乗算回路13bに入力する。乗算回路13bは、命令デコーダ12からの制御信号に基づき、データBを乗算してデータS13bをセレクタ13cに出力する。セレクタ13cは、命令デコーダ12からの制御信号に基づき、入力されたデータB,S13bのいずれか一方をデータS13cとして、ALU16とセレクタ13dに出力する。
この図4のプログラムを構成する命令文では、図2に示すレジスタ13aに格納されたデータBのワイド量widthをターゲットとするレジスタ14に格納されたデータAに挿入するために、シフト命令・演算命令を組み合わせて複数の命令を実行している。
ここで、前記第1のシフト手段は、前記nビットの前記入力データBと前記オフセット量offsetを入力して、前記入力データBを前記オフセット量offset分だけ前記左シフトした前記nbitの第1の中間データを生成して出力するものである。
前記マスクシフト量制御回路は、前記オフセット量offset、前記ワイド量width、及び入力データ長nを入力し、これらの値に基づいて、マスクシフト量n−(width+offset)に対応したマスクシフト制御信号を出力する回路である。
前記第3のシフト手段は、前記基準データrefのビット反転したデータを前記LSB側から入力し、前記基準データrefを、前記オフセット量offsetだけ前記左シフトして、前記nbitの第3の中間データを生成して出力するものである。
前記論理演算手段は、前記第2及び第3の中間データを入力し、前記基準データrefが前記全bit“1”の場合は、前記第2及び第3の中間データをビット毎に論理積演算し、前記基準データrefが前記全bit“0”の場合は、前記第2及び第3の中間データをbit毎に否定論理和演算し、前記nbitのマスク選択データを生成して出力するものである。
更に、前記選択手段は、前記マスク選択データに基づき、前記入力データA又は前記第1の中間データのいずれか一方を選択して、前記nbitの前記出力データCとして出力するものである。
図1は、本発明の実施例1を示すビットフィールド操作回路の概略の構成図である。
この実施例1のビットフィールド操作回路は、例えば、CPU、MPU、DSP等のプロセッサに設けられる回路であり、第1のシフト手段(例えば、シフタ)20とマスクデータ生成回路部30を有し、これらの出力側に、n個の選択手段(例えば、セレクタ)40が接続されている。
このマスクシフト量制御回路31は、オフセット量offset、ワイド量widthを加算して、第4の制御信号(例えば、加算量)S31aを生成して出力する加算器31aと、ビット量nから加算量S31aを減算して、マスクシフト量n−(width+offset)に対応したマスクシフト制御信号S31を生成して出力する減算器31bとで構成されている。
図6は、図1のシフタ20の動作を示す概念図である。更に、図7は、図1の左マスクデータ生成回路32の動作を示す概念図であり、図8は、図1の右マスクデータ生成回路33の動作を示す概念図であり、図9は、図1のANDゲート34の動作を示す概念図である。
INS C,A,B,width,offset
33でbit毎に論理積演算をして、nbitのマスク選択データS34を生成する。
クタ40に入力されることにより、各bitにおいて、マスク選択データS34が“1”なら動作手順(1)で生成された中間データS20を選択し、“0”なら入力データAを選択して、出力データCとして出力する。
本実施例1によれば、マスクデータ生成回路部30を設けたことで、入力データA,B、基準データref、オフセット量offset、ワイド量width、ビット量nから、1サイクルで出力データCを生成することができる。従って、ビットフィールド操作命令のサイクル数が1/6に短縮され、一定時間内の処理量が低減し、ROMサイズを小さくなり、製造コスト低減が可能になるという効果がある。
図10は、本発明の実施例2を示すビットフィールド操作回路の概略の構成図であり、実施例1を示す図1中の要素と共通の要素には、共通の符号が付されている。
図11は、図10の左マスクデータ生成回路32−1の動作を示す概念図であり、図12は、図10の右マスクデータ生成回路33−1の動作を示す概念図であり、図13は、図10のNORゲート35の動作を示す概念図である。
INS C,A,B,width,offset
タS33−1でbit毎に論理積演算をして、nbitのマスク選択データS35を生成する。
クタ40に入力されることにより、各bitにおいて、マスク選択データS34が“1”なら動作手順(1)で生成された中間データS20を選択し、“0”なら入力データAを選択して、出力データCとして出力する。
本実施例2によれば、マスクデータ回路を設け、実施例1のANDゲート34に代えて、NORゲート35を設けたので、実施例1とほぼ同様に、ビットフィールド操作命令のサイクル数が1/6に短縮され、一定時間内の処理量が低減し、ROMサイズを小さくなり、製造コスト低減が可能になるという効果がある。
本発明は、上記実施例1及び2に限定されず、種々の利用形態や変形が可能である。この利用形態や変形例としては、例えば、次の(a)〜(c)のようなものがある。
31 マスクシフト量制御回路
31a 加算器
31b 減算器
32 左マスクデータ生成回路
33 右マスクデータ生成回路
34 ANDゲート
35 NORゲート
13c,13d,15,40 セレクタ
Claims (2)
- 入力データAからオフセット量offsetだけ、最下位ビットから最上位ビット方向に左シフトした位置に、入力データBのワイド量widthで示されるビット分を挿入したnビット(但し、n;2以上の整数)の出力データCを生成するビットフィールド操作回路において、
前記nビットの前記入力データBと前記オフセット量offsetを入力して、前記入力データBを前記オフセット量offset分だけ前記左シフトした前記nビットの第1の中間データを生成して出力する第1のシフト手段と、
前記オフセット量offset、前記ワイド量width、及び入力データ長nを入力し、これらの値に基づいて、マスクシフト量n−(width+offset)に対応したマスクシフト制御信号を出力するマスクシフト量制御回路と、
全ビットが“1”又は“0”の前記nビットの基準データrefのビット反転したデータを前記最上位ビット側から入力し、前記基準データrefを、前記マスクシフト量だけ、前記最上位ビットから前記最下位ビット方向に右シフトして、前記nビットの第2の中間データを生成して出力する第2のシフト手段と、
前記基準データrefのビット反転したデータを前記最下位ビット側から入力し、前記基準データrefを、前記オフセット量offsetだけ前記左シフトして、前記nビットの第3の中間データを生成して出力する第3のシフト手段と、
前記第2及び第3の中間データを入力し、前記基準データrefが前記全ビット“1”の場合は、前記第2及び第3の中間データをビット毎に論理積演算し、前記基準データrefが前記全ビット“0”の場合は、前記第2及び第3の中間データをビット毎に否定論理和演算し、前記nビットのマスク選択データを生成して出力する論理演算手段と、
前記マスク選択データに基づき、前記入力データA又は前記第1の中間データのいずれか一方を選択して、前記nビットの前記出力データCとして出力する選択手段と、
を備えたことを特徴とするビットフィールド操作回路。 - 前記マスクシフト量制御回路は、
前記オフセット量offsetと前記ワイド量widthを加算して、加算信号を出力する加算器と、
前記入力データ長nから前記加算信号を減算して、前記マスクシフト制御信号を出力する減算器と、
を有することを特徴とする請求項1記載のビットフィールド操作回路。
Priority Applications (4)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2006260613A JP4374363B2 (ja) | 2006-09-26 | 2006-09-26 | ビットフィールド操作回路 |
US11/882,356 US7949697B2 (en) | 2006-09-26 | 2007-08-01 | Bit field operation circuit |
CN2007101403724A CN101154153B (zh) | 2006-09-26 | 2007-08-10 | 位域操作电路 |
KR1020070082215A KR20080028271A (ko) | 2006-09-26 | 2007-08-16 | 비트필드 조작회로 |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2006260613A JP4374363B2 (ja) | 2006-09-26 | 2006-09-26 | ビットフィールド操作回路 |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2008083795A JP2008083795A (ja) | 2008-04-10 |
JP4374363B2 true JP4374363B2 (ja) | 2009-12-02 |
Family
ID=39226322
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2006260613A Active JP4374363B2 (ja) | 2006-09-26 | 2006-09-26 | ビットフィールド操作回路 |
Country Status (4)
Country | Link |
---|---|
US (1) | US7949697B2 (ja) |
JP (1) | JP4374363B2 (ja) |
KR (1) | KR20080028271A (ja) |
CN (1) | CN101154153B (ja) |
Families Citing this family (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
GB2485774A (en) | 2010-11-23 | 2012-05-30 | Advanced Risc Mach Ltd | Processor instruction to extract a bit field from one operand and insert it into another with an option to sign or zero extend the field |
EP2691850B1 (en) * | 2011-03-30 | 2018-05-16 | NXP USA, Inc. | Integrated circuit device and methods of performing bit manipulation therefor |
US8604946B2 (en) | 2011-04-08 | 2013-12-10 | Panasonic Corporation | Data processing device and data processing method |
CN102707925B (zh) * | 2011-04-25 | 2015-07-15 | 中国电子科技集团公司第三十八研究所 | 一种位域操作电路及位域操作方法 |
US9122475B2 (en) * | 2012-09-28 | 2015-09-01 | Intel Corporation | Instruction for shifting bits left with pulling ones into less significant bits |
US9715385B2 (en) | 2013-01-23 | 2017-07-25 | International Business Machines Corporation | Vector exception code |
US9778932B2 (en) | 2013-01-23 | 2017-10-03 | International Business Machines Corporation | Vector generate mask instruction |
US9471308B2 (en) | 2013-01-23 | 2016-10-18 | International Business Machines Corporation | Vector floating point test data class immediate instruction |
US9823924B2 (en) * | 2013-01-23 | 2017-11-21 | International Business Machines Corporation | Vector element rotate and insert under mask instruction |
US9804840B2 (en) | 2013-01-23 | 2017-10-31 | International Business Machines Corporation | Vector Galois Field Multiply Sum and Accumulate instruction |
US9513906B2 (en) | 2013-01-23 | 2016-12-06 | International Business Machines Corporation | Vector checksum instruction |
US9513926B2 (en) * | 2014-01-08 | 2016-12-06 | Cavium, Inc. | Floating mask generation for network packet flow |
KR102357899B1 (ko) * | 2014-01-29 | 2022-02-03 | 마벨 아시아 피티이 엘티디. | 유효 인코딩을 위한 방법 및 장치 |
CN104991758B (zh) * | 2015-07-27 | 2017-11-21 | 中国科学院自动化研究所 | 一种位域覆盖装置及操作方法 |
US20170185402A1 (en) * | 2015-12-23 | 2017-06-29 | Intel Corporation | Instructions and logic for bit field address and insertion |
Family Cites Families (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5129066A (en) * | 1987-09-17 | 1992-07-07 | International Business Machines Corporation | Bit mask generator circuit using multiple logic units for generating a bit mask sequence |
US5704052A (en) * | 1994-11-06 | 1997-12-30 | Unisys Corporation | Bit processing unit for performing complex logical operations within a single clock cycle |
JP3433588B2 (ja) | 1995-10-19 | 2003-08-04 | 株式会社デンソー | マスクデータ生成回路及びビットフィールド操作回路 |
US6338135B1 (en) * | 1998-11-20 | 2002-01-08 | Arm Limited | Data processing system and method for performing an arithmetic operation on a plurality of signed data values |
US6430684B1 (en) * | 1999-10-29 | 2002-08-06 | Texas Instruments Incorporated | Processor circuits, systems, and methods with efficient granularity shift and/or merge instruction(s) |
US7272622B2 (en) * | 2001-10-29 | 2007-09-18 | Intel Corporation | Method and apparatus for parallel shift right merge of data |
US7275147B2 (en) * | 2003-03-31 | 2007-09-25 | Hitachi, Ltd. | Method and apparatus for data alignment and parsing in SIMD computer architecture |
GB2411978B (en) * | 2004-03-10 | 2007-04-04 | Advanced Risc Mach Ltd | Inserting bits within a data word |
-
2006
- 2006-09-26 JP JP2006260613A patent/JP4374363B2/ja active Active
-
2007
- 2007-08-01 US US11/882,356 patent/US7949697B2/en not_active Expired - Fee Related
- 2007-08-10 CN CN2007101403724A patent/CN101154153B/zh not_active Expired - Fee Related
- 2007-08-16 KR KR1020070082215A patent/KR20080028271A/ko not_active Application Discontinuation
Also Published As
Publication number | Publication date |
---|---|
US20080077643A1 (en) | 2008-03-27 |
US7949697B2 (en) | 2011-05-24 |
CN101154153A (zh) | 2008-04-02 |
JP2008083795A (ja) | 2008-04-10 |
CN101154153B (zh) | 2012-06-06 |
KR20080028271A (ko) | 2008-03-31 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP4374363B2 (ja) | ビットフィールド操作回路 | |
US6742012B2 (en) | Apparatus and method for performing multiplication operations | |
US8271571B2 (en) | Microprocessor | |
JP6744913B2 (ja) | 浮動小数点数の丸め処理 | |
JP4700051B2 (ja) | 暗号装置及び暗号方法 | |
US7266580B2 (en) | Modular binary multiplier for signed and unsigned operands of variable widths | |
US9678716B2 (en) | Apparatus and method for performing absolute difference operation | |
JP6225687B2 (ja) | データ処理装置、およびデータ処理方法 | |
JP5640081B2 (ja) | 飽和を伴う整数乗算および乗算加算演算 | |
CN112650471A (zh) | 用于处理掩蔽数据的处理器和方法 | |
US20020065860A1 (en) | Data processing apparatus and method for saturating data values | |
JP5853177B2 (ja) | データ処理装置、及びデータ処理方法 | |
US5574677A (en) | Adaptive non-restoring integer divide apparatus with integrated overflow detect | |
US8700688B2 (en) | Polynomial data processing operation | |
JP4567753B2 (ja) | パリティ生成回路、計数回路および計数方法 | |
JP2012141952A (ja) | 除算回路及び除算方法 | |
US7917566B2 (en) | Arithmetic device capable of obtaining high-accuracy calculation results | |
JP4372822B2 (ja) | パリティ予測回路及びこれを使用した論理演算回路 | |
JP4159565B2 (ja) | ベクトル積和演算回路 | |
US8612500B2 (en) | Method and decimal arithmetic logic unit structure to generate a magnitude result of a mathematic | |
JP2015185076A (ja) | Vliwプロセッサ | |
JP7099197B2 (ja) | 演算処理装置、演算器および演算処理装置の制御方法 | |
JP2008204356A (ja) | リコンフィギャラブル回路 | |
US20130262549A1 (en) | Arithmetic circuit and arithmetic method | |
JP2005346373A (ja) | 演算回路、論理回路、読出し専用メモリ、レジスタ、および半導体回路 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20080815 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20081118 |
|
A711 | Notification of change in applicant |
Free format text: JAPANESE INTERMEDIATE CODE: A712 Effective date: 20081218 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20081225 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20090408 |
|
RD02 | Notification of acceptance of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7422 Effective date: 20090422 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20090604 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20090630 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20090714 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20090811 |
|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20090907 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120911 Year of fee payment: 3 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 4374363 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130911 Year of fee payment: 4 |
|
S531 | Written request for registration of change of domicile |
Free format text: JAPANESE INTERMEDIATE CODE: R313531 |
|
S533 | Written request for registration of change of name |
Free format text: JAPANESE INTERMEDIATE CODE: R313533 |
|
R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |