Add16 outputs

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

Add16 outputs

pango333
Why doesn't Add16 have a carry output?

My assumption is that it's irrelevant because we're not dealing with overflow, but I wanted to use it as a pin to implement f in the ALU, and the hardware simulator doesn't let me, because according to the Add16 parameters, it doesn't exist (even though I did provide a variable for the final carry in the actual Add16 code, because I had to).

Is there any way to access the carry as a pin? Or do I have to find a different workaround?

Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: Add16 outputs

cadet1620
Administrator
You need to modify your Add16 chip to specify the carry output pin in the OUTPUT list.

  CHIP Add16 {
    IN a[16], b[16];
    OUT out[16], carry;

The chips you write can use use that carry output as an input to one for their parts.

--Mark

Reply | Threaded
Open this post in threaded view
|

Re: Add16 outputs

pango333
Got it. Thanks!