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 PartsSubtractor (sub)Subtractor (sub)This part subtracts the input values of port din1 and scalar port cin fromthe port din0 and places the result in the output data port dout.The carry out from this result is placed in the scalar output port cout. Thesubtraction can be performed in signed and unsigned mode. The mode isselected by the parameter sign_type. Parameters cin_type and cout_typecontrol the polarity of ports cin and cout.This part is equivalent to an n-bit subtractor; where n is the width of theports din and dout. The implementation of the subtractor is controlled viathe synthesis script.If input port cin is unconnected, it is driven by 0.Functiondout= din0 - din1 - cinThe subtraction is signed or unsigned depending of the value of sign_type.If cout_type = ActiveHigh:cout = 1= 0if there is a carry out during subtractionotherwiseIf cout_type = ActiveLow:cout = 0= 1if there is a carry out during subtractionotherwiseTruth TablesAll the following examples are for positive polarities and cin = 0.Unsigned, 3-bit din0, din1 and dout:Table 6-43. Subtractor Truth Table — Unsigned, 3-bit din0, din1 and doutdin0 din1 dout cout000 010 110 1001 010 111 1010 010 000 0011 010 001 0100 010 110 0101 010 011 0110 010 100 0111 010 101 0130<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!