diff --git a/circuit/25-2/course_project/README.jpg b/circuit/25-2/course_project/README.jpg new file mode 100644 index 0000000..66b67b9 Binary files /dev/null and b/circuit/25-2/course_project/README.jpg differ diff --git a/circuit/25-2/course_project/drawio/1.1.1.drawio b/circuit/25-2/course_project/drawio/1.1.1.drawio new file mode 100644 index 0000000..305bc05 --- /dev/null +++ b/circuit/25-2/course_project/drawio/1.1.1.drawio @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/circuit/25-2/course_project/drawio/1.1.2.drawio b/circuit/25-2/course_project/drawio/1.1.2.drawio new file mode 100644 index 0000000..305bc05 --- /dev/null +++ b/circuit/25-2/course_project/drawio/1.1.2.drawio @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/circuit/25-2/course_project/img/1.1.1.drawio.png b/circuit/25-2/course_project/img/1.1.1.drawio.png new file mode 100644 index 0000000..523abf0 Binary files /dev/null and b/circuit/25-2/course_project/img/1.1.1.drawio.png differ diff --git a/circuit/25-2/course_project/img/1.1.2.drawio.png b/circuit/25-2/course_project/img/1.1.2.drawio.png new file mode 100644 index 0000000..dea15c4 Binary files /dev/null and b/circuit/25-2/course_project/img/1.1.2.drawio.png differ diff --git a/circuit/25-2/course_project/main.tex b/circuit/25-2/course_project/main.tex index e3e1b2e..ee68510 100644 --- a/circuit/25-2/course_project/main.tex +++ b/circuit/25-2/course_project/main.tex @@ -25,6 +25,8 @@ \usepackage{float} \floatstyle{plaintop} \restylefloat{table} +\usepackage{makecell} +\usepackage[table]{xcolor} \begin{document} @@ -88,8 +90,113 @@ \subsubsection{Алгоритм операции УМНОЖЕНИЕ} Умножение выполняется по алгоритму умножения с младших разрядов множителя и сдвигом суммы частичных произведений вправо с одним корректирующим шагом. Данный алгоритм при представлении сомножителей в прямом коде можно выразить следующей формулой: +$$[A]_{\text{п}} = a_3, a_2 a_1 a_0$$ + \begin{equation} - [A]_{\text{п}} \cdot [B]_{\text{п}}=(..((0 + A \cdot b_0) \cdot p^{-1} + A \cdot b_1) \cdot p^{-1} + ... + A \cdot b_{n-1}) \cdot p^{-1} + [A]_{\text{п}} \cdot [B]_{\text{п}}=(..((0 + A \cdot b_0) \cdot p^{-1} + A \cdot b_1) \cdot p^{-1} + ... + A \cdot b_{n-1}) \cdot p^{3} \end{equation} +\begin{figure}[H] + \centering + \begin{minipage}{0.3\textwidth} + \centering + \makecell[l]{ + Пример 1: \\ + $[\mathrm{A}]_\mathrm{п} = 0.111 = 7$\\ + $[\mathrm{B}]_\mathrm{п} = 0.111 = 7$\\ + $\mathrm{Зн} = 0 \oplus 0 = 0$\\ + $[\mathrm{A}*\mathrm{B}]_\mathrm{п} = 0.0110001 = 49$ + } + \end{minipage} + \begin{minipage}{0.69\textwidth} + \centering + \begin{tabular}{c|c|c|c|c|c|c|c|c|c} + & & 0 & 1 & 1 & 1 & & & & \makecell[l]{RA} \\ + & & 0 & 1 & 1 & 1 & & & & \makecell[l]{RB}\\ \hline + & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & \makecell[l]{RR = 0} \\ + $b_0 = 1$ & & 0 & 1 & 1 & 1 & & & & \makecell[l]{RA} \\ \hline + & 0 & 0 & 1 & 1 & 1 & 0 & 0 & 0 & \makecell[l]{RR} \\ + & 0 & 0 & 0 & 1 & 1 & 1 & 0 & 0 & \makecell[l]{RR >> 1} \\ + $b_1 = 1$ & & 0 & 1 & 1 & 1 & & & & \makecell[l]{RA} \\ \hline + & 0 & 1 & 0 & 1 & 0 & 1 & 0 & 0 & \makecell[l]{RR} \\ + & 0 & 0 & 1 & 0 & 1 & 0 & 1 & 0 & \makecell[l]{RR >> 1} \\ + $b_2 = 1$ & & 0 & 1 & 1 & 1 & & & & \makecell[l]{RA} \\ \hline + & 0 & 1 & 1 & 0 & 0 & 0 & 1 & 0 & \makecell[l]{RR} \\ + $\mathrm{Знак}$&\cellcolor{lightgray}0 & 0 & 1 & 1 & 0 & 0 & 0 & 1 & \makecell[l]{RR >> 1} + \end{tabular} + \end{minipage} +\end{figure} + +\begin{figure}[H] + \centering + \begin{minipage}{0.3\textwidth} + \centering + \makecell[l]{ + Пример 2: \\ + $[\mathrm{A}]_\mathrm{п} = 0.111 = 7$\\ + $[\mathrm{B}]_\mathrm{п} = 1.101 = -5$\\ + $\mathrm{Зн} = 1 \oplus 0 = 1$\\ + $[\mathrm{A}*\mathrm{B}]_\mathrm{п} = 1.0100011 = -35$ + } + \end{minipage} + \begin{minipage}{0.69\textwidth} + \centering + \begin{tabular}{c|c|c|c|c|c|c|c|c|c} + & & 0 & 1 & 1 & 1 & & & & \makecell[l]{RA} \\ + & & 1 & 1 & 0 & 1 & & & & \makecell[l]{RB}\\ \hline + & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & \makecell[l]{RR = 0} \\ + $b_0 = 1$ & & 0 & 1 & 1 & 1 & & & & \makecell[l]{RA} \\ \hline + & 0 & 0 & 1 & 1 & 1 & 0 & 0 & 0 & \makecell[l]{RR} \\ + & 0 & 0 & 0 & 1 & 1 & 1 & 0 & 0 & \makecell[l]{RR >> 1} \\ + $b_1 = 0$ & \multicolumn{8}{c}{\text{пропуск такта суммирования}} & \\ \hline + & 0 & 0 & 0 & 1 & 1 & 1 & 0 & 0 & \makecell[l]{RR} \\ + & 0 & 0 & 0 & 0 & 1 & 1 & 1 & 0 & \makecell[l]{RR >> 1} \\ + $b_2 = 1$ & & 0 & 1 & 1 & 1 & & & & \makecell[l]{RA} \\ \hline + & 0 & 1 & 0 & 0 & 0 & 1 & 1 & 0 & \makecell[l]{RR} \\ + $\mathrm{Знак}$&\cellcolor{lightgray}1 & 0 & 1 & 0 & 0 & 0 & 1 & 1 & \makecell[l]{RR >> 1} + \end{tabular} + \end{minipage} +\end{figure} + +\newpage +\begin{figure}[H] + \centering + Представим рассмотренный метод умножения в виде схемы алгоритма \\ + \begin{minipage}[t]{\textwidth} + \centering + \includegraphics[width=0.6\textwidth]{1.1.1.drawio} + \caption{Блок схема умножения} + \label{1.1.1} + \end{minipage} +\end{figure} + +\subsubsection{Проверка бита с установкой его в единицу} +Операция проверяет бит в RB по адресу из RA, устанавливает флаг CF, если значение бита в операнде 1, значение бита в операнде устанавливается в 1 + +\begin{figure}[H] + \centering + \makecell{ + Пример 1: \\ + $RA = 0000$ \\ + $RB = 0001$ \\ + $CF = 1$ \\ + $RB = 0001$ + } + \makecell{ + Пример 2: \\ + $RA = 0001$ \\ + $RB = 0001$ \\ + $CF = 0$ \\ + $RB = 0011$ + } + \makecell{ + \begin{minipage}[t]{0.3\textwidth} + \centering + \includegraphics[width=\textwidth]{1.1.2.drawio} + \caption{Блок схема проверки бита с установкой в единицу} + \label{1.1.2} + \end{minipage} + } +\end{figure} + \end{document}