13.07.2015 Views

ModuleWare Reference Guide - Hornad

ModuleWare Reference Guide - Hornad

ModuleWare Reference Guide - Hornad

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Arithmetic PartsIncrementer Decrementer (incdec)Incrementer Decrementer (incdec)This part increments or decrements the value of the input port din andplaces the result in the output port dout. The carry out from this result isplaced in scalar output port cout.The addition or subtraction is decided by the value of the scalar input portinc_dec. The polarity of this port is controlled by the enumeratedparameter inc_dec_type.The parameter sign_type selects one of two decrement modes: Unsignedand Signed.Parameter cout_type controls the polarity of port cout.This part is equivalent to an n-bit Incrementer or Decrementer; where n isthe width of the ports din and dout. The implementation of the increment or decrement iscontrolled via the synthesis script.The default action is increment. Use the Incrementer (inc) part if only the increment operation isneeded. Synthesis tools may infer both an increment and decrement for the IncrementerDecrementer (incdec) part.Functiondout = din0 + 1= din0 - 1= din0 + 1= din0 - 1if inc_dec = 1 and inc_dec_type = ActiveHighif inc_dec = 0 and inc_dec_type = ActiveHighif inc_dec = 0 and inc_dec_type = ActiveLowif inc_dec = 1 and inc_dec_type = ActiveLowThe arithmetic is unsigned or signed, depending on the value of the parameter sign_type.cout = 1= 0if there is a carry out during the arithmetic operationotherwiseTruth TableA 3-bit example (sign_type = unsigned, positive polarities):Table 6-28. Incrementer Decrementer Truth Table — 3-bit, Unsigned, PositivePolaritiesdin incdec dout cout000 1 001 0001 1 010 0010 1 011 0011 1 100 0100 1 101 0101 1 110 0120<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!