Issue with the alignment of the array
In order not to guess about the width of the material on the right side, you can use tabularx
and nest array
and tabular
in it.
\documentclass{article}
\usepackage{geometry}
\usepackage{amsmath,bm}
\usepackage{tabularx,array}
\usepackage{arydshln}
\geometry{
a4paper,
total={170 mm,257 mm},
left=20 mm,
top=20 mm,
}
\begin{document}
\noindent\textbf{Solution:}
\[
\begin{tabularx}{\textwidth}{@{} c | X @{}}
$\begin{array}{cccccc}
& & 1 & 0 & 1 & 0 \\
\times & & & 1 & 0 & 1 \\
\hline
& \underline{1} & 1 & 0 & 1 & 0 \\
& 0 & 0 & 0 & 0 & \\
1 & 0 & 1 & 0 & & \\
\hline
1 & 1 & 0 & 0 & 1 & 0 \\
\end{array}$ &
\begin{tabular}{@{}p{\linewidth}@{}}
As the product of binary multiplication would always be less than~$2$,
it won't generate any carry.
\\[2ex]
\hdashline
\[\begin{array}{ccccccccc}
& & \textbf{Product/Sum} & & \textbf{Base} & & \textbf{Carry} & & \textbf{Result} \\
1 + 0 + 1 & = & 2 > 1 & = & 2 & \times & 1 & + & 0 \\[0.2 cm]
\end{array}\]
\end{tabular}
\end{tabularx}
\]
\end{document}
Probably not too elegant since I used nested tabulars to position math elements, texts and lines.
\documentclass[12 pt, a4paper]{book}
\usepackage{multicol}
\usepackage{geometry}
\geometry{
a4paper,
total={170 mm,257 mm},
left=20 mm,
top=20 mm,
}
\usepackage{amsmath,bm}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{soul}
\usepackage{indentfirst}
\usepackage[utf8]{inputenc}
\usepackage{palatino}
\usepackage[dvipsnames]{xcolor}
\usepackage{graphicx}
\usepackage{fancyhdr}
\usepackage{array}
\usepackage{enumitem}
\usepackage{mathtools}
\usepackage{cancel}
\usepackage{arydshln}
\setlength{\parindent}{2em}
\newcommand{\wt}[2]{\underset{\substack{\textstyle\uparrow\\\hidewidth\mathstrut#2\hidewidth}}{#1}}
\definecolor{mygray}{gray}{0.6}
\usepackage{calc}
\begin{document}
\textbf{Solution :}
\begin{tabular}{p{0.25\textwidth-2\tabcolsep-\arrayrulewidth}|p{0.75\textwidth-2\tabcolsep}}
\(\begin{array}[t]{cccccc}
& & 1 & 0 & 1 & 0 \\
\times & & & 1 & 0 & 1 \\
\hline
& \underline{1} & 1 & 0 & 1 & 0 \\
& 0 & 0 & 0 & 0 & \\
1 & 0 & 1 & 0 & & \\
\hline
1 & 1 & 0 & 0 & 1 & 0 \\
\end{array}\)
&
\begin{tabular}[t]{@{}p{0.75\textwidth-2\tabcolsep}@{}}
As, the product of binary multiplication would always be less than 2. It won't generate any carry. \\
\hdashline
\[\begin{array}{ccccccccc}
& & \textbf{Product/Sum} & & \textbf{Base} & & \textbf{Carry} & & \textbf{Result} \\
1 + 0 + 1 & = & 2 > 1 & = & 2 & \times & 1 & + & 0 \\[0.2 cm]
\end{array}\]
\end{tabular}
\end{tabular}
\end{document}
I propose this variant code, also based on tabularx, but using a matrix
environment and \Longstack
for the part under the dashed line:
\documentclass{article}
\usepackage{geometry}
\usepackage{amsmath,bm}
\usepackage{tabularx}
\usepackage{arydshln, booktabs,}
\usepackage[usestackEOL]{stackengine}
\geometry{a4paper, total={170 mm,257 mm}, left=20 mm, top=20 mm}
\begin{document}
\noindent\textbf{Solution:}
\[
\begin{tabularx}{\textwidth}{@{} c | X @{}}
$\begin{matrix}
& & 1 & 0 & 1 & 0 \\
\times & & & 1 & 0 & 1 \\
\midrule
& ^{\underline{1}} & 1 & 0 & 1 & 0 \\
& 0 & 0 & 0 & 0 & \\
1 & 0 & 1 & 0 & & \\
\midrule
1 & 1 & 0 & 0 & 1 & 0 \\
\end{matrix}$\enspace &
\begin{tabular}{@{}p{\linewidth}@{}}
As the product of binary multiplication would always be less than~$2$,
it won't generate any carry.
\\[2ex]
\hdashline
\stackMath
\[ 1 + 0 + 1 = \Longstack{\textbf{Product/Sum} \\ 2 > 1} = \Longstack{ \textbf{Base}\\ 2} \times \Longstack{\textbf{Carry}\\ 1}
+ \Longstack{\\\textbf{Result}\\0} \]
\end{tabular}
\end{tabularx}
\]
\end{document}