Forum Discussion
Altera_Forum
Honored Contributor
10 years agoConfused over division by shifting
Hi, Suppose I have an array x whose 1st element x1 is a logic vector of length 8 and the second element x2 is also a logic vector of length 8 making the array x a logic vector of total length e...
Altera_Forum
Honored Contributor
10 years ago --- Quote Start --- Hi Kaz, Thanks for your reply. But what if I want to take a 16 bit logic vector want to store it in a 8 bit logic vector so that the result is division by 2 ? Thanks, --- Quote End --- You need to determine the problem scope. 1) Does the maximum value you want to see fit within 8 bits? If it doesn't, what information are you willing to lose? 2) Do you need accuracy? If you drop multiple bits, are you rounding? 3) Are you actually looking for division by 2? Are you doing math on a signal or logic manipulation?