05 Arithmetic in VHDL
05 Arithmetic in VHDL 05 Arithmetic in VHDL
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
- Page 1 and 2: Arithmetic Packages- Introduction
- Page 3 and 4: Arithmetic Package Overview- II •
- Page 5 and 6: Declaring Arithmetic Signals & Vari
- Page 7 and 8: Arithmetic Package Functions- I •
- Page 9: Arithmetic Package Functions- III
- Page 13 and 14: Arithmetic Package Functions- VII
- Page 15 and 16: Arithmetic Package Example- I • S
- Page 17 and 18: Arithmetic Package Example- III •
<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