Toy Example

a=RandomInteger[{0,255},{4,4}]

b={{0,0,0,0},{0,0,0,0},{0,0,1,0},{0,0,0,1}}

a.b

c={{128,128,0,0},{128,128,0,0},{128,128,0,0},{128,128,0,0}}

c+a.b

General Case

a=RandomInteger[{0,255},{10,10}]

b=SparseArray[{i_,i_}/;i>10/2->1,{10,10}]

Normal[b]

a.b

c=SparseArray[{i_,j_}/;j<=5->128,{10,10}]

Normal[c]

c+a.b