\documentclass{book}
\usepackage{graphicx}
\usepackage{tikz,amssymb,amsmath,tikz-cd}
\usetikzlibrary{patterns}
\usepackage{xepersian}





\begin{document}

\begin{tikzpicture}
\tikzstyle{mybox} = [draw=black, fill=gray!0, very thick, rectangle, inner sep=4pt, inner ysep=4pt]
\tikzstyle{fancytitle} =[fill=black!20, text=black]
%\clip(0,0) rectangle (15,5);
\node [mybox] (box){%
\fboxrule=.2mm\fbox{\begin{minipage}{0.42\textwidth}
%=================================================
\begin{flushright}
خروجی 
\end{flushright}
%=================================================
\end{minipage}}%\tikzstyle{ali}=[]
 \begin{minipage}{0.44\textwidth}
%;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
\begin{flushright}
ورودی
\end{flushright}
%;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    \end{minipage}};
\node[ thick,draw=black,above=5pt,fancytitle,right=-45pt] at (box.north) {\begin{footnotesize}
\hboxL{\rl{خروجی}}
\end{footnotesize}};
\node[ thick,draw=black,above=5pt,fancytitle, inner sep=6pt, left=10pt] at (box.north east) {\begin{footnotesize}
\hboxL{\rl{ورودی}}
\end{footnotesize}};
\end{tikzpicture}
}
\end{document}
