bit T, H
bit[4] L4
bit[3] H3
bit[8] X
X = ((~K) + 1)[7:0]
{AC, L4} = A[3:0] + X[3:0]
{T, H3} = A[6:4] + X[6:4] + AC
{C, H} = A[7] + X[7] + T
OV = C ^ T
A = {H, H3, L4}
Z = A ? 0 : 1
bit T, H
bit[4] L4
bit[3] H3
bit[8] X
X = ((~R) + 1)[7:0]
{AC, L4} = A[3:0] + X[3:0]
{T, H3} = A[6:4] + X[6:4] + AC
{C, H} = A[7] + X[7] + T
OV = C ^ T
A = {H, H3, L4}
Z = A ? 0 : 1