How do I code convergent rounding with variable scaling in VHDL?

Status
Not open for further replies.

kel8157

Full Member level 2
Joined
Nov 14, 2007
Messages
131
Helped
5
Reputation
10
Reaction score
3
Trophy points
1,298
Visit site
Activity points
2,017
Assume the following C code, what's the most efficient method do I use in VHDL, assuming timing is more important than area?

Thank you in advance.

Code:
Assume 8 bit Din, 3 bit scl (scaling factor);

K = 7;

Temp = (Din << (K-scl) + (1<< (K-1));
Dout = (Temp >> K) & ((K&0xFF) ? 0xFF, 0xFE);
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…