Browse Source

Added intro to Commodore 64 story, and kibibytes

tags/Issue-002
Kenneth John Odle 2 years ago
parent
commit
f73e78cb0a
  1. 99
      002/codex-002.tex

99
002/codex-002.tex

@ -81,6 +81,8 @@
% \begin{Verbatim}...\end{Verbatim} <-- Note the capitalization!
\usepackage{fancyvrb}
\raggedbottom
% Pictures!
\usepackage{tikz}
@ -125,6 +127,77 @@ Boring, early life stuff when my world smelled like sweat and disinfectant and r
\section{The Joy of Commodore 64}
The first computer I ever owned (and thus could use whenever I wanted to, provided it did not annoy the adults in the house) was a Commodore-64. (And yes, my use of this machine seemed to bug adults no end, and I have no idea why. I guess the same adults who thought it was a waste of time playing video games simply thought that a computer is another, more expensive type of video game. The lesson I learned here is to try to get some knowledge before you jump to criticism.) The ``64'' stood for 64 kilobytes, which was the amount of memory it had. If you've never heard of a kilobyte before, and are wondering how many megabytes that is, it's time for some math, and also introductory computer science.
Hold on. You've never heard of a \textit{kilobyte}? Wow, either we've really moved along, or I'm old, or both. Probably both. My knees hurt in the morning. Yeah, probably both.
Computers are just a series of switches. Each switch is a \textit{bit}. Eight bits make up a \textit{byte}, which is enough memory to remember a single character.\footnote{ See \href{https://web.stanford.edu/class/cs101/bits-bytes.html}{\texttt{https://web.stanford.edu/class/cs101/bits-bytes.html}} for more information.} Since each bit is just a one or a zero, there are 256 possible different characters you can record in a byte. (Mathematically, it works out to $ 2^n $ possible combinations. Since in this case $n=8$, then we have $2^8=256$ different combinations of ones and zeroes.\footnote{ To see the actual combinations, visit \href{https://user.eng.umd.edu/~nsw/chbe250/number.htm}{\texttt{https://user.eng.umd.edu/$\sim$nsw/chbe250/numbe \\ r.htm}}, and to see which characters those numbers translate to, see \href{https://www.rapidtables.com/code/text/ascii-table.html}{\texttt{https://www.rapidtables \\ .com/code/text/ascii-table.html}}.})
Time for some math, which looks like this:
\begin{scriptsize}
\begin{tabular}{r c c c c c l}
& & & & & 1~byte &= 8~bits \\
& & & 1 kb &=& 1,024 bytes &= 8,192 bits \\
& 1 MB &=& 1,024 kb &=& 1,048,576 bytes &= 8,388,608 bits \\
1 GB =& 1,024 MB &=& 1,048,576 kb &=& 1,073,741,824 bytes &= 8,589,934,592 bits
\end{tabular}
\end{scriptsize}
\bigskip
If you don't trust my math, check out \href{https://www.matisse.net/bitcalc/}{\texttt{https://www.matisse.net/bit \\ calc/}}, which is where I did this math. It's actually kind of fun, and they get bonus points for including the source code for the perl script behind this sorcery.
Anyway, I'm driving a laptop now that has 8 GB of memory in it. (And I've seriously considered upgrading it to 16 GB). A gigabyte is equal to 1,048,576 kilobytes. The math (and heck, let's use dimensional analysis because it's fun) looks like this:
\[
8\text{ GB} \times \frac{1,048,576 \text{ kb}}{1 \text{ GB}} \times \frac{1 \text{ Commodore 64}}{64 \text{ kb}} = 16,384 \text{ Commodore 64's}
\]
So the computer I'm on now has as much memory as 16,384 of the computer I had when I was 13 years old. If that doesn't seem like a lot to you, I paid \$175 for this computer (used) in 2016, and paid \$200 (new) for a Commodore 64 in 1981. That's \$3,276,800 in 1981 dollars, which is the equivalent of \$8,651,869.50 in 2016 dollars. I didn't have three million dollars when I was thirteen, and I certainly don't have over eight million dollars now. Sadly.\footnote{Check out \href{https://www.in2013dollars.com/us/inflation/1981}{\texttt{https://www.in2013dollars.com/us/inflation/1981}} for the actual numbers.}
\medskip
\hrule
\medskip
\textbf{Oh look, it's a diversion}
\begin{multicols}{2}
If you've studied the metric system, you know that \textit{kilo-} is a prefix that means a ``a thousand'' and \textit{mega-} is a prefix that means ``a million.''
Hold on. (Again.)
1,024 is \textit{not} a thousand, and 1,048,576 is \textit{not} a million. For my entire life, we've just walked right past this and pretended that we didn't notice. Doing science stuff? \textit{kilo} is a 1,000 and \textit{mega} is a million. Doing computer stuff? Then \textit{kilo} means 1,000\textit{ish} and \textit{mega} means a million\textit{ish}. Move along now, nothing to see here.
That discrepancy should bug you. It bugs me, but I also have bills to pay, so when someone asks ``\textit{how much} does it bug you?'' my honest answer is that I've worked hard to not let it bug me.
But still.
Fortunately, it also bugged the International Electrotechnical Commission (an international standards commission whose job it is to standardize things) enough so that they introduced a few new terms in 1998.\footnote{The standard is ISO/IEC 80000, section 13. This standard is all about the International System of Quantities, and if you're into that sort of thing, it is utterly \textit{fascinating} reading.} \textbf{Kibibyte} means \textit{exactly} 1,024 bytes, and not one byte more, not one byte less. \textbf{Mebibyte} is exactly 1,048,576 bytes. And so on with gibibytes, tebibytes, and pebibytes. They are all some form of $2^n$, which means they \textit{accurately} describe just how many bytes we're talking about here.
The following table is filled with so much beauty:
\begin{small}
\begin{align*}
1~kibibyte~(ki) &= 1,024~bytes \\
1~mebibyte~(Mi) &= 1,024^2~bytes \\
1~gibibyte~(Gi) &= 1,024^3~bytes \\
1~tebibyte~(Ti) &= 1,024^4~bytes \\
1~pebibyte~(Pi) &= 1,024^5~bytes
\end{align*}
\end{small}
I can at last sleep soundly.
\end{multicols}
\medskip
\hrule
\medskip
\section{High School Computer Class}
\chapter{A Scanner Clearly, or More Thoughts on Being an Archivist}
@ -341,11 +414,17 @@ Because a thing seems difficult for you, do not think it impossible for anyone t
As a big part of the reason I created this was to learn more about LaTeX, I'm keeping up with this running list.
\begin{enumerate}
\item Need a little horizontal space? Use \verb|\hphantom{<stuff>}| where \texttt{<stuff>} is any standard unit. (I use this down below to separate the two images with borders when they are on the same line.)\footnote{There is more information on spacing at \href{https://latexref.xyz/Spaces.html}{\texttt{https://latexref.xyz/Spaces.html}}.}
\item Need a little horizontal space? Use \verb|\hphantom{<stuff>}| where \texttt{<stuff>} is any standard unit. (I use this down below to separate the two images with borders when they are on the same line.)\footnote{There is more information on spacing at \href{https://latexref.xyz/Spaces.html}{\texttt{https://latexref.xyz/Spaces.html}} and also at \href{https://tex.stackexchange.com/questions/74353/what-commands-are-there-for-horizontal-spacing/74354}{\texttt{https://tex.stackexchange.com/questions/74353/what-commands-are-there-for-horizontal-spacing/74354}}.}
\item Need a box around an \verb|\includegraphics[scale=•]{}| item? Just wrap it in \verb|\frame{}|. (Ditto.)
\item Want a blockquote? Use the \texttt{quote} environment. (I wrapped mine in a \texttt{small} environment to help set it off, as most blockquotes or indented quotations use a slightly smaller font.\footnote{Yes, it bugs me when people use the word \textit{quote} as a noun, but the usage is here to stay, so I shall learn to live (somewhat begrudgingly) with it.})
\item Want a blockquote? Use the \texttt{quote} environment. (I wrapped mine in a \texttt{small} environment to help set it off, as most blockquotes or indented quotations use a slightly smaller font in traditional printed material.\footnote{Yes, it bugs me when people use the word \textit{quote} as a noun, but the usage is here to stay, so I shall learn to live (somewhat begrudgingly) with it.})
\item You can draw with the \texttt{tikz} package. You can also draw chemical structures with the \texttt{chemdraw} package. I have no idea how to write about those things on paper in an interesting way, so it may be some time (or never---never is always an option) before I get around to that. But there's an example at the end.
\item You can also draw just using the \texttt{picture} environment. \footnote{There is a good tutorial at \href{https://www.overleaf.com/learn/latex/Picture_environment}{\texttt{https://www.overleaf.com/learn/latex/Picture\_environ \\ ment}}.}
\item As with most things that *nix-based, there is usually more than one way to get to where you are going. Often, there are many ways, and they lead you down paths you hadn't even imagined. A little research goes a long way. (See the next two sections as examples of this. I had not even thought about this before I sat down to write this.)
\end{enumerate}
@ -508,7 +587,7 @@ I didn't draw this. It's an example I got from \href{https://texample.net//tikz/
\node [font=\Large] {\LaTeX};
\end{tikzpicture}
I am very comfortable living in the center of that Venn diagram.
I am very comfortable living in the center of that Venn diagram. \\ (And yes, I played around with that code to make it a bit \\ smaller---as one does.)
\end{center}
\bigskip
@ -530,12 +609,12 @@ Yeah, I've got a ways to go. (If you couldn't tell, it's a house with a floating
Now that I look at my code, I realize why my roof is floating. Here's my original code:
\begin{Verbatim}[numbers=left,numbersep=-2pt]
\begin{tikzpicture}
\draw (0,0) rectangle (1.8cm, 1.8cm);
\draw (1.6,0) rectangle (1.1cm, 1.3cm);
\draw (0.8,1) rectangle (0.3cm, 0.6cm);
\draw (2,2) node{} -- (1,2.5) node{} -- (0,2);
\end{tikzpicture}
\begin{tikzpicture}
\draw (0,0) rectangle (1.8cm, 1.8cm);
\draw (1.6,0) rectangle (1.1cm, 1.3cm);
\draw (0.8,1) rectangle (0.3cm, 0.6cm);
\draw (2,2) node{} -- (1,2.5) node{} -- (0,2);
\end{tikzpicture}
\end{Verbatim}
Lines 2-3 draw the rectangle, and line 4 draws the triangle. Apparently, I resized the house and forgot to resize the roof. If I change line four to this:
@ -555,7 +634,7 @@ Lines 2-3 draw the rectangle, and line 4 draws the triangle. Apparently, I resiz
\end{tikzpicture}
\end{center}
\noindent Well, time to stop playing and get back to work.
\noindent Word of advice: only change one variable at a time. Anyway, time to stop playing and get back to work.
\end{document}
Loading…
Cancel
Save