I/O between UNO and DUE

I want to use 4 IO pins between UNO and DUE, which should be able each other to repond with respect to the highs and lows of the their signals.
For example, change in low active signal of DUE should make the UNO to go from high (1) to low(0) and vice versa.

How can i able to achieve this? Can i able to connect the digital I/O pins between two Arduinos or is there any harm from it? And how to program if i do so?

No, you cannot directly connect DUE and UNO pins. It would be a disaster. DUE is 3.3V and UNO is 5V logic. You can do something like this:

This you will need, when you will connect UNO output pin to DUE input pin. You can remove resistor from above image and it will still work, but you will have to turn on internal pull-up resistor on DUE.

From DUE to UNO it's a bit trickier. You will need some kind of level shifter or just use an FET and pull-up on UNO side.

Regards,
Jakob

Hello Jacob,

Thanks for the info. Can u please guide me which sort of communication i should go with in my case, if the above case is not so preferable. I am looking for I/O between these two controllers.

Regards,
Tanu