I am working on Subtractor circuits using Adder circuits. I have to do x-y. Suppose x = 111111 , y = 100000 Using the 6 bit adder circuit I created the overflow flag is coming to be 0 but when I solve it using pen and paper the overflow is coming to be 1. When x = 000000 and y = 000000 the Carry out flag is coming to be 1 but using pen and paper it is coming to be 0. I have used the basic logic used to create Adder circuits and for evaluation of flags. I created 15 test cases. Only these two test cases did not agree with these flags. The final answer they displayed was correct. I have created the circuit in Vivado. The link for the code I used and my test cases can be found here: https://1drv.ms/f/s!AmyCvVHlJ4uYhTaBH9AaCgKkaaOL These two test cases are at time 1000 and 2800 ns respectively. Calculation that I did on pen and paper: x = 111111, y = 100000 y'+1 = 100000 x + y' + 1 = 011111 with Carry out = 1 and overflow = ex-or of 1 and 0 = 1 x = 000000, y = 000000 y'+1 = 000000 x + y' + 1 = 000000 with carry out = 0 and overflow = ex-or of 0 and 0 = 0 What mistake I might be doing? I think it has to do something with 2s complements because 2s complement of 0000000 and 100000 are the numbers themselves. What am I missing?