13.07.2015 Views

ModuleWare Reference Guide - Hornad

ModuleWare Reference Guide - Hornad

ModuleWare Reference Guide - Hornad

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Arithmetic PartsRight Shifter (rshift)Right Shifter (rshift)This part right shifts the input port din by the value given by the input port shift.The result of this shift operation is placed in the output port dout. Theenumerated parameter mode (Logical, Arithmetic, Circular) selects one of threeshift modes.For logical mode, 0 is shifted in the most significant bit.For arithmetic mode, the most significant bit of input port din is retained.For circular mode, the least significant bit of the input port din is shifted into the mostsignificant bit.This part is equivalent to an n-bit right shifter; where n is the width of the ports din and dout.The implementation is controlled via the synthesis script. Silicon compilers perform better atthis part in terms of hardware performance.Functiondout = din >> shift if mode = logical, 0 is placed in the MSBif mode = arithmetic, the MSB is retainedif mode = circular, LSB of din is placed in the MSBTruth TableA 4-bit input example (mode = logical):Table 6-39. Right Shifter Truth Table — 4-bit Input, Mode = Logicaldin shift dout1101 101 (5) 00001101 010 (2) 0011A 4-bit input example (mode = arithmetic):Table 6-40. Right Shifter Truth Table — 4-bit Input, Mode = Arithmeticdin shift dout1001 101 (5) 11111001 010 (2) 1110A 4-bit input example (mode = circular):Table 6-41. Right Shifter Truth Table — 4-bit Input, Mode = Circulardin shift dout1001 101 (5) 11001001 010 (2) 0110128<strong>ModuleWare</strong> <strong>Reference</strong> Manual, Library Version 1.9September 18, 2008

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!