Condition Codes

Here's another problem: if we solve the problem of results that are too big by throwing away the carry, how do we know what happened? We introduce another register, called the Condition Code register. It is used to keep information regarding the results of arithmetic operations, so we can look at them later. There are four condition codes: Notice that carry-out and overflow are not at all the same thing!

We can see some combinations of the four condition codes, in four-bit signed hexadecimal addition:

2 f 6 a b 4
+2 +f +6 +a +1 +c
4 e c 4c 0
N = 0 N = 1 N = 1 N = 0 N = 1 N = 0
Z = 0 Z = 0 Z = 0 Z = 0 Z = 0 Z = 1
V = 0 V = 0 V = 1 V = 1 V = 0 V = 0
C = 0 C = 1 C = 0 C = 1 C = 0 C = 1