版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、SHIFTERShifter2Comp block XShifter - OverviewShifter operationsShifts and rotates,off-scale left to off-scale rightBit manipulation; bit set, clear, toggle, and testBit field manipulation; field extract and depositConversionsscaling factor in 16-bit block floating-pointexponent extract number of lea
2、ding 1s or 0sShifter operates only on fixed-point dataOne 64-bit operandOne or two 32-bit operandsTwo or four 16-bit operandsFour or eight 8-bit operandsComp Block XReg FileALUMACSFTShifter3Shifter - Operations Operand - Syntax conventionsRn operand is the data on which the Shifter operates. Rm oper
3、and specifies shift magnitudes, bit field lengths, or bit positions.Rs operand read-modify-write (RMW) data that is operated on and updated.Note: Only one option available for shifter: instructions - Sign Extension - (SE) Shifter4Shifter - Shift/Rotate (I)The shift and rotate:ASHIFTPerforms arithmet
4、ic shifts.LSHIFTPerforms logical shifts.ROTPerforms rotated shifts.All shift and rotate values are plement signed numbers. A positive value for Rm -LEFT shift or rotateA negative value for Rm -RIGHT shift or rotateShifter computes shift magnitude using the immediate value in the instruction or the L
5、SBs in RmShifter50001 0010 0011 0100 0101 0110 1110 1111 0000 0001 0010 0011 0100 0101 0110 11100010 0011 0100 0101 0110 1110 1111 0000 xxxx xxxx xxxx xxxx xxxx xxxx xxxx 0100RmShift magnitude = 4RnRsRsShift left by 4 bitsShift right by 4 bitsZero fill bits in MSBsZero fill bits in LSBs0 x123456EF0
6、x0123456E0 x000000040 x23456EF0Shifter - Shift/Rotate (II)Example of a logical shift. The contents of Rm are shifted by the number of bits specified in Rm (4) and the result is placed in Rs Rs = LSHIFT Rn BY RmNote for right shift Rm = -4 and for left shift Rm = +4Shifter61001 0010 0011 0100 0101 01
7、10 1110 1111 xxxx xxxx xxxx xxxx xxxx xxxx x111 1000RmRnRsShift right by 8 bitsSign extended MSBs1111 1111 1001 0010 0011 0100 0101 01101110 1111 deleted LSBsArithmetic left shift is identical to Logical left shift0 x923456EF0 xFFFFFFF80 xFF923456Shift value = -8Shifter - Shift/Rotate - ExampleExamp
8、le of an arithmetic shift right by 8 bits. Rm contains the magnitude of the shift (-8)Rs = ASHIFT Rn BY Rm Shifter7The shift magnitude for register file-based operations is specified by the LSBs of the Rm register. The number of bits of Rm used depends on the size of the data:Long words8 bitsNormal
9、words7 bitsShort words6 bitsBytes5 bitsFor immediate-based operations, the number of bits required are:Long words7 bitsNormal words6 bitsShort words5 bitsBytes4 bitsShifter - Shift / Rotate (II)Shift and rotateShift and rotateShift onlyShift onlyShifter8Shifter - Bit ManipulationThe bit manipulation
10、 operations are:BCLRClears a bit.BSETSets a bit.BTGLToggles (XOR with 1) a bit.BITESTTests a bit.Examples:Rs = BCLR Rn By RmRsd = BSET Rnd By RmShifter90001 0010 0011 0100 0101 0111 1110 1111xxxx xxxx xxxx xxxx xxxx xxxx xx00 1000RmRnRs0001 0010 0011 0100 0101 0110 1110 1111Eighth bit in Rn clearedV
11、alue = 80 x000000080 x123456EF0 x123457EF31031318th bitShifter - Bit Manipulation - bit clearExample of a bit manipulation BCLR. The eighth bit (Specified by Rm) of register Rn is cleared and the result placed in RsRs = BCLR Rn By Rm;Shifter10Shifter - Bit Field Manipulation (I)The bit field manipul
12、ation operations are:FEXTExtracts a field from a register according to the length and position specified by another register.FDEPDeposits a right-justified field into a register according to the length and position specified by another register. MASKCopies a 32- or 64-bit field created by a mask.XYS
13、TATLoads or stores all bits or 14 LSBs only of the X/YSTAT register. For field extract and deposit operations, the Rm operand contains the control information in two fields: and . Location of these fields depends on whether Rm is a single- or dual-word register.Shifter1163 32 0 RmdRm31 15 8 6 0 Len
14、specifies the number of bits to extractPos specifies the starting position in RnExtracted bits are stored right-justified in RsShifter - Bit Field Manipulation (II)FEXT extracts a field from a register according to the length and position specified by another register.Rm operand contains the control
15、 information in two fields: and . The location of fields depends if Rm is a single- or dual-word register.Shifter12Rm31 15 8 0 xxxx xxxx xxxx xxxx 0000 0101 x000 1000Length 8 bitsStart at bit 50 x0000050831 15 0 xxxx xxxx xxxx xxxx 0001 0010 0011 010031 15 0 xxxx xxxx xxxx xxxx xxxx xxxx 1001 0001 R
16、nRs0 x000012340 x00000091bit 5Shifter - Bit Field Manipulation (III)Example of a Field Extract (FEXT) 8 bits from Rn, starting at 6th bit are copied and placed in LSBs of Rs. Rs = FEXT Rn By Rm;Shifter13Shifter - Conversion OperationsThe floating-point conversion support operations are:BKFPTDetermin
17、es scaling factor used in 16-bit block floating-point.EXPExtracts the exponent.LDxExtracts leading zeros (0) or ones (1)Shifter14Shifter - Bit Stream Manipulation (I)The bit stream manipulation operations are:GETBITSExtracts bits from a bit stream.PUTBITSDeposits bits in a bit stream.BFOTMPTemporari
18、ly stores or returns overflow from GETBITS and PUTBITS instructions.The bit stream manipulation operations, in conjunction with the ALU BFOINC instruction, implement a bit FIFO used for modifying the bits in a contiguous bit stream.For bit stream extract and deposit operations, the Rmd operand conta
19、ins the control information in two fields: and . These fields form a register pair, RmdShifter1531 0 31 0BFP6Len6RmdRbRbBFP - 6-bit field the current Bit FIFO Pointer and points to the location of the bitstream in Rnq where extraction/insertion starts Len - 6-bit field - specifies the number of bits
20、 to extract Note: Bit FIFO Pointer must be incremented using the BFOINC ALU instructionShifter - Bit Stream Manipulation (II)GETBITS - Extracts bits from a bit streamRsd = GETBITS Rnq BY RmdDouble Rmd contains the control information for the GETBITS / PUTBITS operationsShifter16Shifter places extrac
21、ted bits in Rsd right justified starting at bit 0. SE option - sign extend - fills bits with the same value as the MSB of the extracted data 31 0RnqRfBFP6Len6RsReRdRcRkRhShifter - Bit Stream Manipulation (III)Rsd = GETBITS Rnq BY RmdQuad register Rnq is the source register , Rs is the destination re
22、gisterShifter17Shifter - Status Flags The Shifter updates two flags in the XSTAT and YSTAT status registers at the end of each operation. The flags are:BFBlock floating-point flag. Updated for the BKFPT instruction only.SNShifter result negative.SZShifter result zeroSF0 and SF1 are the computation b
23、lock static flag 0 and flag 1 conditionsShifter18Shifter - ConditionsShifter conditionsConditionDescription Flags setSEQ Equal to zeroSZSLT Less than zeroSN and SZNSEQ Not equal to zeroSZNSLT Not less than zeroSN and SZ Examplesif XSLT, Jump Label_10;if NYSLT, Jump Label_12;if NSLT; DO R3=R5+R6; SHIFTER Reference MaterialShifter20Shifter - Instruction Summary (I)Shifter instructions X|Y|XY S|B Rs = LSHIFT|ASHIFT Rn BY Rm|X|Y|XY L|S|BRsd= LSHIFT|ASHIFT Rnd BY Rm|X|Y|XY
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 大型廣告牌安裝吊車租賃合同
- 電視劇制作團(tuán)隊(duì)制片人招聘協(xié)議
- 一卡通系統(tǒng)訂貨合同
- 建設(shè)工程施工合同地?zé)崮荛_(kāi)發(fā)
- 企業(yè)內(nèi)部網(wǎng)站管理辦法
- 水電站土地開(kāi)發(fā)合同
- 電子產(chǎn)品生產(chǎn)廢標(biāo)條件研究
- 酒店維護(hù)工程合同
- 礦山安全質(zhì)量管理辦法
- 企業(yè)產(chǎn)品演示員操作手冊(cè)
- 經(jīng)銷商可以實(shí)施哪些策略來(lái)提供個(gè)性化和定制的購(gòu)物體驗(yàn)
- 汽車行走的藝術(shù)智慧樹(shù)知到期末考試答案章節(jié)答案2024年吉林大學(xué)
- 超星爾雅學(xué)習(xí)通《舞臺(tái)人生走進(jìn)戲劇藝術(shù)(中央戲劇學(xué)院)》2024章節(jié)測(cè)試答案
- 1.1 都勻毛尖茶概況
- 軟件項(xiàng)目管理案例教程(第四版)課后習(xí)題答案
- 我的家鄉(xiāng)東營(yíng)
- 復(fù)合固定循環(huán)指令G71(G70)
- 網(wǎng)上競(jìng)價(jià)響應(yīng)文件【模板】
- QC七大手法與新QC七大手法
- 下肢靜脈曲張個(gè)案查房
- 照明路燈工程 投標(biāo)文件(技術(shù)方案)
評(píng)論
0/150
提交評(píng)論