Forum Discussion
Altera_Forum
Honored Contributor
13 years agoI do have one final quick question relating to this:
I have a variable called duty that is an unsigned(5 downto 0); and i want to slice off the (5 downto 0) bits of the following equation and assign it to DUTY; DUTY <= (((WIDTH_LTCHD*PERCENT)/PERIOD_LTCHD); AT the moment (in the example above) duty is unnecesarily 23 bits wide due to the variables in the equation, but I know for a fact (due to limits) that the result cannot be bigger than a 6bit result; I tried a few variations and couldnt get the slice right; i tried somethings like: DUTY <= (((WIDTH_LTCHD*PERCENT)/PERIOD_LTCHD),(5 downto 0)); Thanks guys!