You are right. I forgot to note that col and rows are connected to a keyboard matrix 3x4.
but how is it wired , what will make the columns change state the rows are set to all 1's the initial col port pins are set to all 1's
where can a o come from ?

usually a zero or a one is walked down a row or col