I am trying to implement Deustch-Jozsa Algorithm where function f(x) = 0 for even and f(x) = 1 for odd, for a four-bit number. After writing the numbers out I found a pattern as described below
Therefore as you can see the from the image, all I need to do is add the CNOT gate to the last register so to implement the oracle and here is my circuit that I have written for the same. Here is the circuit and output for the same
My question is shouldn't the output be '1111' since this is a balanced function. The number corresponding in the circuit is 2 = '0010' and the output is showcased for the same. I would highly appreciate breakdown. Also the does the circuit implement the oracle where f(x) = 0 is even and for