In reply to gotlibhaim:
Can we assume port_A/bBi_Type[i] is an enum {A,B,C,D} ?
What do you mean “C for all” all what? Maybe you should show an example of what you expected for results versus what you are actually getting. Just show one element. This is what I get for portA_Type[0] and portB_type[0]
# A A
# A B
# A B
# A A
# D D
# B C
# B A
# A D
# A D
# C C
# B C
# A B
# D C
# B B
# C D
# B A
# C D
# B A
# B D
# B C
# B B