difficulties implementing incrementer

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

difficulties implementing incrementer

Mshada
I'm having a hard time implementing the incrementer chip so I was wondering if the community could show me where I'm going wrong. My idea on implementing the inc16 chip was to use 1 HalfAdder to compute the first input of the inc16 chip with true, so inc16[0] + true= out. Then the carry of the first HalfAdder would feed a FullAdder's C Pin the next input of inc16 and b would be false, ex: inc16[1] + false + carry = out. Then continuing down the bus like so. I've also tried using only HalfAdders where the first half adder would add inc16[0] + true and then the carry result would feed the b pin of the next half adders. Does this sound like I'm even in the correct neighborhood, city, country of where I'm supposed to be? Sorry if this is confusing, I'm trying not to post any HDL code. I can attempt to re-explain if necessary.
Thanks.
~m
Reply | Threaded
Open this post in threaded view
|

Re: difficulties implementing incrementer

culchie
The Add16 chip adds 2, 16 bit numbers, which is also what you want to do with the Inc16.
So if you have already made the Add16 it sounds like you are trying to re-invent the wheel.
The example in Appendix A, section A.5.3 shows how to specify the values of the bits of a multi-bit input using true for 1 and false for 0 ( a[0..2]=true, a[3..5]=false etc.)
Reply | Threaded
Open this post in threaded view
|

Re: difficulties implementing incrementer

Mshada
This post was updated on .
Yeah, I understand that, my problem is that I can't even get the first bit to increment. just to test to make sure that I'm doing the right thing I do something like
a[0]=in[0], b=true, out=out
or
a[0]=true, b[0] =in[0], out=out
when i run it through the hardware simulator the output is 0000000000000000, so the first bit never increments and I was hoping that some one could shed some light on what (if anything) I'm doing wrong. Thanks again.

update:
For whatever reason, it works on windows but it won't work on linux.
But I did figure it out.
Thanks.

	
	
	
	
Reply | Threaded
Open this post in threaded view
|

Re: difficulties implementing incrementer

Jacob Zimmerman
Thanks!  I've been having the same problem!  Ugh, never picked up on the idea that I could set the specific bit on the left side of the =