Files
lab/circuit/25-2/course_project/main.tex
2025-11-24 19:15:45 +03:00

235 lines
8.8 KiB
TeX
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

\documentclass[12pt,a4paper,oneside]{article}
\usepackage[a4paper,left=2cm,right=1cm,top=2cm,bottom=2cm]{geometry}
\usepackage{polyglossia}
\setmainlanguage{russian}
\PolyglossiaSetup{russian}{indentfirst=true}
\usepackage{fontspec}
\defaultfontfeatures{Mapping=tex-text}
\setmainfont{Times New Roman}
\setromanfont{Times New Roman}
\setsansfont{Arial}
\setmonofont{Courier New}
\usepackage{amsmath}
\newfontfamily{\cyrillicfont}{Times New Roman}
\newfontfamily{\cyrillicfontrm}{Times New Roman}
\newfontfamily{\cyrillicfonttt}{Courier New}
\newfontfamily{\cyrillicfontsf}{Arial}
\usepackage{graphicx}
\graphicspath{{img/}}
\usepackage{float}
\floatstyle{plaintop}
\restylefloat{table}
\usepackage{makecell}
\usepackage[table]{xcolor}
\begin{document}
\begin{titlepage}
\begin{center}
\begin{large}
Национальный исследовательский ядерный университет <<МИФИ>> \\
\vspace{0.25cm}
Институт интеллектуальных кибернетических систем \\
\vspace{0.25cm}
Кафедра №12 <<Компьютерные системы и технологии>>
\end{large}
\vspace*{1cm}
\begin{figure}[H]
\centering
\begin{minipage}[c]{0.2\textwidth}
\includegraphics[width=\textwidth]{logo_university}
\end{minipage}
\hfill
\begin{minipage}[c]{0.1\textwidth}
\includegraphics[width=\textwidth]{logo_institute}
\end{minipage}
\hfill
\begin{minipage}[c]{0.3\textwidth}
\includegraphics[width=\textwidth]{logo_department}
\end{minipage}
\end{figure}
\vspace{4cm}
\begin{huge}
\textbf{Курсовой проект}
\end{huge}
\begin{large}
\textbf{<<Проектирование процессора>>}
\end{large}
\vfill
\begin{flushright}
\begin{tabular}{ r l }
\textbf{удент:} & Литвинов В.\,А. \\
\textbf{Группа:} & Б23-503 \\
\textbf{Преподаватель:} & Ядыкин И.\,М. \\
\end{tabular}
\end{flushright}
Москва --- 2025/2026
\end{center}
\end{titlepage}
\setcounter{page}{2}
\tableofcontents
\newpage
\section{Проектирование блока операций}
\subsection{Примеры и алгоритмы выполнения операций}
\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^{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]{bo-mut}
\caption{Блок схема умножения}
\label{bo-mut}
\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]{bo-set}
\caption{Блок схема проверки бита с установкой в единицу}
\label{bo-set}
\end{minipage}
}
\end{figure}
\newpage
\subsection{Функциональная схема блока операций}
Функциональная схема блока операций представлена на рис. \ref{bo-func}
\begin{figure}[H]
\centering
\begin{minipage}[t]{\textwidth}
\centering
\includegraphics[width=\textwidth]{bo-func}
\caption{Блок схема умножения}
\label{bo-func}
\end{minipage}
\end{figure}
В таблице \ref{bo-table} приведены все элементы функциональной схемы блока операций
\begin{figure}[H]
\centering
\begin{minipage}[t]{\textwidth}
\centering
\begin{tabular}{|p{0.1\textwidth}|p{0.4\textwidth}|p{0.4\textwidth}|}
Обознач & Назначение УМНОЖЕНИЕ & ПРОВЕРКА БИТА \\ \hline
RA & Регистр 1-го операнда, 4 разряда, множимое, параллельная загрузка, хранение & позиция бита, параллельная загрузка \\ \hline
RB & Регистр 2-го операнда, 4 разряда, множитель, параллельная загрузка, хранение & регистр данных, параллельная загрузка \\ \hline
RR & Регистр результата, 8 разрядов, параллельная загрузка, хранение, сдвиг вправо на 1 разряд & новое значение регистра RB, 4 разряда, параллельная загрузка, хранение \\ \hline
RPR & & Регистр флага CF, 1 разряд, параллельная загрузка, хранение \\ \hline
& &
\end{tabular}
\caption{Элементы функциональной схемы}
\label{bo-table}
\end{minipage}
\end{figure}
\end{document}