Modified Inc16 help

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Modified Inc16 help

jck90
Im trying to implement a slightly modified version of the 16bit incrementer and i have got it to work, but now i need it to only increment the input if the value of another input pin is 1, otherwise just output whatever the input was and I'm not sure how to do this using the hdl syntax.

I would appreciate it if someone could point me in the right direction.
Reply | Threaded
Open this post in threaded view
|

Re: Modified Inc16 help

cadet1620
Administrator
Multiplexors make choices, so use a Mux16 to select between the original value and the incremented value.

--Mark
Reply | Threaded
Open this post in threaded view
|

Re: Modified Inc16 help

jck90
This post was updated on .
Edit: I figured out how to do it, nevermind.

Thanks again for the help.
Reply | Threaded
Open this post in threaded view
|

Re: Modified Inc16 help

cadet1620
Administrator
What conditions of control signals select the various functions? Since you have 6 functions, do you have 3 control bits that could directly connect to a Mux8Way16?

You also need to decide what should happen when the control signals select one of the two unused mux inputs. A common thing to do is connect them to 0 and -1 to make it easy to get those constants.

--Mark