Forum Discussion
Altera_Forum
Honored Contributor
11 years agoAlternatives to min max?
Hi, Are there any alternatives for min/max in verilog? For not running past a vector. The best way i can figure out is to give it a bit or two headroom and using an extra if statement. Not ...
Altera_Forum
Honored Contributor
11 years agoYes my bad, example I gave you was 12 bits, one hex digit is 4bits.
for 3 bits is Bin Decimal Min 000 0 Max 111 7 So my point was to get a min / max value of any number of bits you don't need any extra bit, just use the value all "1" to compare and you have your max value and use the value all "0" to compare and you have your min value