05 Arithmetic in VHDL

05 Arithmetic in VHDL 05 Arithmetic in VHDL

userweb.eng.gla.ac.uk
from userweb.eng.gla.ac.uk More from this publisher
02.02.2014 Views

Arithmetic Package Functions- IV • Comparison functions: Function Name Argument 1 Argument 2 Returns = /= Equal Not equal unsigned unsigned > < Greater than Less than signed natural signed unsigned boolean >=

Arithmetic Package Functions- V • Resize functions – Used for resizing a signed/ unsigned value – Useful if we want to extract carry bit etc. Function Description Argument 1 Argument 2 Returns resize Resize argument unsigned signed natural (new size) natural (new size) unsigned (new size) signed (new size) • Example newvalue = resize(oldvalue, 5) 121

<strong>Arithmetic</strong> Package Functions- V<br />

• Resize functions<br />

– Used for resiz<strong>in</strong>g a signed/ unsigned value<br />

– Useful if we want to extract carry bit etc.<br />

Function Description Argument 1 Argument 2 Returns<br />

resize<br />

Resize argument<br />

unsigned<br />

signed<br />

natural<br />

(new size)<br />

natural<br />

(new size)<br />

unsigned<br />

(new size)<br />

signed<br />

(new size)<br />

• Example<br />

newvalue = resize(oldvalue, 5)<br />

121

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

Saved successfully!

Ooh no, something went wrong!