Multiply two 2x2 matrices A and B. Each entry C[i,j] of the result is the dot product of row i of A with column j of B, computed term by term with a running sum. The state panel records the running sum for each output entry and adds the final result once all terms are accumulated.

Example

Fill each product entry from a row-column dot product.

highlighted = computed this step

Step 1 — Set up

Start with the given matrix data.

A=[1234],B=[2013],C=[]A=\begin{bmatrix}1&2\\3&4\end{bmatrix},\quad B=\begin{bmatrix}2&0\\1&3\end{bmatrix},\quad C=\begin{bmatrix}\square&\square\\\square&\square\end{bmatrix}

Step 2 — Top-Left entry

Fill top-left entry: 1*2 + 2*1 = 4.

C=[4],12+21=4C=\begin{bmatrix}\hl{4}&\square\\\square&\square\end{bmatrix},\quad 1\cdot 2+2\cdot 1=4

Step 3 — Top-Right entry

Fill top-right entry: 1*0 + 2*3 = 6.

C=[46],10+23=6C=\begin{bmatrix}4&\hl{6}\\\square&\square\end{bmatrix},\quad 1\cdot 0+2\cdot 3=6

Step 4 — Bottom-Left entry

Fill bottom-left entry: 3*2 + 4*1 = 10.

C=[4610],32+41=10C=\begin{bmatrix}4&6\\\hl{10}&\square\end{bmatrix},\quad 3\cdot 2+4\cdot 1=10

Step 5 — Bottom-Right entry

Fill bottom-right entry: 3*0 + 4*3 = 12.

C=[461012],30+43=12C=\begin{bmatrix}4&6\\10&\hl{12}\end{bmatrix},\quad 3\cdot 0+4\cdot 3=12

Step 6 — Result

Read the completed C matrix.

C=[461012],C completeC=\begin{bmatrix}4&6\\10&12\end{bmatrix},\quad \text{C complete}
matrix multiplication C = A · B where A is m×p and B is p×n yields an m×n matrix C. Entry C[i,j] = sum of A[i,k] * B[k,j] for k = 1..p.
inner dimension The number of columns in A must equal the number of rows in B (the inner dimension p). The result has the outer dimensions: rows of A by columns of B.