diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md deleted file mode 100644 index 8a83e85f..00000000 --- a/.github/pull_request_template.md +++ /dev/null @@ -1,15 +0,0 @@ -# Prerequisite Checklist - - - -- [ ] Read the [contribution guidelines](https://github.com/open-education-hub/oer-template/blob/main/CONTRIBUTING.md#pull-requests) regarding submitting new changes to the project; -- [ ] Tested your changes against relevant architectures and platforms; -- [ ] Updated relevant documentation (if needed). - -## Description of changes - - diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml deleted file mode 100644 index 9e25a1f3..00000000 --- a/.github/workflows/actions.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Linter Actions Workflow - -on: - pull_request: - branches: - - main - -jobs: - checkpatch: - name: Checkpatch - runs-on: ubuntu-latest - steps: - - name: Checkpatch - uses: open-education-hub/actions/checkpatch@main - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - super-linter: - name: Super Linter - runs-on: ubuntu-latest - steps: - - name: Super Linter - uses: open-education-hub/actions/super-linter@main - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - spellcheck: - name: Spellcheck - runs-on: ubuntu-latest - steps: - - name: Spellcheck - uses: open-education-hub/actions/spellcheck@main - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/slides/courses/1/components.tex b/slides/courses/1/components.tex index 0ffeb0d7..7b50ab26 100644 --- a/slides/courses/1/components.tex +++ b/slides/courses/1/components.tex @@ -95,5 +95,5 @@ \centering \scalebox{0.8}{\usebox{\asciiplcomp}} \end{figure} - Rolul limbajelor de programare este de a crea iluzia unei ierarhi de calculatoare virtuale. -\end{frame} \ No newline at end of file + Rolul limbajelor de programare este de a crea iluzia unei ierarhii de calculatoare virtuale. +\end{frame} diff --git a/slides/courses/1/functional.tex b/slides/courses/1/functional.tex index 39c43717..21bf0915 100644 --- a/slides/courses/1/functional.tex +++ b/slides/courses/1/functional.tex @@ -1,7 +1,7 @@ \begin{frame} \frametitle{Niveluri funcționale ale unui CN} \begin{enumerate} - \item Dispozitve și circuite electronice (Transiztoare, portți logice) - hardware + \item Dispozitve și circuite electronice (Tranzistoare, porți logice) - hardware \item Unități funcționale (UAL, Memorie, Interfețe) - firmware (Micropgramare) + hardware \item Mașină fizică Strcuturi de interconectare și echipamente periferice - hardware \item Nucleul sistem de operare - BIOS - firmware @@ -28,4 +28,4 @@ \item Tendința actuală este de a trece cât mai multe funcții în hardware \end{itemize} -\end{frame} \ No newline at end of file +\end{frame} diff --git a/slides/courses/2/intro.tex b/slides/courses/2/intro.tex new file mode 100644 index 00000000..ce548304 --- /dev/null +++ b/slides/courses/2/intro.tex @@ -0,0 +1,79 @@ +\begin{frame} + \frametitle{Information Representation} + \begin{itemize} + \item Decimal + \item Binary + \item Hexadecimal + \end{itemize} + \note{ + } +\end{frame} + +\begin{frame} + \frametitle{Information Representation} + + \begin{table}[h!] + \centering + \scalebox{0.8}{ + \begin{tabular}{|c|c|c|} + \hline + \textbf{Decimal} & \textbf{Binary} & \textbf{Hexadecimal} \\ + \hline + 0 & 0000 & 0x0 \\ + 1 & 0001 & 0x1 \\ + 2 & 0010 & 0x2 \\ + 3 & 0011 & 0x3 \\ + 4 & 0100 & 0x4 \\ + 5 & 0101 & 0x5 \\ + 6 & 0110 & 0x6 \\ + 7 & 0111 & 0x7 \\ + 8 & 1000 & 0x8 \\ + 9 & 1001 & 0x9 \\ + 10 & 1010 & 0xA \\ + 11 & 1011 & 0xB \\ + 12 & 1100 & 0xC \\ + 13 & 1101 & 0xD \\ + 14 & 1110 & 0xE \\ + 15 & 1111 & 0xF \\ + \hline + \end{tabular} + } + \caption{Decimal, Binary, and Hexadecimal Values} + \label{tab:binary_decimal_hexadecimal} + \end{table} + + \note{ + } +\end{frame} + + +\begin{frame} + \frametitle{Information Representation} +\end{frame} + +\begin{frame} + \frametitle{Big Endian vs Little Endian} + \begin{itemize} + \item Big Endian + \begin{itemize} + \item Most significant byte first + \item Network byte order + \item Example: 0x12345678 is stored as 0x12 0x34 0x56 0x78 + \end{itemize} + \item Little Endian + \begin{itemize} + \item Least significant byte first + \item Intel byte order + \item Example: 0x12345678 is stored as 0x78 0x56 0x34 0x12 + \end{itemize} + \end{itemize} +\end{frame} + + + + +\begin{frame} + \frametitle{Exam Question} + Given the following hexadecimal number $0x3A2E$ in big endian format, convert it to binary and decimal. + $0x3A2E = 0011\ 1010\ \ 0010\ 1110 = (3 * 16 + 10) * 2^8 + (2 * 16 + 14) = 58 * 256 + 46 = 14894$ +\end{frame} diff --git a/slides/courses/2/main.tex b/slides/courses/2/main.tex new file mode 100644 index 00000000..0a94ae14 --- /dev/null +++ b/slides/courses/2/main.tex @@ -0,0 +1,113 @@ +%\documentclass[notes,usenames,dvipsnames]{beamer} +%\documentclass[notes]{beamer} % print frame + notes +%\documentclass[notes=only]{beamer} % only notes +\documentclass[usenames,dvipsnames]{beamer} % only frames +\usepackage{pgfpages} +%\setbeameroption{show notes on second screen} +%\setbeameroption{show notes} +%subfigures +\usepackage{caption} +\usepackage{subcaption} + +%tables packages +\usepackage{multirow} + +% math +\usepackage{amsmath} + +% bash command +\usepackage{graphicx} +\usepackage{listings} +% varbatim for ascii figures +\usepackage[T1]{fontenc} +\usepackage[utf8]{inputenc} +%\usepackage{verbatim} +\usepackage{lipsum} % for context +\usepackage{fancyvrb} +\usepackage{varwidth} + + +\newsavebox{\asciigcn} + +% notes prefixed in pympress +\addtobeamertemplate{note page}{}{\thispdfpagelabel{notes:\insertframenumber}} +%theme used +\usetheme{Madrid} +%Information to be included in the title page: +\title[Computer Architecture] %optional +{Computer Architecture} + +\subtitle{Course no. 2 - Information Representation} + +\author[Ștefan-Dan Ciocîrlan] % (optional, for multiple authors) +{} + +\institute[NUSTPB] % (optional) +{ + \inst{}% + National University of Science and Technology\\ + POLITEHNICA Bucharest +} + +\date[NUSTPB 2024] % (optional) +{Computer Architecture} + +\logo{ +\includegraphics[height=0.9cm]{../../media/LOGO_UNSTPB_en.png} +\includegraphics[height=0.9cm]{../../media/logoACSQ.jpeg} +} + + +% Roman numerals +\newcommand*{\rom}[1]{\expandafter\@slowromancap\romannumeral #1@} +%split +\usepackage{amsmath} +%colors +%\usepackage[usenames,dvipsnames]{color} %loaded by the dcoument class +%subfigure +\usepackage{subcaption} +% block over block uncover +\setbeamercovered{invisible} +%\setbeamercovered{transparent} + +%extra slide content +\AtBeginSection[] +{ + \begin{frame} + \frametitle{Content} + \tableofcontents[currentsection] + \end{frame} +} +%notes or not +%\setbeamertemplate{note page}[plain] + +\begin{document} + +\frame{\titlepage} + +\section{Information Representation} +\input{intro.tex} + +\section{Textual Representation Systems} +\input{text.tex} + +\section{Number Representation Systems} +\input{number.tex} + +%\section{Image Representation Systems} +%\input{image.tex} + +%\section{Audio Representation Systems} +%\input{audio.tex} + +\section{Q\&A} +\begin{frame} +\end{frame} + +%\begin{frame} +%\frametitle{Table of Contents} +%\tableofcontents +%\end{frame} + + +\end{document} \ No newline at end of file diff --git a/slides/courses/2/media/International_Morse_Code.png b/slides/courses/2/media/International_Morse_Code.png new file mode 100644 index 00000000..2cf3c590 Binary files /dev/null and b/slides/courses/2/media/International_Morse_Code.png differ diff --git a/slides/courses/2/media/Morse_code_tree3.png b/slides/courses/2/media/Morse_code_tree3.png new file mode 100644 index 00000000..8321065a Binary files /dev/null and b/slides/courses/2/media/Morse_code_tree3.png differ diff --git a/slides/courses/2/media/add.jpg b/slides/courses/2/media/add.jpg new file mode 100644 index 00000000..90c1d192 Binary files /dev/null and b/slides/courses/2/media/add.jpg differ diff --git a/slides/courses/2/media/mul.jpg b/slides/courses/2/media/mul.jpg new file mode 100644 index 00000000..8b4af37e Binary files /dev/null and b/slides/courses/2/media/mul.jpg differ diff --git a/slides/courses/2/number.tex b/slides/courses/2/number.tex new file mode 100644 index 00000000..5a67c8cc --- /dev/null +++ b/slides/courses/2/number.tex @@ -0,0 +1,434 @@ +\subsection{Integer} + +\begin{frame} + \frametitle{Unary} + Number of consecutive 1 bits with 0 as the last bit + \begin{equation} + \begin{aligned} + &\text{Binary}\textsubscript{x}=\textcolor{black}{b\textsubscript{n-1}b\textsubscript{n-2}...b\textsubscript{1}b\textsubscript{0}}\\ + &b\textsubscript{i}= + \begin{cases} + 1,& \text{if } x\geq i+1\\ + 0, & \text{otherwise} + \end{cases} + \end{aligned} + \end{equation} +\end{frame} + + +\begin{frame} + \frametitle{Binary} + The number representation in base 2 + \begin{equation} + \begin{aligned} + &\text{Binary}\textsubscript{x}=\textcolor{black}{b\textsubscript{n-1}b\textsubscript{n-2}...b\textsubscript{1}b\textsubscript{0}}\\ + &x=\sum_{i=0}^{n-1} b_i \times 2^i + \end{aligned} + \end{equation} +\end{frame} + +\begin{frame} + \frametitle{Sign magnitude} + The binary number representation system with a sign bit + \begin{equation} + \begin{aligned} + &\text{Binary}\textsubscript{x}=\textcolor{red}{s}\textcolor{black}{b\textsubscript{n-2}b\textsubscript{n-3}...b\textsubscript{1}b\textsubscript{0}}\\ + &x=(-1)^{\textcolor{red}{s}} \times \sum_{i=0}^{n-2} b_i \times 2^i + \end{aligned} + \end{equation} +\end{frame} + +\begin{frame} + \frametitle{One's complement} + The bynary number representation with one's complement + \begin{equation} + \begin{aligned} + &\text{Binary}\textsubscript{x}=\textcolor{red}{s}\textcolor{black}{b\textsubscript{n-2}b\textsubscript{n-3}...b\textsubscript{1}b\textsubscript{0}}\\ + &x=\begin{cases} + \sum_{i=0}^{n-2} b_i \times 2^i,& \text{if \textcolor{red}{sign} positive} \\ + (-1) \times \sum_{i=0}^{n-2} \overline{b_i} \times 2^i, & \text{otherwise} + \end{cases} + \end{aligned} + \end{equation} +\end{frame} + +\begin{frame} + \frametitle{Two's complement} + The binary number representation with two's complement + \begin{equation} + \begin{aligned} + &\text{Binary}\textsubscript{x}=\textcolor{red}{s}\textcolor{black}{b\textsubscript{n-2}b\textsubscript{n-3}...b\textsubscript{1}b\textsubscript{0}}\\ + &x=\begin{cases} + \sum_{i=0}^{n-2} b_i \times 2^i,& \text{if \textcolor{red}{sign} positive} \\ + (-1) \times ((\sum_{i=0}^{n-2} \overline{b_i} \times 2^i) + 1), & \text{otherwise} + \end{cases} + \end{aligned} + \end{equation} +\end{frame} + +\begin{frame} + \frametitle{Bias} + The binary number representation with bias + \begin{equation} + \begin{aligned} + &\text{Binary}\textsubscript{x}=\textcolor{black}{b\textsubscript{n-1}b\textsubscript{n-2}...b\textsubscript{1}b\textsubscript{0}}\\ + &\text{Bias}=2^{n-1}-1\\ + &x=(\sum_{i=0}^{n-1} b_i \times 2^i) - \text{Bias} + \end{aligned} + \end{equation} +\end{frame} + +\begin{frame} + \frametitle{Unary negative} + \begin{equation} + \begin{aligned} + &\text{Binary}\textsubscript{x}=\textcolor{black}{b\textsubscript{n-1}b\textsubscript{n-2}...b\textsubscript{1}b\textsubscript{0}}\\ + &b\textsubscript{i}= + \begin{cases} + 1, & \text{if } (x\geq i \text{ and } x \geq 0) \text{ or } (|x| \leq i \text{ and } x < 0)\\ + 0,& \text{otherwise}\\ + \end{cases} + \end{aligned} + \end{equation} +\end{frame} + +\begin{frame} + \frametitle{Unary} +\end{frame} + +\subsection{Fractional} +\begin{frame} + \frametitle{Fractional} + Fractional numbers as $Q(ns, ds)$, where $ns$ is the numerator size and $ds$ is the denominator size. + \begin{equation} + \begin{aligned} + &\text{Binary}\textsubscript{x}=\textcolor{red}{s}\textcolor{black}{n\textsubscript{ns-2}n\textsubscript{ns-3}...n\textsubscript{1}n\textsubscript{0}}\textcolor{orange}{d\textsubscript{ds-1}d\textsubscript{ds-2}...d\textsubscript{1}d\textsubscript{0}}\\ + &x=(-1)^{\textcolor{red}{s}} \times \frac{\sum_{i=0}^{ns-2} n_i \times 2^i}{\textcolor{orange}{\sum_{i=0}^{ds-1} d_i \times 2^i}} + \end{aligned} + \end{equation} +\end{frame} + +\begin{frame} + \frametitle{Fractional} +\end{frame} + +\subsection{Fixed Point} +\begin{frame} + \frametitle{Fixed Point} + Fixed point numbers as $FP(is, fs)$, where $is$ is the integer part size and $fs$ is the fractional part size. + \begin{equation} + \begin{aligned} + &\text{Binary}\textsubscript{x}=\textcolor{red}{s}\textcolor{black}{i\textsubscript{is-2}i\textsubscript{is-3}...i\textsubscript{1}i\textsubscript{0}}\textcolor{orange}{f\textsubscript{fs-1}f\textsubscript{fs-2}...f\textsubscript{1}f\textsubscript{0}}\\ + &x=\begin{cases} + (\sum_{j=0}^{is-2} i_j \times 2^j) + \textcolor{orange}{(\sum_{j=0}^{fs-1} f_j \times 2^{j-fs})},& \text{if \textcolor{red}{sign} positive} \\ + (-1) \times ((\sum_{j=0}^{is-2} \overline{i}_j \times 2^j) + \textcolor{orange}{(\sum_{j=0}^{fs-1} \overline{f}_j \times 2^{j-fs})} + \frac{1}{ \textcolor{orange}{2^{fs}}}), & \text{otherwise} + \end{cases} + \end{aligned} + \end{equation} +\end{frame} + + +\begin{frame} + \frametitle{Fixed Point} +\end{frame} + +\subsection{Floating Point} +\begin{frame} + \frametitle{Simple Floating Point} + Simple floating point numbers as $FloatP(es, fs)$, where $es$ is the exponent size and $fs$ is the fractional part size (mantissa). + $x=(-1)^{\text{sign}} \times 2^{\text{exponent}} \times 1.f$. + \begin{equation} + \begin{aligned} + \text{Binary}\textsubscript{x}&=\textcolor{red}{s}\textcolor{ForestGreen}{e\textsubscript{es-1}e\textsubscript{es-2}...e\textsubscript{1}e\textsubscript{0}}\textcolor{orange}{m\textsubscript{fs-1}m\textsubscript{fs-2}...m\textsubscript{1}m\textsubscript{0}}\\ + \text{Bias}&=2^{es-1}-1\\ + e&=\textcolor{ForestGreen}{\sum_{i=0}^{es-1} e_i \times 2^{i}} - \text{Bias}\\ + x&=(-1)^{\textcolor{red}{s}} \times \begin{cases} + 0, \text{if } \forall\ i