Skip to content
Snippets Groups Projects
Commit 72b175c7 authored by Peter Gerwinski's avatar Peter Gerwinski
Browse files

Beispiele und Übungsaufgaben 9.7.2024

parent 56c7df18
No related branches found
No related tags found
No related merge requests found
cassini/home/peter/bo/2024ss/rtech/20240709> echo "Schöne Grüße aus Mülheim!" | recode latin1..utf8
Schöne GrüÃe aus Mülheim!
cassini/home/peter/bo/2024ss/rtech/20240709> echo "Schöne Grüße aus Mülheim!" | hexdump -C 00000000 53 63 68 c3 b6 6e 65 20 47 72 c3 bc c3 9f 65 20 |Sch..ne Gr....e |
00000010 61 75 73 20 4d c3 bc 6c 68 65 69 6d 21 0a |aus M..lheim!.|
0000001e
cassini/home/peter/bo/2024ss/rtech/20240709> echo "Schöne Grüße aus Mülheim!" | recode latin1..utf8 | hexdump -C
00000000 53 63 68 c3 83 c2 b6 6e 65 20 47 72 c3 83 c2 bc |Sch....ne Gr....|
00000010 c3 83 c2 9f 65 20 61 75 73 20 4d c3 83 c2 bc 6c |....e aus M....l|
00000020 68 65 69 6d 21 0a |heim!.|
00000026
cassini/home/peter/bo/2024ss/rtech/20240709>
File added
% pgscript.sty - LaTeX Settings for Lecture Notes
% Copyright (C) 2012, 2015, 2017, 2018 Peter Gerwinski
%
% This document is free software: you can redistribute it and/or
% modify it either under the terms of the Creative Commons
% Attribution-ShareAlike 3.0 License, or under the terms of the
% GNU General Public License as published by the Free Software
% Foundation, either version 3 of the License, or (at your option)
% any later version.
%
% This document is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with this document. If not, see <http://www.gnu.org/licenses/>.
%
% You should have received a copy of the Creative Commons
% Attribution-ShareAlike 3.0 Unported License along with this
% document. If not, see <http://creativecommons.org/licenses/>.
\usepackage{amsfonts}
\usepackage[colorlinks,allcolors=blue]{hyperref}
\usepackage[british,german]{babel} % Yes, really "german" and not "ngerman".
\usepackage[utf8]{luainputenc} % Without this, umlauts are broken. Weird.
\usepackage{microtype}
\usepackage[T1]{fontenc}
\usepackage{times}
\usepackage{helvet}
\renewcommand*\familydefault{\sfdefault}
\usepackage{graphicx}
\usepackage{ifluatex}
\usepackage{xcolor}
\usepackage{enumerate}
\usepackage{ifthen}
%% Repair kerning: Automatically insert "\kern{-0.15em}" between "//" % (in URLs).
%% PG20151206: This seems unnecessary here. Maybe due to \sf?
%\ifluatex
%\directlua{
% local glyph = node.id ("glyph")
% local function my_kerning (head)
% for t in node.traverse (head) do
% if t.id == glyph and t.char == 47 then
% if t.next
% and t.next.next
% and t.next.next.id == glyph
% and t.next.next.char == 47 then
% local k = node.new ("kern")
% k.kern = tex.sp ("-0.15em")
% k.next = t.next
% k.prev = t
% t.next.prev = k
% t.next = k
% end
% end
% end
% node.kerning (head)
% end
% luatexbase.add_to_callback ("kerning", my_kerning, "URL kerning")
%}
%\fi
\definecolor{blendedblue}{rgb}{0.2,0.2,0.7}
\definecolor{darkgreen}{rgb}{0.0,0.3,0.0}
\definecolor{darkred}{rgb}{0.7,0.0,0.0}
\definecolor{darkgrey}{rgb}{0.4,0.4,0.4}
\newcommand{\breath}{\bigskip\goodbreak}
\newcommand{\subsubsubsection}[1]{\breath\par\textbf{#1}\nopagebreak\par}
\newenvironment{experts}{\color{darkgrey}}{}
\newenvironment{whiteout}{\definecolor{darkgreen}{rgb}{1.0,1.0,1.0}%
\definecolor{darkred}{rgb}{1.0,1.0,1.0}%
\color{white}}{}
\newenvironment{hint}{%
\begin{quote}
\addtolength{\leftskip}{0.6cm}%
% \includegraphics[width=1cm]{Zeichen_101_-_Gefahrstelle,_StVO_1970.pdf}
\makebox(0,0)[r]{\includegraphics[width=1cm]{Zeichen_101_-_Gefahrstelle,_StVO_1970.pdf}\hspace*{0.5em}}%
% \hangindent 1.2cm
% \hangafter 2
\bfseries
% Foobar Foobar Foobar Foobar Foobar Foobar Foobar Foobar
% Foobar Foobar Foobar Foobar Foobar Foobar Foobar Foobar
% Foobar Foobar Foobar Foobar Foobar Foobar Foobar Foobar
% Foobar Foobar Foobar Foobar Foobar Foobar Foobar Foobar
\ignorespaces
}{%
\end{quote}
}
\urlstyle{sf}
\newcommand{\file}[1]{{\color{blendedblue}#1}}
\newcommand{\textarrow}{{\boldmath $\longrightarrow$}}
\newcommand{\arrowitem}{\item[\textarrow]}
\newcommand{\newterm}[1]{\emph{\color{darkgreen}#1}}
\newcounter{exercise}
\newcommand{\exercise}[1]{\addtocounter{exercise}{1}\subsection*{Aufgabe \arabic{exercise}: #1}}
\newcommand{\solution}{\subsubsection*{Lösung}}
\newcounter{points}
\newcommand{\points}[1]{\ifthenelse{#1=1}{(1 Punkt)}{(#1 Punkte)}\addtocounter{points}{#1}}
\newcommand{\gitfile}[3]{\href{https://gitlab.cvh-server.de/pgerwinski/#1/raw/#2/#3}{\file{#3}}}
\usepackage{listings}
\lstset{basicstyle=\color{blendedblue},
language=C,
captionpos=b,
gobble=4,
xleftmargin=1em,
columns=fullflexible,
moredelim=**[is][\color{red}]{¡}{¿}}
\lstdefinestyle{numbered}{xleftmargin=2em,
numbers=left,
numberstyle=\footnotesize\color{gray}}
\lstdefinestyle{terminal}{basicstyle=\ttfamily\color{darkgreen},
language={},
columns=fixed,
moredelim=**[is][\color{darkred}]{¡}{¿},
moredelim=**[is][\color{blendedblue}]{°}{¿},
moredelim=**[is][\sffamily\it\lstset{columns=fullflexible}]{²}{¿}}
\lstdefinestyle{cmd}{basicstyle=\ttfamily\color{darkred},
language={},
columns=fixed,
moredelim=**[is][\color{darkgreen}]{¡}{¿},
moredelim=**[is][\color{blendedblue}]{°}{¿},
moredelim=**[is][\sffamily\it\lstset{columns=fullflexible}]{²}{¿}}
\setlength{\textwidth}{16.5cm}
\setlength{\textheight}{26.0cm}
\setlength{\hoffset}{-1.5cm}
\setlength{\voffset}{-3.0cm}
\setlength{\parindent}{0pt}
\setlength{\parskip}{\medskipamount}
\setlength{\unitlength}{1cm}
File added
% rtech-uebung-20240709.pdf - Exercises on Computer Technology
% Copyright (C) 2024 Peter Gerwinski
%
% This document is free software: you can redistribute it and/or
% modify it either under the terms of the Creative Commons
% Attribution-ShareAlike 3.0 License, or under the terms of the
% GNU General Public License as published by the Free Software
% Foundation, either version 3 of the License, or (at your option)
% any later version.
%
% This document is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with this document. If not, see <http://www.gnu.org/licenses/>.
%
% You should have received a copy of the Creative Commons
% Attribution-ShareAlike 3.0 Unported License along with this
% document. If not, see <http://creativecommons.org/licenses/>.
% README: Tankstelle
\documentclass[a4paper]{article}
\usepackage{pgscript}
\usepackage{tikz}
\begin{document}
\thispagestyle{empty}
\section*{Rechnertechnik\\
Übungsaufgaben -- 9.\ Juli 2024}
\exercise{Instruktions-Pipelining an einer Tankstelle}
An einer abgelegenen Tankstelle mit je einer Zapfsäule für Benzin und Diesel
ist ein Zapfschlauch defekt.
Bis Ersatz da ist, wird der verbliebene Zapfschlauch ("`Pipeline"')
abwechselnd für beide Treibstoffsorten eingesetzt.
Hierzu muß er vollständig entleert, umgebaut und wieder befüllt werden.
Der Betreiber der Tankstelle weiß nicht im voraus,
welche Treibstoffsorte als nächstes verlangt werden wird ("`Kontrollflußkonflikt"'),
und überlegt sich drei mögliche Strategien:
\begin{enumerate}[(a)]
\item
Schlauch immer für Benzin anschließen,\\
nötigenfalls auf Diesel umbauen und hinterher wieder zurück.\\
(Zweigvorhersage: "`Niemals springen."')
\item
Schlauch immer für Diesel anschließen,\\
nötigenfalls auf Benzin umbauen und hinterher wieder zurück.\\
(Zweigvorhersage: "`Immer springen."')
\item
Schlauch zu Tagesbeginn für Benzin anschließen\\
und immer erst umbauen, wenn der Kunde seinen Wunsch geäußert hat.\\
(Zweigvorhersage mittels Branch History Table: "`Wie beim letzten Mal."')
\end{enumerate}
Als Test-Szenario nehmen wir an, daß über den Tag verteilt insgesamt 10 Kunden kommen,
von denen der dritte, vierte und siebte Diesel
und alle anderen Benzin tanken wollen.
Jeder Kunde tankt 40 Liter Treibstoff;
% Volumen des Schlauchs:
% 3.14159 * 0.15^2 * 50 = 3.534288750
in den Zapfschlauch passen 4 Liter.
Berechnen Sie für alle drei Szenarien das Verhältnis (in Prozent) zwischen
dem Treibstoff, der beim Entleeren des Zapfschlauchs aufgefangen werden muß ("`ungenutzte Taktzyklen"')
und dem verkauften Treibstoff ("`genutzte Taktzyklen"').
(4 Punkte pro Szenario)
\addtocounter{points}{12}
\makeatletter
\immediate\write\@mainaux{\string\gdef\string\totalpoints{\arabic{points}}}
\makeatother
\end{document}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment