In a $4 \times 4$ chessboard composed of 16 small squares, 8 of the small squares are to be colored black, such that each row and each column has exactly 2 black squares. There are $\qquad$ different ways to do this.
12. 90 .

The first row has 2 black cells, which can be chosen in $C_{4}^{2}=6$ ways.
After the first row is colored, there are three cases:
(1) The black cells in the first row are in the same columns as those in the second row, in which case there is only one way to color the remaining rows.
(2) The two black cells in the second row are in different columns from those in the first row, in which case the second row has $C_{4}^{2}-6$ ways to be colored, and the coloring of the fourth row is then determined.
(3) The second row has exactly one black cell in the same column as one of the black cells in the first row, which can be done in 4 ways. After the first two rows are colored, the black cells in the third row must be in different columns from those in the first two rows, which can be done in 2 ways. The coloring of the fourth row is then determined.
Therefore, there are a total of $6 \times 1+6 \times 6+6 \times 4 \times 2=90$ ways to color the grid.