\usetikzlibrary{decorations.pathreplacing}
\tikzstyle{num} = [rectangle, minimum width = 0.8cm, minimum height = 0.8cm, text centered,align=center,thick,draw = black,fill=green!5]
\tikzstyle{att} = [rectangle, minimum width = 0.8cm, minimum height = 0.8cm, text centered,align=center]


\begin{tikzpicture}[node distance = 0cm]
\node(num1)[num]{-1};
\node(num2)[num,below of = num1,yshift= -0.8cm]{0};
\node(num3)[num,below of = num2,yshift= -0.8cm]{1};
\node(num4)[num,right of = num1,xshift= 0.8cm]{0};
\node(num5)[num,below of = num4,yshift= -0.8cm]{1};
\node(num6)[num,below of = num5,yshift= -0.8cm]{0};
\node(num7)[num,right of = num4,xshift= 0.8cm]{0};
\node(num8)[num,below of = num7,yshift= -0.8cm]{-1};
\node(num9)[num,below of = num8,yshift= -0.8cm]{0};

\node(num11)[num,below of = num1,xshift= -0.5cm,yshift= -0.5cm]{0};
\node(num22)[num,below of = num2,xshift= -0.5cm,yshift= -0.5cm]{0};
\node(num33)[num,below of = num3,xshift= -0.5cm,yshift= -0.5cm]{1};
\node(num44)[num,right of = num4,xshift= -0.5cm,yshift= -0.5cm]{1};
\node(num55)[num,below of = num5,xshift= -0.5cm,yshift= -0.5cm]{1};
\node(num66)[num,below of = num6,xshift= -0.5cm,yshift= -0.5cm]{0};
\node(num77)[num,right of = num7,xshift= -0.5cm,yshift= -0.5cm]{1};
\node(num88)[num,below of = num8,xshift= -0.5cm,yshift= -0.5cm]{1};
\node(num99)[num,below of = num9,xshift= -0.5cm,yshift= -0.5cm]{1};

\node(num1_1)[num,below of = num11,xshift= -0.5cm,yshift= -0.5cm]{1};
\node(num2_2)[num,below of = num22,xshift= -0.5cm,yshift= -0.5cm]{1};
\node(num3_3)[num,below of = num33,xshift= -0.5cm,yshift= -0.5cm]{0};
\node(num4_4)[num,right of = num44,xshift= -0.5cm,yshift= -0.5cm]{0};
\node(num5_5)[num,below of = num55,xshift= -0.5cm,yshift= -0.5cm]{0};
\node(num6_6)[num,below of = num66,xshift= -0.5cm,yshift= -0.5cm]{0};
\node(num7_7)[num,right of = num77,xshift= -0.5cm,yshift= -0.5cm]{-1};
\node(num8_8)[num,below of = num88,xshift= -0.5cm,yshift= -0.5cm]{-1};
\node(num9_9)[num,below of = num99,xshift= -0.5cm,yshift= -0.5cm]{-1};


\draw[decorate,decoration={brace,mirror,raise=0pt,amplitude=0.3cm},black,thick] ([yshift=0.4cm]num1_1.west) -- node[att,xshift=-0.5cm]{\large q} ([yshift=-0.4cm]num3_3.west);
\draw[decorate,decoration={brace,raise=0pt,amplitude=0.3cm},black,thick] ([xshift=-0.4cm]num1.north) -- node[att,yshift=0.5cm]{\large k}([xshift=0.4cm]num7.north);
\draw[decorate,decoration={brace,mirror,raise=0pt,amplitude=0.3cm},black,thick] ([xshift=0.4cm]num9_9.south) -- node[att,xshift=0.4cm,yshift=-0.3cm]{\large o}([xshift=0.4cm]num9.south);
\end{tikzpicture}