Inc16

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

Inc16

dmoeller
my first thought is to use Add16 (seems most logical choice), but since b input has to be 16 bits, when I call Add16, do i need to set b=0000000000000001, or just b=1
Reply | Threaded
Open this post in threaded view
|

Re: Inc16

cadet1620
Administrator
Just like you can say "in=in[0]" in your Not16, you can use [] syntax on the left side of =.
Write "b[0]=true, b[1..15]=false" to set b to 0000000000000001.

Note that "true" and "false" a a bit magic in that they match the bus width that they are connected to.

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

Re: Inc16

dmoeller
is there a more efficient way other than writing b[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15] ?
Reply | Threaded
Open this post in threaded view
|

Re: Inc16

cadet1620
Administrator
Literally "[1..15]" — two periods between the numbers 1 an 15.
See appendix A, section A.5.3.