add transcription profile

master
Tait Hoyem 2 years ago
commit 7bac3778d0

3
.gitignore vendored

@ -56,3 +56,6 @@ build-iPhoneSimulator/
# .rubocop-https?--*
.jekyll-cache
# Seperate private repository for work
/transcriptions/

@ -2,6 +2,7 @@ plugins:
- jekyll-katex
- jekyll-minifier
- kramdown-math-katex
- jekyll-katex
highlihger: rouge

@ -1,7 +1,7 @@
- company: "Zone4 Systems Inc."
position: "Software Developer"
years: "June 2021-present"
description: "Software development and QA (testing) for an international race timing company based in Canmore, AB. Testing using unittest and Selenium. Development done in Javascript and Tornado. Zone4 was founded in 2001 by Canadian Olympian Dan Roycroft.."
description: "Software development and QA (testing) for an international race timing company based in Canmore, AB. Testing using unittest and Selenium. Development done in Javascript and Tornado. Zone4 was founded in 2001 by Canadian Olympian Dan Roycroft."
- company: "Bytetools Technologies Inc."
position: "Founder"
years: "2020-present"

@ -1,30 +1,24 @@
- name: "Quote Retrieval System"
link: "https://github.com/TTWNO/quote_pdf"
description: "Written for a local roofing business to securely distribute quotes."
- name: "Yggdrasil Screen Reader"
- name: "Odilia Screen Reader"
link: "https://yggdrasil-sr.github.io/"
description: "Some small pieces of code I've written have made it into a new screen reader for Linux, written in Rust."
description: "Significant contributor to a new screen reader for Linux, written in the Rust programming language."
- name: "Programming Tutorials For The Visually Impaired"
link: "/emacspeak-tutorials/"
description: "Amateur-level production quality videos with all file buffers, written text, and shell commands read out by <a href=\"http://emacspeak.sourceforge.net/\">Emacspeak</a>, an Emacs extention for the blind."
- name: "Simple Markdown Editor"
link: "https://tait.tech/md/"
description: "A simple online (and offline) browser-based markdown editor that supports the automatic creation of accessible math (MathML)."
- name: "Lichess"
link: "https://github.com/ornicar/lila/pull/7772"
description: "A patch for Lichess.org which vastly extends support for screen reader users. The website has millions of active players."
- name: "Quote Retrieval System"
link: "https://github.com/TTWNO/quote_pdf"
description: "Written for a local roofing business to securely distribute quotes."
- name: "epub-with-pinyin"
link: "https://github.com/TTWNO/epub-with-pinyin"
description: "A program to add Pinyin above Chinese characters in .epub files to assist those learning Mandarin Chinese."
- name: "Programming Tutorials For The Visually Impaired"
link: "/emacspeak-tutorials/"
description: "Amateur-level production quality videos with all file buffers, written text, and shell commands read out by <a href=\"http://emacspeak.sourceforge.net/\">Emacspeak</a>, an Emacs extention for the blind."
- name: "lamegames"
link: "https://github.com/TTWNO/lamegames.io"
description: "A little games website I made for some demonstrations of Django and websocket functionality. Very, very lame. Would not recommend."
- name: "chess"
link: "https://github.com/TTWNO/chess"
description: "A command-line chess game in C++. It is compileable on nearly any system."
- name: "Emacspeak C Tutorials"
link: "https://tait.tech/emacspeak-tutorials/"
description: "C Tutorials for the Visually Impaired"
- name: "Simple Markdown Editor"
link: "https://tait.tech/md/"
description: "A simple online (and offline) browser-based markdown editor that supports the automatic creation of MathML."
#- name: "Emacspeak C Tutorials"
# link: "https://tait.tech/emacspeak-tutorials/"
# description: "C Tutorials for the Visually Impaired"

@ -3,6 +3,7 @@
<head>
<meta charset="UTF-8">
<title>{{ page.title }} | tait.tech</title>
<<<<<<< HEAD
<link rel="stylesheet" href="/assets/css/style.css" id="main-stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{%- if page.math -%}
@ -13,14 +14,34 @@
<link rel="stylesheet" href="/assets/css/highlight.css" id="code-stylesheet">
{% endif %}
{% contentblock extrahead %}
=======
<link rel="stylesheet" href="/assets/css/style.css" id="main-css">
<link rel="stylesheet" href="/assets/css/transcription.css" id="trans-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/js/"></script>
{% if page.math %}
<link rel="stylesheet" href="/assets/css/katex.css" id="math-css">
{% endif %}
{% if page.code %}
<link rel="stylesheet" href="/assets/css/highlighting.css" id="code-css">
{% endif %}
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</head>
<body>
<main>
<div id="wrapper">
{{ content }}
<<<<<<< HEAD
<footer>
</footer>
</div>
</main>
=======
</div>
</main>
<hr>
<footer>
</footer>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</body>
</html>

@ -0,0 +1,3 @@
table {
table-layout: fixed;
}

@ -0,0 +1,3 @@
table { table-layout: fixed; }
/*# sourceMappingURL=transcription.css.map */

@ -0,0 +1,14 @@
{
"version": 3,
"file": "transcription.css",
"sources": [
"transcription.scss",
"_sass/transcription.scss"
],
"sourcesContent": [
"@import \"transcription\"\n",
"table {\n table-layout: fixed;\n}\n"
],
"names": [],
"mappings": "ACAA,AAAA,KAAK,CAAC,EACJ,YAAY,EAAE,KAAK,GACpB"
}

@ -33,7 +33,7 @@
<article>
<header>
<h1 class="post-title">Canadian History For Dummies</h1>
<time datetime="21-11-16" class="post-date">Tuesday, November 16 2021</time>
<time datetime="21-11-25" class="post-date">Thursday, November 25 2021</time>
</header>
<hr>

@ -1,6 +1,12 @@
<<<<<<< HEAD
<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="4.2.1">Jekyll</generator><link href="http://localhost:4000/feed.xml" rel="self" type="application/atom+xml" /><link href="http://localhost:4000/" rel="alternate" type="text/html" /><updated>2021-11-28T18:08:20-07:00</updated><id>http://localhost:4000/feed.xml</id><entry><title type="html">How To Produce Semantically Correct MathML From XaTeX/LaTeX (and other accessibility ideas)</title><link href="http://localhost:4000/2021/09/18/how-to-generate-proper-content-mathml-from-katex-or-latex/" rel="alternate" type="text/html" title="How To Produce Semantically Correct MathML From XaTeX/LaTeX (and other accessibility ideas)" /><published>2021-09-18T00:00:00-06:00</published><updated>2021-09-18T00:00:00-06:00</updated><id>http://localhost:4000/2021/09/18/how-to-generate-proper-content-mathml-from-katex-or-latex</id><content type="html" xml:base="http://localhost:4000/2021/09/18/how-to-generate-proper-content-mathml-from-katex-or-latex/">During a recent run-in with the Simon Fraser Fraser University accessibility department,
I learned that they&apos;re writers are so well-trained as to write &quot;image&quot; where a simple diagram is shown,
and &quot;print out picture of output&quot; where a piece of code lies.
=======
<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="4.2.0">Jekyll</generator><link href="/feed.xml" rel="self" type="application/atom+xml" /><link href="/" rel="alternate" type="text/html" /><updated>2021-11-25T21:47:55-07:00</updated><id>/feed.xml</id><entry><title type="html">How To Produce Semantically Correct MathML From XaTeX/LaTeX (and other accessibility ideas)</title><link href="/2021/09/18/how-to-generate-proper-content-mathml-from-katex-or-latex/" rel="alternate" type="text/html" title="How To Produce Semantically Correct MathML From XaTeX/LaTeX (and other accessibility ideas)" /><published>2021-09-18T00:00:00-06:00</published><updated>2021-09-18T00:00:00-06:00</updated><id>/2021/09/18/how-to-generate-proper-content-mathml-from-katex-or-latex</id><content type="html" xml:base="/2021/09/18/how-to-generate-proper-content-mathml-from-katex-or-latex/">&lt;p&gt;During a recent run-in with the Simon Fraser Fraser University accessibility department,
I learned that theyre writers are so well-trained as to write “image” where a simple diagram is shown,
and “print out picture of output” where a piece of code lies.
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
I figure the geniuses over there could use some help creating files for the visually impaired.
Here&apos;s a quick guide!

@ -99,6 +99,10 @@ This should be quite simple given how easy the lichess API is, and the <a href="
<li>The list of servers will be updated manually with <code class="language-plaintext highlighter-rouge">bt update</code>.</li>
</ul>
<p>I love this idea, but unfortunately, Canada has data retention laws that would stop me from protecting the privacy of anyone using a system delivered by me.
Unless I incorporate in Switzerland or the Seychelles, this is not a viable option.
Doing the above costs a fair amount in up-front investment that I am not willing to make at this point in time.</p>
<h2 id="5-3d-printing-of-google-mapsopenstreetmaps-data-for-the-visually-impaired">5. 3d printing of Google Maps/OpenStreetMaps data for the visually impaired.</h2>
<p>A larger project, to be sure, but one I think could be of interest.
@ -125,6 +129,57 @@ Then, add 4 more roads and figure out how to intersect them.</p>
<p>This is being worked on through the <a href="https://github.com/skarkkai/touch-mapper">touch-mapper</a> project.
They do not, however, have labels yet.</p>
<h2 id="6-3d-printed-binary-trees">6. 3D Printed Binary Trees</h2>
<p>A simple hub/connection system to connect nodes of a binary tree together to have a physical object for visually impaired computer science students to use for initial introduction into the subject of (binary) trees.</p>
<h2 id="65-javascript-binary-trees">6.5 Javascript Binary Trees</h2>
<p>Have a simple module for loading in an SVG of a tree, along with Javascript to make the diagram accessible by jumping left/right with the arrow keys and up to a parent with the up arrow.</p>
<h2 id="7-legopi-powered-logic-gates">7. Lego/Pi-Powered Logic Gates</h2>
<p>Lego or 3d printed logic gates with physical switches for in and out.
Again, sore of as an introductory tool for blind students learning computer science.</p>
<h2 id="8-more-tutorialsmaterials">8. More Tutorials/Materials</h2>
<p>Perhaps a broader selection of materials for computer science students with proper transcriptions for everything in this list:</p>
<ul>
<li>UML diagrams</li>
<li>UML sequence diagrams</li>
<li>Gantt charts</li>
<li>Advanced math equations</li>
<li>Stacks, Queues and Linked Lists</li>
<li>Memory layout tables</li>
<li>Logic gate diagrams</li>
<li>Decision charts; I think I could add some macros on top of</li>
<li>Timing diagrams (i.e., watching the state of various inputs and outputs over time [usually in relation to a clock cycle]); my current idea for this is a dynamic audiogram where you can listen to the clock + any other tracks at the same time to “see” the diagram</li>
<li>Circuit diagrams (not 100% relevant, but I have seen it in CS courses)</li>
<li>Database tables as HTML tables</li>
<li>Properly transcribed security content like buffer-overflows, underflows and similar things</li>
</ul>
<p>Although developing these is good, I think it is worthwhile to also create tools that make creation of these easier for both sighted and blind individuals.
This will make it easier for course transcribers who are not tech-savy and will enable the blind student to create the diagrams and send them back to their teachers.
Preferably have a “plain text” version which can be rendered as an SVG for use by visual learners, then make sure the SVG can be accessible with a Javascript hook.
This would (in theory) make it possible for a teacher to create the graphic in the specialized tool for that kind of chart, put it in their slides/course info/textbook/whatever and have the student able to extract the SVG and paste it somewhere where a script could make it readable.
Yes, the best case is the teacher cooperates 100%, but considering that is never the case, I figure making it easier to convert between the two is the best I can hope for.</p>
<p>Some other things I would like to do, if I could find the time:</p>
<ul>
<li>How to get started with Linux.</li>
<li>Text-based tutorials from start-to-finish with various frameworks: SpringBoot (Java), Django/Flask (Python), JavaEE.</li>
<li>Specific programming language instruction in all the basics: C/C++, Bash, Python, Javascript, HTML, Java. Perhaps in the future branch into Rust, Golang, Zig or Haskell.</li>
<li>Custom-made braille manuals for a set of affordable computer parts which can be purchased to assemble a computer from scratch, without sighted assistance (see <a href="/2021/06/21/uefi-audio/">current status of accessible BIOSes</a>).</li>
</ul>
<p>This would all be licensed as CC-BY-NC-SA.
I may drop the NC. As long as I have specified SA, then anyone (even for-profit companies) can use it as long as any changes are shared to the public as well.</p>
</main>
<hr>
<footer>

@ -50,55 +50,49 @@ I have all of my code projects hosted on <a href="https://github.com/TTWNO">my G
<li>
<p>
<a class="namelink" href="https://github.com/TTWNO/quote_pdf">Quote Retrieval System</a> &mdash; Written for a local roofing business to securely distribute quotes.
<a class="namelink" href="https://yggdrasil-sr.github.io/">Odilia Screen Reader</a> &mdash; Significant contributor to a new screen reader for Linux, written in the Rust programming language.
</p>
</li>
<li>
<p>
<a class="namelink" href="https://yggdrasil-sr.github.io/">Yggdrasil Screen Reader</a> &mdash; Some small pieces of code I've written have made it into a new screen reader for Linux, written in Rust.
</p>
</li>
<li>
<p>
<a class="namelink" href="https://github.com/ornicar/lila/pull/7772">Lichess</a> &mdash; A patch for Lichess.org which vastly extends support for screen reader users. The website has millions of active players.
<a class="namelink" href="/emacspeak-tutorials/">Programming Tutorials For The Visually Impaired</a> &mdash; Amateur-level production quality videos with all file buffers, written text, and shell commands read out by <a href="http://emacspeak.sourceforge.net/">Emacspeak</a>, an Emacs extention for the blind.
</p>
</li>
<li>
<p>
<a class="namelink" href="https://github.com/TTWNO/epub-with-pinyin">epub-with-pinyin</a> &mdash; A program to add Pinyin above Chinese characters in .epub files to assist those learning Mandarin Chinese.
<a class="namelink" href="https://tait.tech/md/">Simple Markdown Editor</a> &mdash; A simple online (and offline) browser-based markdown editor that supports the automatic creation of accessible math (MathML).
</p>
</li>
<li>
<p>
<a class="namelink" href="/emacspeak-tutorials/">Programming Tutorials For The Visually Impaired</a> &mdash; Amateur-level production quality videos with all file buffers, written text, and shell commands read out by <a href="http://emacspeak.sourceforge.net/">Emacspeak</a>, an Emacs extention for the blind.
<a class="namelink" href="https://github.com/ornicar/lila/pull/7772">Lichess</a> &mdash; A patch for Lichess.org which vastly extends support for screen reader users. The website has millions of active players.
</p>
</li>
<li>
<p>
<a class="namelink" href="https://github.com/TTWNO/lamegames.io">lamegames</a> &mdash; A little games website I made for some demonstrations of Django and websocket functionality. Very, very lame. Would not recommend.
<a class="namelink" href="https://github.com/TTWNO/quote_pdf">Quote Retrieval System</a> &mdash; Written for a local roofing business to securely distribute quotes.
</p>
</li>
<li>
<p>
<a class="namelink" href="https://github.com/TTWNO/chess">chess</a> &mdash; A command-line chess game in C++. It is compileable on nearly any system.
<a class="namelink" href="https://github.com/TTWNO/epub-with-pinyin">epub-with-pinyin</a> &mdash; A program to add Pinyin above Chinese characters in .epub files to assist those learning Mandarin Chinese.
</p>
</li>
<li>
<p>
<a class="namelink" href="https://tait.tech/emacspeak-tutorials/">Emacspeak C Tutorials</a> &mdash; C Tutorials for the Visually Impaired
<a class="namelink" href="https://github.com/TTWNO/lamegames.io">lamegames</a> &mdash; A little games website I made for some demonstrations of Django and websocket functionality. Very, very lame. Would not recommend.
</p>
</li>
<li>
<p>
<a class="namelink" href="https://tait.tech/md/">Simple Markdown Editor</a> &mdash; A simple online (and offline) browser-based markdown editor that supports the automatic creation of MathML.
<a class="namelink" href="https://github.com/TTWNO/chess">chess</a> &mdash; A command-line chess game in C++. It is compileable on nearly any system.
</p>
</li>

@ -19,7 +19,7 @@
<li>
<strong>Zone4 Systems Inc.</strong> &mdash; <em>Software Developer</em> (June 2021-present)
<p>Software development and QA (testing) for an international race timing company based in Canmore, AB. Testing using unittest and Selenium. Development done in Javascript and Tornado. Zone4 was founded in 2001 by Canadian Olympian Dan Roycroft..</p>
<p>Software development and QA (testing) for an international race timing company based in Canmore, AB. Testing using unittest and Selenium. Development done in Javascript and Tornado. Zone4 was founded in 2001 by Canadian Olympian Dan Roycroft.</p>
</li>
<li>
@ -85,15 +85,21 @@
<ul class="clear-list">
<li>
<strong><a href="https://github.com/TTWNO/quote_pdf">Quote Retrieval System</a></strong>
<strong><a href="https://yggdrasil-sr.github.io/">Odilia Screen Reader</a></strong>
<p>Written for a local roofing business to securely distribute quotes.</p>
<p>Significant contributor to a new screen reader for Linux, written in the Rust programming language.</p>
</li>
<li>
<strong><a href="https://yggdrasil-sr.github.io/">Yggdrasil Screen Reader</a></strong>
<strong><a href="/emacspeak-tutorials/">Programming Tutorials For The Visually Impaired</a></strong>
<p>Some small pieces of code I've written have made it into a new screen reader for Linux, written in Rust.</p>
<p>Amateur-level production quality videos with all file buffers, written text, and shell commands read out by <a href="http://emacspeak.sourceforge.net/">Emacspeak</a>, an Emacs extention for the blind.</p>
</li>
<li>
<strong><a href="https://tait.tech/md/">Simple Markdown Editor</a></strong>
<p>A simple online (and offline) browser-based markdown editor that supports the automatic creation of accessible math (MathML).</p>
</li>
<li>
@ -103,15 +109,15 @@
</li>
<li>
<strong><a href="https://github.com/TTWNO/epub-with-pinyin">epub-with-pinyin</a></strong>
<strong><a href="https://github.com/TTWNO/quote_pdf">Quote Retrieval System</a></strong>
<p>A program to add Pinyin above Chinese characters in .epub files to assist those learning Mandarin Chinese.</p>
<p>Written for a local roofing business to securely distribute quotes.</p>
</li>
<li>
<strong><a href="/emacspeak-tutorials/">Programming Tutorials For The Visually Impaired</a></strong>
<strong><a href="https://github.com/TTWNO/epub-with-pinyin">epub-with-pinyin</a></strong>
<p>Amateur-level production quality videos with all file buffers, written text, and shell commands read out by <a href="http://emacspeak.sourceforge.net/">Emacspeak</a>, an Emacs extention for the blind.</p>
<p>A program to add Pinyin above Chinese characters in .epub files to assist those learning Mandarin Chinese.</p>
</li>
<li>
@ -126,18 +132,6 @@
<p>A command-line chess game in C++. It is compileable on nearly any system.</p>
</li>
<li>
<strong><a href="https://tait.tech/emacspeak-tutorials/">Emacspeak C Tutorials</a></strong>
<p>C Tutorials for the Visually Impaired</p>
</li>
<li>
<strong><a href="https://tait.tech/md/">Simple Markdown Editor</a></strong>
<p>A simple online (and offline) browser-based markdown editor that supports the automatic creation of MathML.</p>
</li>
</ul>
<h2 id="skills">Skills</h2>

File diff suppressed because it is too large Load Diff

@ -0,0 +1,12 @@
#!/bin/bash
if [ -d "targe"t ]; then
rm -r ./target
fi
if [ -d "target_tmp" ]; then
rm -r ./target_tmp
fi
find ./src/ -name *md -exec ~/Documents/transcription-tools/create_html/save_html.sh '{}' ./target \;
./zip.sh

@ -3,10 +3,19 @@
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<<<<<<< HEAD
<link rel="stylesheet" href="/assets/css/style.css" id="main-stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
=======
<link rel="stylesheet" href="/assets/css/style.css" id="main-css">
<link rel="stylesheet" href="/assets/css/transcription.css" id="trans-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/js/"></script>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</head>
<body>
<main>
@ -143,9 +152,17 @@
<h2 id="end">End</h2>
<<<<<<< HEAD
<footer>
</footer>
</div>
</main>
=======
</div>
</main>
<hr>
<footer>
</footer>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</body>
</html>

@ -3,10 +3,19 @@
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<<<<<<< HEAD
<link rel="stylesheet" href="/assets/css/style.css" id="main-stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
=======
<link rel="stylesheet" href="/assets/css/style.css" id="main-css">
<link rel="stylesheet" href="/assets/css/transcription.css" id="trans-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/js/"></script>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</head>
<body>
<main>
@ -858,9 +867,17 @@ dequeue() { // removes front element of queue and returns it
<h2 id="end">End</h2>
<<<<<<< HEAD
<footer>
</footer>
</div>
</main>
=======
</div>
</main>
<hr>
<footer>
</footer>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</body>
</html>

@ -3,10 +3,19 @@
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<<<<<<< HEAD
<link rel="stylesheet" href="/assets/css/style.css" id="main-stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
=======
<link rel="stylesheet" href="/assets/css/style.css" id="main-css">
<link rel="stylesheet" href="/assets/css/transcription.css" id="trans-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/js/"></script>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</head>
<body>
<main>
@ -162,9 +171,17 @@
<h2 id="end">End</h2>
<<<<<<< HEAD
<footer>
</footer>
</div>
</main>
=======
</div>
</main>
<hr>
<footer>
</footer>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</body>
</html>

@ -3,11 +3,22 @@
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<<<<<<< HEAD
<link rel="stylesheet" href="/assets/css/style.css" id="main-stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0"><link rel="stylesheet" href="/assets/css/katex.css" id="math-stylesheet">
=======
<link rel="stylesheet" href="/assets/css/style.css" id="main-css">
<link rel="stylesheet" href="/assets/css/transcription.css" id="trans-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/js/"></script>
<link rel="stylesheet" href="/assets/css/katex.css" id="math-css">
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</head>
<body>
<main>
@ -91,9 +102,17 @@
<p>See <a href="./TestVector.cpp">TestVector.cpp</a></p>
<<<<<<< HEAD
<footer>
</footer>
</div>
</main>
=======
</div>
</main>
<hr>
<footer>
</footer>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</body>
</html>

@ -3,11 +3,22 @@
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<<<<<<< HEAD
<link rel="stylesheet" href="/assets/css/style.css" id="main-stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0"><link rel="stylesheet" href="/assets/css/katex.css" id="math-stylesheet">
=======
<link rel="stylesheet" href="/assets/css/style.css" id="main-css">
<link rel="stylesheet" href="/assets/css/transcription.css" id="trans-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/js/"></script>
<link rel="stylesheet" href="/assets/css/katex.css" id="math-css">
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</head>
<body>
<main>
@ -358,9 +369,17 @@ add/delete these as needed; link them all together to make the main object.</p>
<h2 id="end">End</h2>
<<<<<<< HEAD
<footer>
</footer>
</div>
</main>
=======
</div>
</main>
<hr>
<footer>
</footer>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</body>
</html>

@ -3,11 +3,22 @@
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<<<<<<< HEAD
<link rel="stylesheet" href="/assets/css/style.css" id="main-stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0"><link rel="stylesheet" href="/assets/css/katex.css" id="math-stylesheet">
=======
<link rel="stylesheet" href="/assets/css/style.css" id="main-css">
<link rel="stylesheet" href="/assets/css/transcription.css" id="trans-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/js/"></script>
<link rel="stylesheet" href="/assets/css/katex.css" id="math-css">
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</head>
<body>
<main>
@ -704,9 +715,17 @@ int main(){
<p>After the “End” slide, some previous slides are repeated for no apparent reason.</p>
<<<<<<< HEAD
<footer>
</footer>
</div>
</main>
=======
</div>
</main>
<hr>
<footer>
</footer>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</body>
</html>

@ -3,11 +3,22 @@
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<<<<<<< HEAD
<link rel="stylesheet" href="/assets/css/style.css" id="main-stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0"><link rel="stylesheet" href="/assets/css/katex.css" id="math-stylesheet">
=======
<link rel="stylesheet" href="/assets/css/style.css" id="main-css">
<link rel="stylesheet" href="/assets/css/transcription.css" id="trans-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/js/"></script>
<link rel="stylesheet" href="/assets/css/katex.css" id="math-css">
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</head>
<body>
<main>
@ -345,9 +356,17 @@ return value
<h2 id="end">End</h2>
<<<<<<< HEAD
<footer>
</footer>
</div>
</main>
=======
</div>
</main>
<hr>
<footer>
</footer>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</body>
</html>

@ -3,11 +3,22 @@
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<<<<<<< HEAD
<link rel="stylesheet" href="/assets/css/style.css" id="main-stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0"><link rel="stylesheet" href="/assets/css/katex.css" id="math-stylesheet">
=======
<link rel="stylesheet" href="/assets/css/style.css" id="main-css">
<link rel="stylesheet" href="/assets/css/transcription.css" id="trans-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/js/"></script>
<link rel="stylesheet" href="/assets/css/katex.css" id="math-css">
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</head>
<body>
<main>
@ -1115,9 +1126,17 @@ There is no reason for having any semantic markup for this.</p>
<h2 id="end">End</h2>
<<<<<<< HEAD
<footer>
</footer>
</div>
</main>
=======
</div>
</main>
<hr>
<footer>
</footer>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</body>
</html>

@ -3,11 +3,22 @@
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<<<<<<< HEAD
<link rel="stylesheet" href="/assets/css/style.css" id="main-stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0"><link rel="stylesheet" href="/assets/css/katex.css" id="math-stylesheet">
=======
<link rel="stylesheet" href="/assets/css/style.css" id="main-css">
<link rel="stylesheet" href="/assets/css/transcription.css" id="trans-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/js/"></script>
<link rel="stylesheet" href="/assets/css/katex.css" id="math-css">
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</head>
<body>
<main>
@ -463,9 +474,17 @@ h(v) = \begin{cases}
<p>…some repeated slides… unknown reason</p>
<<<<<<< HEAD
<footer>
</footer>
</div>
</main>
=======
</div>
</main>
<hr>
<footer>
</footer>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</body>
</html>

@ -3,11 +3,22 @@
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<<<<<<< HEAD
<link rel="stylesheet" href="/assets/css/style.css" id="main-stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0"><link rel="stylesheet" href="/assets/css/katex.css" id="math-stylesheet">
=======
<link rel="stylesheet" href="/assets/css/style.css" id="main-css">
<link rel="stylesheet" href="/assets/css/transcription.css" id="trans-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/js/"></script>
<link rel="stylesheet" href="/assets/css/katex.css" id="math-css">
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</head>
<body>
<main>
@ -150,9 +161,17 @@ f(n) = O(1) \iff \exists c&gt;0 \space \text{s.t.} \space f(n) &lt; c, \text{for
<h2 id="end">End</h2>
<<<<<<< HEAD
<footer>
</footer>
</div>
</main>
=======
</div>
</main>
<hr>
<footer>
</footer>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</body>
</html>

@ -3,11 +3,22 @@
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<<<<<<< HEAD
<link rel="stylesheet" href="/assets/css/style.css" id="main-stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0"><link rel="stylesheet" href="/assets/css/katex.css" id="math-stylesheet">
=======
<link rel="stylesheet" href="/assets/css/style.css" id="main-css">
<link rel="stylesheet" href="/assets/css/transcription.css" id="trans-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/js/"></script>
<link rel="stylesheet" href="/assets/css/katex.css" id="math-css">
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</head>
<body>
<main>
@ -2083,9 +2094,17 @@ ndoes (to get <span class="katex"><span class="katex-mathml"><math xmlns="http:/
<h2 id="actual-end">Actual end</h2>
<<<<<<< HEAD
<footer>
</footer>
</div>
</main>
=======
</div>
</main>
<hr>
<footer>
</footer>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</body>
</html>

@ -3,11 +3,22 @@
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<<<<<<< HEAD
<link rel="stylesheet" href="/assets/css/style.css" id="main-stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0"><link rel="stylesheet" href="/assets/css/katex.css" id="math-stylesheet">
=======
<link rel="stylesheet" href="/assets/css/style.css" id="main-css">
<link rel="stylesheet" href="/assets/css/transcription.css" id="trans-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/js/"></script>
<link rel="stylesheet" href="/assets/css/katex.css" id="math-css">
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</head>
<body>
<main>
@ -1785,9 +1796,17 @@ there is at most 1 unbalanced node, and it is on the path from the parent of the
<h2 id="end">End</h2>
<<<<<<< HEAD
<footer>
</footer>
</div>
</main>
=======
</div>
</main>
<hr>
<footer>
</footer>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</body>
</html>

@ -3,11 +3,22 @@
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<<<<<<< HEAD
<link rel="stylesheet" href="/assets/css/style.css" id="main-stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0"><link rel="stylesheet" href="/assets/css/katex.css" id="math-stylesheet">
=======
<link rel="stylesheet" href="/assets/css/style.css" id="main-css">
<link rel="stylesheet" href="/assets/css/transcription.css" id="trans-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/js/"></script>
<link rel="stylesheet" href="/assets/css/katex.css" id="math-css">
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</head>
<body>
<main>
@ -3523,9 +3534,17 @@ so we know <span class="katex"><span class="katex-mathml"><math xmlns="http://ww
<li>So order is OK, except possibly with ancestors of c, which we still must check.</li>
</ul>
<<<<<<< HEAD
<footer>
</footer>
</div>
</main>
=======
</div>
</main>
<hr>
<footer>
</footer>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</body>
</html>

@ -3,11 +3,22 @@
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<<<<<<< HEAD
<link rel="stylesheet" href="/assets/css/style.css" id="main-stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0"><link rel="stylesheet" href="/assets/css/katex.css" id="math-stylesheet">
=======
<link rel="stylesheet" href="/assets/css/style.css" id="main-css">
<link rel="stylesheet" href="/assets/css/transcription.css" id="trans-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/js/"></script>
<link rel="stylesheet" href="/assets/css/katex.css" id="math-css">
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</head>
<body>
<main>
@ -192,9 +203,17 @@ c times g is a red line which has a similar trajectory, but end up just slightly
<h2 id="end">End</h2>
<<<<<<< HEAD
<footer>
</footer>
</div>
</main>
=======
</div>
</main>
<hr>
<footer>
</footer>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</body>
</html>

@ -3,11 +3,22 @@
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<<<<<<< HEAD
<link rel="stylesheet" href="/assets/css/style.css" id="main-stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0"><link rel="stylesheet" href="/assets/css/katex.css" id="math-stylesheet">
=======
<link rel="stylesheet" href="/assets/css/style.css" id="main-css">
<link rel="stylesheet" href="/assets/css/transcription.css" id="trans-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/js/"></script>
<link rel="stylesheet" href="/assets/css/katex.css" id="math-css">
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</head>
<body>
<main>
@ -2091,9 +2102,17 @@ What if we exclude this case?)</p>
<h2 id="end">End</h2>
<<<<<<< HEAD
<footer>
</footer>
</div>
</main>
=======
</div>
</main>
<hr>
<footer>
</footer>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</body>
</html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -3,10 +3,19 @@
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<<<<<<< HEAD
<link rel="stylesheet" href="/assets/css/style.css" id="main-stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
=======
<link rel="stylesheet" href="/assets/css/style.css" id="main-css">
<link rel="stylesheet" href="/assets/css/transcription.css" id="trans-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/js/"></script>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</head>
<body>
<main>
@ -166,9 +175,17 @@ https://www2.cs.sfu.ca/CourseCentral/295/alavergn/index.html</li>
</ul>
<<<<<<< HEAD
<footer>
</footer>
</div>
</main>
=======
</div>
</main>
<hr>
<footer>
</footer>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</body>
</html>

@ -3,10 +3,19 @@
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<<<<<<< HEAD
<link rel="stylesheet" href="/assets/css/style.css" id="main-stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
=======
<link rel="stylesheet" href="/assets/css/style.css" id="main-css">
<link rel="stylesheet" href="/assets/css/transcription.css" id="trans-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/js/"></script>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</head>
<body>
<main>
@ -1208,9 +1217,17 @@ An output comes out the other side: 0/low.</p>
</li>
</ul>
<<<<<<< HEAD
<footer>
</footer>
</div>
</main>
=======
</div>
</main>
<hr>
<footer>
</footer>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</body>
</html>

@ -3,11 +3,22 @@
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<<<<<<< HEAD
<link rel="stylesheet" href="/assets/css/style.css" id="main-stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0"><link rel="stylesheet" href="/assets/css/katex.css" id="math-stylesheet">
=======
<link rel="stylesheet" href="/assets/css/style.css" id="main-css">
<link rel="stylesheet" href="/assets/css/transcription.css" id="trans-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/js/"></script>
<link rel="stylesheet" href="/assets/css/katex.css" id="math-css">
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</head>
<body>
<main>
@ -851,9 +862,17 @@ Both have same bit pattern, however, this bit pattern may be interpreted differe
</li>
</ul>
<<<<<<< HEAD
<footer>
</footer>
</div>
</main>
=======
</div>
</main>
<hr>
<footer>
</footer>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</body>
</html>

@ -3,11 +3,22 @@
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<<<<<<< HEAD
<link rel="stylesheet" href="/assets/css/style.css" id="main-stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0"><link rel="stylesheet" href="/assets/css/katex.css" id="math-stylesheet">
=======
<link rel="stylesheet" href="/assets/css/style.css" id="main-css">
<link rel="stylesheet" href="/assets/css/transcription.css" id="trans-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/js/"></script>
<link rel="stylesheet" href="/assets/css/katex.css" id="math-css">
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</head>
<body>
<main>
@ -578,9 +589,17 @@ Actual product is the result of multiplication with limited space.</p>
<p>Well illustrate what we covered today by having a demo!</p>
<<<<<<< HEAD
<footer>
</footer>
</div>
</main>
=======
</div>
</main>
<hr>
<footer>
</footer>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</body>
</html>

@ -3,11 +3,22 @@
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<<<<<<< HEAD
<link rel="stylesheet" href="/assets/css/style.css" id="main-stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0"><link rel="stylesheet" href="/assets/css/katex.css" id="math-stylesheet">
=======
<link rel="stylesheet" href="/assets/css/style.css" id="main-css">
<link rel="stylesheet" href="/assets/css/transcription.css" id="trans-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/js/"></script>
<link rel="stylesheet" href="/assets/css/katex.css" id="math-css">
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</head>
<body>
<main>
@ -760,9 +771,17 @@ First, last binary digit <em>after</em> the period are also MSb, LSb respectivel
</li>
</ul>
<<<<<<< HEAD
<footer>
</footer>
</div>
</main>
=======
</div>
</main>
<hr>
<footer>
</footer>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</body>
</html>

@ -3,11 +3,22 @@
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<<<<<<< HEAD
<link rel="stylesheet" href="/assets/css/style.css" id="main-stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0"><link rel="stylesheet" href="/assets/css/katex.css" id="math-stylesheet">
=======
<link rel="stylesheet" href="/assets/css/style.css" id="main-css">
<link rel="stylesheet" href="/assets/css/transcription.css" id="trans-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/js/"></script>
<link rel="stylesheet" href="/assets/css/katex.css" id="math-css">
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</head>
<body>
<main>
@ -592,9 +603,17 @@ V = (-1)^{s} M 2^{E}
</ul>
<<<<<<< HEAD
<footer>
</footer>
</div>
</main>
=======
</div>
</main>
<hr>
<footer>
</footer>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</body>
</html>

@ -3,11 +3,22 @@
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<<<<<<< HEAD
<link rel="stylesheet" href="/assets/css/style.css" id="main-stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0"><link rel="stylesheet" href="/assets/css/katex.css" id="math-stylesheet">
=======
<link rel="stylesheet" href="/assets/css/style.css" id="main-css">
<link rel="stylesheet" href="/assets/css/transcription.css" id="trans-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/js/"></script>
<link rel="stylesheet" href="/assets/css/katex.css" id="math-css">
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</head>
<body>
<main>
@ -727,9 +738,17 @@ This way, we can enumerate all values.</p>
<li>Floating-point data &amp; operations</li>
</ul>
<<<<<<< HEAD
<footer>
</footer>
</div>
</main>
=======
</div>
</main>
<hr>
<footer>
</footer>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</body>
</html>

@ -3,11 +3,22 @@
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<<<<<<< HEAD
<link rel="stylesheet" href="/assets/css/style.css" id="main-stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0"><link rel="stylesheet" href="/assets/css/katex.css" id="math-stylesheet">
=======
<link rel="stylesheet" href="/assets/css/style.css" id="main-css">
<link rel="stylesheet" href="/assets/css/transcription.css" id="trans-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/js/"></script>
<link rel="stylesheet" href="/assets/css/katex.css" id="math-css">
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</head>
<body>
<main>
@ -268,9 +279,17 @@ memory?</li>
</ul>
<<<<<<< HEAD
<footer>
</footer>
</div>
</main>
=======
</div>
</main>
<hr>
<footer>
</footer>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</body>
</html>

@ -3,11 +3,22 @@
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<<<<<<< HEAD
<link rel="stylesheet" href="/assets/css/style.css" id="main-stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0"><link rel="stylesheet" href="/assets/css/katex.css" id="math-stylesheet">
=======
<link rel="stylesheet" href="/assets/css/style.css" id="main-css">
<link rel="stylesheet" href="/assets/css/transcription.css" id="trans-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/js/"></script>
<link rel="stylesheet" href="/assets/css/katex.css" id="math-css">
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</head>
<body>
<main>
@ -777,9 +788,17 @@ data stored at address <code class="language-plaintext highlighter-rouge">0x0000
<li>Floating-point operations</li>
</ul>
<<<<<<< HEAD
<footer>
</footer>
</div>
</main>
=======
</div>
</main>
<hr>
<footer>
</footer>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</body>
</html>

@ -3,11 +3,22 @@
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<<<<<<< HEAD
<link rel="stylesheet" href="/assets/css/style.css" id="main-stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0"><link rel="stylesheet" href="/assets/css/katex.css" id="math-stylesheet">
=======
<link rel="stylesheet" href="/assets/css/style.css" id="main-css">
<link rel="stylesheet" href="/assets/css/transcription.css" id="trans-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/js/"></script>
<link rel="stylesheet" href="/assets/css/katex.css" id="math-css">
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</head>
<body>
<main>
@ -649,9 +660,17 @@ The symbols used in the document are: &amp;, | and ^ respectively.</p>
<li>Floating-point operations</li>
</ul>
<<<<<<< HEAD
<footer>
</footer>
</div>
</main>
=======
</div>
</main>
<hr>
<footer>
</footer>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</body>
</html>

@ -3,11 +3,22 @@
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<<<<<<< HEAD
<link rel="stylesheet" href="/assets/css/style.css" id="main-stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0"><link rel="stylesheet" href="/assets/css/katex.css" id="math-stylesheet">
=======
<link rel="stylesheet" href="/assets/css/style.css" id="main-css">
<link rel="stylesheet" href="/assets/css/transcription.css" id="trans-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/js/"></script>
<link rel="stylesheet" href="/assets/css/katex.css" id="math-css">
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</head>
<body>
<main>
@ -118,9 +129,17 @@ instructions of x86-64 assembly language</li>
<li>Floating-point operations</li>
</ul>
<<<<<<< HEAD
<footer>
</footer>
</div>
</main>
=======
</div>
</main>
<hr>
<footer>
</footer>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</body>
</html>

@ -3,11 +3,22 @@
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<<<<<<< HEAD
<link rel="stylesheet" href="/assets/css/style.css" id="main-stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0"><link rel="stylesheet" href="/assets/css/katex.css" id="math-stylesheet">
=======
<link rel="stylesheet" href="/assets/css/style.css" id="main-css">
<link rel="stylesheet" href="/assets/css/transcription.css" id="trans-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/js/"></script>
<link rel="stylesheet" href="/assets/css/katex.css" id="math-css">
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</head>
<body>
<main>
@ -320,9 +331,17 @@ endif:
</ul>
<<<<<<< HEAD
<footer>
</footer>
</div>
</main>
=======
</div>
</main>
<hr>
<footer>
</footer>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</body>
</html>

@ -3,11 +3,22 @@
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<<<<<<< HEAD
<link rel="stylesheet" href="/assets/css/style.css" id="main-stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0"><link rel="stylesheet" href="/assets/css/katex.css" id="math-stylesheet">
=======
<link rel="stylesheet" href="/assets/css/style.css" id="main-css">
<link rel="stylesheet" href="/assets/css/transcription.css" id="trans-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/js/"></script>
<link rel="stylesheet" href="/assets/css/katex.css" id="math-css">
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</head>
<body>
<main>
@ -440,9 +451,17 @@ can alter the execution flow of a program by using …
<li>Floating-point operations</li>
</ul>
<<<<<<< HEAD
<footer>
</footer>
</div>
</main>
=======
</div>
</main>
<hr>
<footer>
</footer>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</body>
</html>

@ -3,11 +3,22 @@
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<<<<<<< HEAD
<link rel="stylesheet" href="/assets/css/style.css" id="main-stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0"><link rel="stylesheet" href="/assets/css/katex.css" id="math-stylesheet">
=======
<link rel="stylesheet" href="/assets/css/style.css" id="main-css">
<link rel="stylesheet" href="/assets/css/transcription.css" id="trans-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/js/"></script>
<link rel="stylesheet" href="/assets/css/katex.css" id="math-css">
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</head>
<body>
<main>
@ -1033,9 +1044,17 @@ the stack and stored in PC</p>
</ul>
<<<<<<< HEAD
<footer>
</footer>
</div>
</main>
=======
</div>
</main>
<hr>
<footer>
</footer>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</body>
</html>

@ -3,10 +3,19 @@
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<<<<<<< HEAD
<link rel="stylesheet" href="/assets/css/style.css" id="main-stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
=======
<link rel="stylesheet" href="/assets/css/style.css" id="main-css">
<link rel="stylesheet" href="/assets/css/transcription.css" id="trans-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/js/"></script>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</head>
<body>
<main>
@ -217,9 +226,17 @@ local data on memory (stack)</li>
</ul>
<<<<<<< HEAD
<footer>
</footer>
</div>
</main>
=======
</div>
</main>
<hr>
<footer>
</footer>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</body>
</html>

@ -3,11 +3,22 @@
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<<<<<<< HEAD
<link rel="stylesheet" href="/assets/css/style.css" id="main-stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0"><link rel="stylesheet" href="/assets/css/katex.css" id="math-stylesheet">
=======
<link rel="stylesheet" href="/assets/css/style.css" id="main-css">
<link rel="stylesheet" href="/assets/css/transcription.css" id="trans-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/js/"></script>
<link rel="stylesheet" href="/assets/css/katex.css" id="math-css">
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</head>
<body>
<main>
@ -1715,9 +1726,17 @@ long mult2(long a, long b) {
<li>Floating-point operations</li>
</ul>
<<<<<<< HEAD
<footer>
</footer>
</div>
</main>
=======
</div>
</main>
<hr>
<footer>
</footer>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</body>
</html>

@ -3,11 +3,22 @@
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<<<<<<< HEAD
<link rel="stylesheet" href="/assets/css/style.css" id="main-stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0"><link rel="stylesheet" href="/assets/css/katex.css" id="math-stylesheet">
=======
<link rel="stylesheet" href="/assets/css/style.css" id="main-css">
<link rel="stylesheet" href="/assets/css/transcription.css" id="trans-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/js/"></script>
<link rel="stylesheet" href="/assets/css/katex.css" id="math-css">
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</head>
<body>
<main>
@ -16,9 +27,17 @@
<p>(Note: thats it, no slides)</p>
<<<<<<< HEAD
<footer>
</footer>
</div>
</main>
=======
</div>
</main>
<hr>
<footer>
</footer>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</body>
</html>

@ -3,10 +3,19 @@
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<<<<<<< HEAD
<link rel="stylesheet" href="/assets/css/style.css" id="main-stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
=======
<link rel="stylesheet" href="/assets/css/style.css" id="main-css">
<link rel="stylesheet" href="/assets/css/transcription.css" id="trans-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/js/"></script>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</head>
<body>
<main>
@ -597,9 +606,17 @@ pointer) during function call</p>
<li>Floating-point operations</li>
</ul>
<<<<<<< HEAD
<footer>
</footer>
</div>
</main>
=======
</div>
</main>
<hr>
<footer>
</footer>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</body>
</html>

@ -3,10 +3,19 @@
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<<<<<<< HEAD
<link rel="stylesheet" href="/assets/css/style.css" id="main-stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
=======
<link rel="stylesheet" href="/assets/css/style.css" id="main-css">
<link rel="stylesheet" href="/assets/css/transcription.css" id="trans-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/js/"></script>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</head>
<body>
<main>
@ -988,9 +997,17 @@ amI:
<li>Floating-point operations</li>
</ul>
<<<<<<< HEAD
<footer>
</footer>
</div>
</main>
=======
</div>
</main>
<hr>
<footer>
</footer>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</body>
</html>

@ -3,11 +3,22 @@
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<<<<<<< HEAD
<link rel="stylesheet" href="/assets/css/style.css" id="main-stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0"><link rel="stylesheet" href="/assets/css/katex.css" id="math-stylesheet">
=======
<link rel="stylesheet" href="/assets/css/style.css" id="main-css">
<link rel="stylesheet" href="/assets/css/transcription.css" id="trans-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/js/"></script>
<link rel="stylesheet" href="/assets/css/katex.css" id="math-css">
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</head>
<body>
<main>
@ -1171,9 +1182,17 @@ programming</li>
<li>Floating-point operations</li>
</ul>
<<<<<<< HEAD
<footer>
</footer>
</div>
</main>
=======
</div>
</main>
<hr>
<footer>
</footer>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</body>
</html>

@ -3,11 +3,22 @@
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<<<<<<< HEAD
<link rel="stylesheet" href="/assets/css/style.css" id="main-stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0"><link rel="stylesheet" href="/assets/css/katex.css" id="math-stylesheet">
=======
<link rel="stylesheet" href="/assets/css/style.css" id="main-css">
<link rel="stylesheet" href="/assets/css/transcription.css" id="trans-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/js/"></script>
<link rel="stylesheet" href="/assets/css/katex.css" id="math-css">
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</head>
<body>
<main>
@ -369,9 +380,17 @@ A + (i * C * L) + (j * L) =&gt; A + (i * C + j) * L</li>
<li>(highlighted) Floating-point operations</li>
</ul>
<<<<<<< HEAD
<footer>
</footer>
</div>
</main>
=======
</div>
</main>
<hr>
<footer>
</footer>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</body>
</html>

@ -3,11 +3,22 @@
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<<<<<<< HEAD
<link rel="stylesheet" href="/assets/css/style.css" id="main-stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0"><link rel="stylesheet" href="/assets/css/katex.css" id="math-stylesheet">
=======
<link rel="stylesheet" href="/assets/css/style.css" id="main-css">
<link rel="stylesheet" href="/assets/css/transcription.css" id="trans-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/js/"></script>
<link rel="stylesheet" href="/assets/css/katex.css" id="math-css">
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</head>
<body>
<main>
@ -1141,9 +1152,17 @@ assembly language instructions we have seen so far</li>
<li>Instruction Set Architecture (ISA)</li>
</ul>
<<<<<<< HEAD
<footer>
</footer>
</div>
</main>
=======
</div>
</main>
<hr>
<footer>
</footer>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</body>
</html>

@ -3,11 +3,22 @@
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<<<<<<< HEAD
<link rel="stylesheet" href="/assets/css/style.css" id="main-stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0"><link rel="stylesheet" href="/assets/css/katex.css" id="math-stylesheet">
=======
<link rel="stylesheet" href="/assets/css/style.css" id="main-css">
<link rel="stylesheet" href="/assets/css/transcription.css" id="trans-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/js/"></script>
<link rel="stylesheet" href="/assets/css/katex.css" id="math-css">
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</head>
<body>
<main>
@ -719,9 +730,17 @@ same location in the format</li>
</li>
</ul>
<<<<<<< HEAD
<footer>
</footer>
</div>
</main>
=======
</div>
</main>
<hr>
<footer>
</footer>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</body>
</html>

@ -3,11 +3,22 @@
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<<<<<<< HEAD
<link rel="stylesheet" href="/assets/css/style.css" id="main-stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0"><link rel="stylesheet" href="/assets/css/katex.css" id="math-stylesheet">
=======
<link rel="stylesheet" href="/assets/css/style.css" id="main-css">
<link rel="stylesheet" href="/assets/css/transcription.css" id="trans-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/js/"></script>
<link rel="stylesheet" href="/assets/css/katex.css" id="math-css">
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</head>
<body>
<main>
@ -877,9 +888,17 @@ formats ☺</li>
</li>
</ul>
<<<<<<< HEAD
<footer>
</footer>
</div>
</main>
=======
</div>
</main>
<hr>
<footer>
</footer>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</body>
</html>

@ -3,11 +3,22 @@
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<<<<<<< HEAD
<link rel="stylesheet" href="/assets/css/style.css" id="main-stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0"><link rel="stylesheet" href="/assets/css/katex.css" id="math-stylesheet">
=======
<link rel="stylesheet" href="/assets/css/style.css" id="main-css">
<link rel="stylesheet" href="/assets/css/transcription.css" id="trans-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/js/"></script>
<link rel="stylesheet" href="/assets/css/katex.css" id="math-css">
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</head>
<body>
<main>
@ -1302,9 +1313,17 @@ the number of memory accesses</li>
</ul>
<<<<<<< HEAD
<footer>
</footer>
</div>
</main>
=======
</div>
</main>
<hr>
<footer>
</footer>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</body>
</html>

@ -3,11 +3,22 @@
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<<<<<<< HEAD
<link rel="stylesheet" href="/assets/css/style.css" id="main-stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0"><link rel="stylesheet" href="/assets/css/katex.css" id="math-stylesheet">
=======
<link rel="stylesheet" href="/assets/css/style.css" id="main-css">
<link rel="stylesheet" href="/assets/css/transcription.css" id="trans-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/js/"></script>
<link rel="stylesheet" href="/assets/css/katex.css" id="math-css">
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</head>
<body>
<main>
@ -404,9 +415,17 @@ delay
</ul>
<<<<<<< HEAD
<footer>
</footer>
</div>
</main>
=======
</div>
</main>
<hr>
<footer>
</footer>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</body>
</html>

@ -3,11 +3,22 @@
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<<<<<<< HEAD
<link rel="stylesheet" href="/assets/css/style.css" id="main-stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0"><link rel="stylesheet" href="/assets/css/katex.css" id="math-stylesheet">
=======
<link rel="stylesheet" href="/assets/css/style.css" id="main-css">
<link rel="stylesheet" href="/assets/css/transcription.css" id="trans-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/js/"></script>
<link rel="stylesheet" href="/assets/css/katex.css" id="math-css">
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</head>
<body>
<main>
@ -415,8 +426,11 @@ where w is the number of bits
</li>
</ul>
<<<<<<< HEAD
<!--_-->
=======
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
<h3 id="end-diagram-of-alu">End diagram of ALU</h3>
<table>
@ -492,6 +506,7 @@ such as propagation delay</li>
</ul>
<h2 id="sequential-logic-circuit">Sequential logic circuit</h2>
<<<<<<< HEAD
<ul>
<li>Has a state -&gt; memory (it has internal storage)</li>
@ -513,10 +528,32 @@ such as propagation delay</li>
<li>Example of a sequential logic circuit is a
memory element</li>
<li>Simplest memory element: D-type flip-flop</li>
=======
<p>// TODO</p>
<ul>
<li>Has a state -&gt; memory (it has internal storage)</li>
<li>“Clocked”</li>
<li>
<p>Has at least 2 input:
*Data to be remembered and
*Clock</p>
</li>
<li>
<p>Has at least one output:
*Value remembered (during an earlier clock cycle)</p>
</li>
<li>Example of a sequential logic circuit is a
memory element</li>
<li>
<p>Simplest memory element: D-type flip-flop
15</p>
</li>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
<li>Example of memory element components
with which we are already familiar: registers</li>
</ul>
<<<<<<< HEAD
<h3 id="diagram-of-1g79">Diagram of 1G79</h3>
<p>Label: SINGLE POSITIVE-EDGE-TRIGGERED D-TYPE FLIP-FLOP.</p>
@ -571,11 +608,46 @@ with which we are already familiar: registers</li>
<p>Diagram of a “clocked register”.
It has two inputs, neither are labeled; a “CLOCK” label is on the bottom to denote an internal ticking; there is also one output, also unlabeled.</p>
=======
<h2 id="memory-elements-and-clock-signals">Memory elements and Clock signals</h2>
<ul>
<li>Memory element #1 -&gt; clocked registers a.k.a. hardware registers</li>
<li>On the microprocessor</li>
<li>
<p>A clocked register stores 1 bit (state)</p>
</li>
<li>Synchronized by system-wide clock</li>
</ul>
<p>clocked
register</p>
<ul>
<li>System-wide clock</li>
<li>A system-wide clock sends 0 1 0 1 0 1 0 1…</li>
<li>Clock period: 1 full cycle duration:</li>
<li>
<p>Clock frequency: 1/period</p>
</li>
<li>How clocked registers work:</li>
<li>
<p>Output current state</p>
</li>
<li>
<p>Input next state
16</p>
</li>
<li>Next state remembered only on rising edge of clock</li>
</ul>
<p>CLOCK</p>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
<h2 id="how-a-clocked-register-function">How a clocked register function!</h2>
<p>Function Table</p>
<<<<<<< HEAD
<table>
<thead>
<tr>
@ -795,5 +867,215 @@ computations on these values</li>
</footer>
</div>
</main>
=======
<p>Load D
0
1
1</p>
<p>Q(t + 1) -&gt; next state</p>
<p>X
0
1</p>
<p>Q(t) -&gt; current state
0
1</p>
<p>Load 1) 0</p>
<p>Load 1) 0
clocked
reg.</p>
<p>clocked
reg.</p>
<p>1) 0</p>
<p>17</p>
<p>D</p>
<p>1) Q(t)
Q
3) Q(t)</p>
<p>Load 1) 1</p>
<p>1) 1</p>
<p>D</p>
<p>1) Q(t)
Q
3) Q(t)</p>
<p>Load 1) 1</p>
<p>clocked
reg.</p>
<p>1) 0</p>
<p>D</p>
<p>1) Q(t)
Q
3) 0</p>
<p>clocked
reg.</p>
<p>1) 1</p>
<p>D</p>
<p>Q</p>
<p>1) Q(t)
3) 1</p>
<p>Clock</p>
<p>Clock</p>
<p>Clock</p>
<p>Clock</p>
<p>2) When the clock
“ticks”, i.e., when
edge of clock rises</p>
<p>2) When the clock
“ticks”, i.e., when
edge of clock rises</p>
<p>2) When the clock
“ticks”, i.e., when
edge of clock rises</p>
<p>2) When the clock
“ticks”, i.e., when
edge of clock rises</p>
<p>Row 1 of Function Table</p>
<p>Row 1 of Function Table</p>
<p>Row 2 of Function Table</p>
<p>Row 3 of Function Table</p>
<h2 id="d-flip-flop">D flip flop</h2>
<p>Edge-triggered
clock</p>
<p>Load</p>
<p>Timing Diagram</p>
<p>clocked
reg.</p>
<p>If clock period, then clock frequency is</p>
<p>Clock
Load</p>
<p>0</p>
<p>1</p>
<p>0</p>
<p>1</p>
<p>0</p>
<p>1</p>
<p>D
1</p>
<p>Q</p>
<p>Clock</p>
<p>0</p>
<p>D
Q
tpd for register</p>
<p>18</p>
<p>Function Table
Load
0
1
1</p>
<p>D
X
0
1</p>
<p>Q(t + 1)
Q(t)
0
1</p>
<h2 id="carnegie-mellon">Carnegie Mellon</h2>
<p>Summary</p>
<p>19</p>
<p> Combinational logic circuits
*Made of many logic gates
*Multi-functional combinational logic circuits such as
ALU have control input lines to indicate which
function to perform
*Combinational logic circuits do not store (remember)
values
 Sequential logic circuits
*Made of combinational logic circuits, memory
elements (clocked registers) and clock
*Circuit that “remembers” values (state) and perform
computations on these values</p>
<h2 id="next-lecture">Next Lecture</h2>
<ul>
<li>Instruction Set Architecture (ISA)</li>
<li>
<p>Definition of ISA</p>
</li>
<li>Instruction Set design</li>
<li>Design principles</li>
<li>Look at an example of an instruction set: MIPS</li>
<li>Create our own</li>
<li>
<p>ISA evaluation</p>
</li>
<li>Implementation of a microprocessor (CPU) based on an ISA</li>
<li>Execution of machine instructions (datapath)</li>
<li>Intro to logic design + Combinational logic + Sequential logic circuit</li>
<li>Sequential execution of machine instructions</li>
<li>Pipelined execution of machine instructions + Hazards
20</li>
</ul>
<p>##</p>
</div>
</main>
<hr>
<footer>
</footer>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</body>
</html>

@ -3,14 +3,24 @@
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<<<<<<< HEAD
<link rel="stylesheet" href="/assets/css/style.css" id="main-stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
=======
<link rel="stylesheet" href="/assets/css/style.css" id="main-css">
<link rel="stylesheet" href="/assets/css/transcription.css" id="trans-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/js/"></script>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</head>
<body>
<main>
<div id="wrapper">
<<<<<<< HEAD
<h1 id="cmpt-295---unit--microprocessor-design--instruction-execution">CMPT 295 - Unit Microprocessor Design &amp; Instruction Execution</h1>
<p>Lecture 29 - Sequential Logic Circuits and Sequential Execution</p>
@ -251,6 +261,288 @@ words of data</li>
<li>Use an address to select which of the many memory words
should be read or written</li>
</ul>
=======
<p>CMPT 295
Unit Microprocessor Design &amp; Instruction Execution</p>
<p>Lecture 29 Sequential Logic Circuits and Sequential Execution</p>
<p>1</p>
<h2 id="carnegie-mellon">Carnegie Mellon</h2>
<p>Last Lecture</p>
<p>2</p>
<p> Combinational logic circuits
*Made of many logic gates
*Multi-functional combinational logic circuits such as
ALU have control input lines to indicate which
function to perform
*Combinational logic circuits do not store (remember)
values
 Sequential logic circuits
*Made of combinational logic circuits, memory
elements (e.g., clocked registers) and clock
*Circuit that “remembers” values (state) and perform
computations on these values</p>
<h2 id="todays-menu">Todays Menu</h2>
<ul>
<li>Instruction Set Architecture (ISA)</li>
<li>
<p>Definition of ISA</p>
</li>
<li>Instruction Set design</li>
<li>Design principles</li>
<li>Look at an example of an instruction set: MIPS</li>
<li>Create our own</li>
<li>
<p>ISA evaluation</p>
</li>
<li>Implementation of a microprocessor (CPU) based on an ISA</li>
<li>Execution of machine instructions (datapath)</li>
<li>Intro to logic design + Combinational logic + Sequential logic circuit</li>
<li>Sequential execution of machine instructions</li>
<li>Pipelined execution of machine instructions + Hazards
3</li>
</ul>
<h2 id="about-the-word-register">About the word register</h2>
<ul>
<li>Warning: the word register can mean different things!
<ol>
<li>In hardware, a register is a hardware component
directly connected to the rest of the circuit by its
input and output lines (wires)
*Called hardware register or clocked register</li>
</ol>
</li>
</ul>
<ol>
<li>In machine-level programming, a register is one of
the addressable words in the CPU, i.e., in the register
file (e.g., %rdi, %rax, etc…)
*Called program register
4</li>
</ol>
<p>*Implemented using hardware/clocked registers</p>
<h2 id="memory-elements-and-clock-signals">Memory elements and Clock signals</h2>
<ul>
<li>Memory element #1 -&gt; clocked registers a.k.a. hardware registers</li>
<li>On the microprocessor</li>
<li>A clocked register stores 1 bit (state)</li>
<li>Synchronized by system-wide clock</li>
</ul>
<p>clocked
register</p>
<ul>
<li>System-wide clock</li>
<li>A system-wide clock sends 0 1 0 1 0 1 0 1…</li>
<li>Clock period: 1 full cycle duration:</li>
<li>Clock frequency: 1/period</li>
</ul>
<p>CLOCK</p>
<ul>
<li>How clocked registers work:</li>
<li>Output current state</li>
<li>Input next state</li>
</ul>
<p>5</p>
<ul>
<li>Next state remembered only on rising edge of clock</li>
</ul>
<p>rising edge
of clock</p>
<h2 id="how-a-clocked-register-function">How a clocked register function!</h2>
<p>Function Table</p>
<p>Load D
0
1
1</p>
<p>Q(t + 1) -&gt; next state</p>
<p>X
0
1</p>
<p>Q(t) -&gt; current state
0
1</p>
<p>Load 1) 0</p>
<p>Load 1) 0
clocked
reg.</p>
<p>clocked
reg.</p>
<p>1) 0</p>
<p>6</p>
<p>D</p>
<p>1) Q(t)
Q
3) Q(t)</p>
<p>Load 1) 1</p>
<p>1) 1</p>
<p>D</p>
<p>1) Q(t)
Q
3) Q(t)</p>
<p>Load 1) 1</p>
<p>clocked
reg.</p>
<p>1) 0</p>
<p>D</p>
<p>1) Q(t)
Q
3) 0</p>
<p>clocked
reg.</p>
<p>1) 1</p>
<p>D</p>
<p>Q</p>
<p>1) Q(t)
3) 1</p>
<p>Clock</p>
<p>Clock</p>
<p>Clock</p>
<p>Clock</p>
<p>2) When the clock
ticks, i.e., when
edge of clock rises</p>
<p>2) When the clock
ticks, i.e., when
edge of clock rises</p>
<p>2) When the clock
ticks, i.e., when
edge of clock rises</p>
<p>2) When the clock
ticks, i.e., when
edge of clock rises</p>
<p>Row 1 of Function Table</p>
<p>Row 1 of Function Table</p>
<p>Row 2 of Function Table</p>
<p>Row 3 of Function Table</p>
<h2 id="d-flip-flop">D flip flop</h2>
<p>Edge-triggered
clock</p>
<p>Load</p>
<p>Timing Diagram</p>
<p>clocked
reg.</p>
<p>If clock period, then clock frequency is</p>
<p>Clock
Load</p>
<p>0</p>
<p>1</p>
<p>0</p>
<p>1</p>
<p>0</p>
<p>1</p>
<p>D
1</p>
<p>Q</p>
<p>Clock</p>
<p>0</p>
<p>D
Q
tpd for register</p>
<p>7</p>
<p>Function Table
Load
0
1
1</p>
<p>D
X
0
1</p>
<p>Q(t + 1)
Q(t)
0
1</p>
<h2 id="memory-elements-2---random">Memory elements #2 -&gt; Random</h2>
<p>access memories</p>
<ul>
<li>
<p>Made of several clocked registers, i.e., store multiple
words of data</p>
</li>
<li>Random access (as opposed to sequential access)</li>
<li>
<p>Use an address to select which of the many memory words
should be read or written</p>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</li>
<li>Examples:
<ol>
@ -258,6 +550,7 @@ should be read or written</li>
<li>Register file -&gt; register id used as address</li>
</ol>
</li>
<<<<<<< HEAD
<li>Program registers</li>
<li>For example: x86-64 register file holds 16 registers</li>
</ul>
@ -351,11 +644,143 @@ of clock)</li>
<h2 id="put-together">Put together:</h2>
=======
</ul>
<p>*Program registers
8</p>
<p>*For example: x86-64 register file holds 16 registers</p>
<h2 id="vala">valA</h2>
<p>Register File</p>
<p>srcA</p>
<p>Read ports
valB
srcB</p>
<p>A</p>
<p>Register
file</p>
<p>valW</p>
<p>W dstW</p>
<p>Write port</p>
<p>B</p>
<ul>
<li>Stores multiple words</li>
</ul>
<p>Clock</p>
<ul>
<li>Each word is the value of a program register</li>
<li>%rax, %rsp, etc.</li>
<li>
<p>Register ID serves as address to specify which word to read
or write</p>
</li>
<li>Multiple ports</li>
<li>Can read and/or write multiple words in one clock cycle
*Each port has separate address and data input/output
9</li>
</ul>
<h2 id="register-file--how-it-works">Register file how it works?</h2>
<p>valA
srcA</p>
<p>output: value x
input: register ID 2</p>
<p>valB
srcB</p>
<p>A</p>
<ul>
<li>Reading</li>
</ul>
<p>2 x</p>
<ul>
<li>Combinational logic circuit does not need clock</li>
</ul>
<p>Register
file
B</p>
<ul>
<li>Output data generated based on input address
only, after some propagation delay</li>
</ul>
<p>Clock</p>
<p>2 x
Register
file</p>
<p>valW</p>
<p>W dstW</p>
<p>input:
value y
register ID 2</p>
<p>2 y</p>
<p></p>
<p>Rising
clock</p>
<p></p>
<p>Register
file</p>
<p>valW</p>
<p>W dstW</p>
<p>input:
value x
register ID 2</p>
<p>Clock</p>
<p>Clock</p>
<ul>
<li>Writing</li>
<li>
<p>Sequential logic circuit -&gt; clocked registers
10</p>
</li>
<li>Remembers only when clock “ticks” (rising edge
of clock)</li>
</ul>
<h2 id="put-together">Put together:</h2>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
<ul>
<li>Combinational logic circuits “deal” with an instruction</li>
<li>Memory elements hold results (state), i.e., “remember”</li>
</ul>
<<<<<<< HEAD
<p>Sequence:</p>
<ol>
@ -388,6 +813,49 @@ registers)
<h2 id="sequential-execution">Sequential execution</h2>
<p>Called
=======
<p>memory
element
(clocked
registers)</p>
<p>Clock
11</p>
<p>Value can be
used in next
clock cycle</p>
<p>Value written
in a previous
clock cycle</p>
<p>input combinational output
output
logic circuit
input
current
state</p>
<p>next
state</p>
<p>Clock cycle</p>
<p>memory
element
(clocked
registers)</p>
<p>output
current state</p>
<h2 id="sequential-execution">Sequential execution</h2>
<ul>
<li>Now, imagine we have designed and implemented a
microprocessor (its datapath):
Called
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
sequential
execution
because
@ -395,6 +863,7 @@ at every clock
cycle, a new
machine
instruction
<<<<<<< HEAD
is executed!</p>
<ul>
@ -407,6 +876,36 @@ microprocessor (its datapath):</li>
<h2 id="analysis-of-sequential-execution">Analysis of sequential execution</h2>
<p>The time between two ticks of the clock is a clock cycle.</p>
=======
is executed!
12</li>
</ul>
<p>From textbook:</p>
<p>input</p>
<p>combinational
logic circuit</p>
<p>output
input
next
state</p>
<p>clock</p>
<p>memory
element
(clocked
registers)</p>
<p>output
current state</p>
<h2 id="analysis-of-sequential-execution">Analysis of sequential execution</h2>
<p>the time between two ticks of the clock</p>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
<ul>
<li>Clock cycle required to execute 1 instruction must exceed
@ -414,14 +913,74 @@ tpd of combinational logic circuit + tpd of clocked register
execute 1 instruction</li>
</ul>
<<<<<<< HEAD
<p><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>t</mi><mrow><mi>p</mi><mi>d</mi></mrow></msub></mrow><annotation encoding="application/x-tex">t_{pd}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.9011879999999999em;vertical-align:-0.286108em;"></span><span class="mord"><span class="mord mathnormal">t</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361079999999999em;"><span style="top:-2.5500000000000003em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">p</span><span class="mord mathnormal mtight">d</span></span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.286108em;"><span></span></span></span></span></span></span></span></span></span> + <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>t</mi><mrow><mi>p</mi><mi>d</mi></mrow></msub></mrow><annotation encoding="application/x-tex">t_{pd}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.9011879999999999em;vertical-align:-0.286108em;"></span><span class="mord"><span class="mord mathnormal">t</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361079999999999em;"><span style="top:-2.5500000000000003em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">p</span><span class="mord mathnormal mtight">d</span></span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.286108em;"><span></span></span></span></span></span></span></span></span></span> is long clock cycle!</p>
<h2 id="analysis-of-sequential-execution-contd">Analysis of sequential execution (contd)</h2>
=======
<p>memory
element</p>
<p></p>
<p>(clocked
registers)</p>
<p>Clock</p>
<p>13</p>
<p>execute 1 instruction</p>
<p>input</p>
<p>combinational
logic circuit</p>
<p>Clock cycle</p>
<p>-&gt; tpd + tpd is long clock cycle!</p>
<p>output
input
next
state</p>
<p>memory
element
(clocked
registers)</p>
<p>output
current state</p>
<h2 id="analysis-of-sequential-execution-contd">Analysis of sequential execution (contd)</h2>
<p>input</p>
<p>combinational
logic circuit</p>
<p>output
input
next
state</p>
<p>memory
element
(clocked
registers)</p>
<p>output
current state</p>
<p>clock</p>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
<ul>
<li>Since the clock cycle is a factor in determining
how fast the microprocessor executes machine
instructions (i.e., execution speed)</li>
<<<<<<< HEAD
<li>Then a microprocessor with a long clock cycle is
a slow microprocessor
<ul>
@ -470,6 +1029,66 @@ than once during the execution of an instruction</li>
<p>https://ict.iitk.ac.in/wp-content/uploads/CS422-Computer-Architecture-ComputerOrganizationAndDesign5thEdition2014.pdf</p>
<h2 id="analysis">Analysis:</h2>
=======
<li>
<p>Then a microprocessor with a long clock cycle is
a slow microprocessor
14</p>
</li>
<li>as it takes a long time to execute machine
instructions, i.e., to execute a program</li>
</ul>
<h2 id="conclusion-sequential-execution">Conclusion: sequential execution</h2>
<ul>
<li>
<p>Such microprocessor called single-cycle microprocessor</p>
</li>
<li>Execute each instruction in 1 clock cycle -&gt; CPI = 1</li>
<li>CPI =&gt; clock cycles per instruction
*Def: the average number of clock cycles per instruction for a
program or program fragment
*inverse of instructions per cycle
*one aspect of a processors performance</li>
<li>CPI of 1 is inefficient:</li>
<li>
<p>Within the same clock cycle, functional units (of datapath like ALU)
cannot be used more than once
*So we would need to duplicate them if they are needed more
than once during the execution of an instruction
15</p>
</li>
<li>Results in a long clock cycle and a low throughput
*Def of throughput: Number of instructions executed per second</li>
</ul>
<h2 id="example-of-a-single-cycle-microprocessor">Example of a single-cycle microprocessor</h2>
<p>(datapath)</p>
<p>16
https://ict.iitk.ac.in/wp-content/uploads/CS422-Computer-Architecture-ComputerOrganizationAndDesign5thEdition2014.pdf</p>
<h2 id="analysis">Analysis:</h2>
<p>input</p>
<p>combinational
logic circuit</p>
<p>output
input
next
state</p>
<p>memory
element
(clocked
registers)</p>
<p>output
current state</p>
<p>clock</p>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
<ol>
<li>Latency (same as propagation delay):
@ -479,6 +1098,7 @@ than once during the execution of an instruction</li>
</ul>
</li>
<li>(instruction) Throughput -&gt; speed of microprocessor:
<<<<<<< HEAD
17
<ul>
<li>Def: Number of instructions executed per second - GIPS</li>
@ -504,6 +1124,31 @@ executes one machine instruction at a time and per clock cycle</li>
</li>
</ul>
</li>
=======
17</li>
</ol>
<ul>
<li>Def: Number of instructions executed per second - GIPS</li>
<li>Example:</li>
</ul>
<h2 id="summary">Summary</h2>
<ul>
<li>We put combinational logic circuits and sequential logic circuits together
-&gt; datapath of a microprocessor</li>
<li>Various models of Microprocessor machine instruction execution:</li>
</ul>
<p>18</p>
<ul>
<li>Model 1: Sequential execution of machine instructions
*The microprocessor we have just constructed is a sequential
execution of machine instructions type of microprocessor since it
executes one machine instruction at a time and per clock cycle
*Single-cycle microprocessor (CPI = 1)</li>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
<li>In general, how to analyze various models of microprocessor instruction
execution:
<ol>
@ -512,6 +1157,7 @@ instruction</li>
<li>Throughput: Number of instructions executed per second</li>
</ol>
</li>
<<<<<<< HEAD
<li>Conclusion of analyzing sequential execution of machine instructions
<ul>
<li>Because this model requires a long clock cycle</li>
@ -550,5 +1196,40 @@ instruction</li>
</footer>
</div>
</main>
=======
<li>Conclusion of analyzing sequential execution of machine instructions</li>
<li>Because this model requires a long clock cycle
 Creates slow microprocessors with small throughput</li>
</ul>
<h2 id="next-lecture">Next Lecture</h2>
<ul>
<li>Instruction Set Architecture (ISA)</li>
<li>
<p>Definition of ISA</p>
</li>
<li>Instruction Set design</li>
<li>Design principles</li>
<li>Look at an example of an instruction set: MIPS</li>
<li>Create our own</li>
<li>
<p>ISA evaluation</p>
</li>
<li>Implementation of a microprocessor (CPU) based on an ISA</li>
<li>Execution of machine instructions (datapath)</li>
<li>Intro to logic design + Combinational logic + Sequential logic circuit</li>
<li>Sequential execution of machine instructions</li>
<li>Pipelined execution of machine instructions + Hazards
19</li>
</ul>
<p>##</p>
</div>
</main>
<hr>
<footer>
</footer>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</body>
</html>

@ -3,11 +3,22 @@
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<<<<<<< HEAD
<link rel="stylesheet" href="/assets/css/style.css" id="main-stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0"><link rel="stylesheet" href="/assets/css/katex.css" id="math-stylesheet">
=======
<link rel="stylesheet" href="/assets/css/style.css" id="main-css">
<link rel="stylesheet" href="/assets/css/transcription.css" id="trans-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/js/"></script>
<link rel="stylesheet" href="/assets/css/katex.css" id="math-css">
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</head>
<body>
<main>
@ -87,9 +98,17 @@ printf("%.2f == %d -&gt; %d", aFloat, anInt, aFloat==anInt);
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>movq 0x10(%rbx,%rax,4), %rcx
</code></pre></div></div>
<<<<<<< HEAD
<footer>
</footer>
</div>
</main>
=======
</div>
</main>
<hr>
<footer>
</footer>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</body>
</html>

@ -3,10 +3,19 @@
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<<<<<<< HEAD
<link rel="stylesheet" href="/assets/css/style.css" id="main-stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
=======
<link rel="stylesheet" href="/assets/css/style.css" id="main-css">
<link rel="stylesheet" href="/assets/css/transcription.css" id="trans-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/js/"></script>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</head>
<body>
<main>
@ -81,9 +90,17 @@ int main()
</tbody>
</table>
<<<<<<< HEAD
<footer>
</footer>
</div>
</main>
=======
</div>
</main>
<hr>
<footer>
</footer>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</body>
</html>

@ -3,10 +3,19 @@
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<<<<<<< HEAD
<link rel="stylesheet" href="/assets/css/style.css" id="main-stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
=======
<link rel="stylesheet" href="/assets/css/style.css" id="main-css">
<link rel="stylesheet" href="/assets/css/transcription.css" id="trans-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/js/"></script>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</head>
<body>
<main>
@ -79,9 +88,17 @@ int main()
</tbody>
</table>
<<<<<<< HEAD
<footer>
</footer>
</div>
</main>
=======
</div>
</main>
<hr>
<footer>
</footer>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</body>
</html>

@ -3,11 +3,22 @@
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<<<<<<< HEAD
<link rel="stylesheet" href="/assets/css/style.css" id="main-stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0"><link rel="stylesheet" href="/assets/css/katex.css" id="math-stylesheet">
=======
<link rel="stylesheet" href="/assets/css/style.css" id="main-css">
<link rel="stylesheet" href="/assets/css/transcription.css" id="trans-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/js/"></script>
<link rel="stylesheet" href="/assets/css/katex.css" id="math-css">
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</head>
<body>
<main>
@ -524,9 +535,17 @@ of phrasing this question is to ask: what is the value of ε (epsilon) in this e
fractional decimal number (i.e., a real number).</li>
</ol>
<<<<<<< HEAD
<footer>
</footer>
</div>
</main>
=======
</div>
</main>
<hr>
<footer>
</footer>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</body>
</html>

@ -3,11 +3,22 @@
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<<<<<<< HEAD
<link rel="stylesheet" href="/assets/css/style.css" id="main-stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0"><link rel="stylesheet" href="/assets/css/katex.css" id="math-stylesheet">
=======
<link rel="stylesheet" href="/assets/css/style.css" id="main-css">
<link rel="stylesheet" href="/assets/css/transcription.css" id="trans-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/js/"></script>
<link rel="stylesheet" href="/assets/css/katex.css" id="math-css">
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</head>
<body>
<main>
@ -280,9 +291,17 @@ CourSys. However, your program must be functionally correct (i.e., it must compi
execute properly and solve this problem).</p>
<<<<<<< HEAD
<footer>
</footer>
</div>
</main>
=======
</div>
</main>
<hr>
<footer>
</footer>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</body>
</html>

@ -3,11 +3,22 @@
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<<<<<<< HEAD
<link rel="stylesheet" href="/assets/css/style.css" id="main-stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0"><link rel="stylesheet" href="/assets/css/katex.css" id="math-stylesheet">
=======
<link rel="stylesheet" href="/assets/css/style.css" id="main-css">
<link rel="stylesheet" href="/assets/css/transcription.css" id="trans-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/js/"></script>
<link rel="stylesheet" href="/assets/css/katex.css" id="math-css">
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</head>
<body>
<main>
@ -364,9 +375,17 @@ by the programmer using the arithmetic operations available.</p>
<hr />
<<<<<<< HEAD
<footer>
</footer>
</div>
</main>
=======
</div>
</main>
<hr>
<footer>
</footer>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</body>
</html>

@ -3,10 +3,19 @@
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<<<<<<< HEAD
<link rel="stylesheet" href="/assets/css/style.css" id="main-stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
=======
<link rel="stylesheet" href="/assets/css/style.css" id="main-css">
<link rel="stylesheet" href="/assets/css/transcription.css" id="trans-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/js/"></script>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</head>
<body>
<main>
@ -414,9 +423,17 @@ Assignment_5.pdf document).</li>
</tbody>
</table>
<<<<<<< HEAD
<footer>
</footer>
</div>
</main>
=======
</div>
</main>
<hr>
<footer>
</footer>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</body>
</html>

@ -3,11 +3,22 @@
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<<<<<<< HEAD
<link rel="stylesheet" href="/assets/css/style.css" id="main-stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0"><link rel="stylesheet" href="/assets/css/katex.css" id="math-stylesheet">
=======
<link rel="stylesheet" href="/assets/css/style.css" id="main-css">
<link rel="stylesheet" href="/assets/css/transcription.css" id="trans-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/js/"></script>
<link rel="stylesheet" href="/assets/css/katex.css" id="math-css">
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</head>
<body>
<main>
@ -320,9 +331,17 @@ free to use the Register Table, if you find it useful.</li>
<li>Create a third test case following the same format as the format used on Slide 13.</li>
</ol>
<<<<<<< HEAD
<footer>
</footer>
</div>
</main>
=======
</div>
</main>
<hr>
<footer>
</footer>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</body>
</html>

@ -3,11 +3,22 @@
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<<<<<<< HEAD
<link rel="stylesheet" href="/assets/css/style.css" id="main-stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0"><link rel="stylesheet" href="/assets/css/katex.css" id="math-stylesheet">
=======
<link rel="stylesheet" href="/assets/css/style.css" id="main-css">
<link rel="stylesheet" href="/assets/css/transcription.css" id="trans-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/js/"></script>
<link rel="stylesheet" href="/assets/css/katex.css" id="math-css">
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</head>
<body>
<main>
@ -922,9 +933,17 @@ the smallest program? [0.5 marks]</p>
<hr />
<<<<<<< HEAD
<footer>
</footer>
</div>
</main>
=======
</div>
</main>
<hr>
<footer>
</footer>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</body>
</html>

@ -3,10 +3,19 @@
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<<<<<<< HEAD
<link rel="stylesheet" href="/assets/css/style.css" id="main-stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
=======
<link rel="stylesheet" href="/assets/css/style.css" id="main-css">
<link rel="stylesheet" href="/assets/css/transcription.css" id="trans-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/js/"></script>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</head>
<body>
<main>
@ -59,9 +68,17 @@ doneWithRows: # bye bye!; yellow highlight
ret
</code></pre></div></div>
<<<<<<< HEAD
<footer>
</footer>
</div>
</main>
=======
</div>
</main>
<hr>
<footer>
</footer>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</body>
</html>

@ -3,11 +3,22 @@
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<<<<<<< HEAD
<link rel="stylesheet" href="/assets/css/style.css" id="main-stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0"><link rel="stylesheet" href="/assets/css/katex.css" id="math-stylesheet">
=======
<link rel="stylesheet" href="/assets/css/style.css" id="main-css">
<link rel="stylesheet" href="/assets/css/transcription.css" id="trans-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/js/"></script>
<link rel="stylesheet" href="/assets/css/katex.css" id="math-css">
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</head>
<body>
<main>
@ -893,9 +904,17 @@ screen of target machine.</p>
so range of unsigned short is [0 .. 216 -1]
which is not one of the options sbove.</p>
<<<<<<< HEAD
<footer>
</footer>
</div>
</main>
=======
</div>
</main>
<hr>
<footer>
</footer>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</body>
</html>

@ -3,10 +3,19 @@
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<<<<<<< HEAD
<link rel="stylesheet" href="/assets/css/style.css" id="main-stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
=======
<link rel="stylesheet" href="/assets/css/style.css" id="main-css">
<link rel="stylesheet" href="/assets/css/transcription.css" id="trans-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/js/"></script>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</head>
<body>
<main>
@ -441,9 +450,17 @@ other students who have stopped writing</p>
<h2 id="questions">Questions?</h2>
<<<<<<< HEAD
<footer>
</footer>
</div>
</main>
=======
</div>
</main>
<hr>
<footer>
</footer>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</body>
</html>

@ -3,10 +3,19 @@
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<<<<<<< HEAD
<link rel="stylesheet" href="/assets/css/style.css" id="main-stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
=======
<link rel="stylesheet" href="/assets/css/style.css" id="main-css">
<link rel="stylesheet" href="/assets/css/transcription.css" id="trans-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/js/"></script>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</head>
<body>
<main>
@ -453,9 +462,17 @@ other students who have stopped writing</li>
<p>(Transcribers note: rest of slide is blank)</p>
<<<<<<< HEAD
<footer>
</footer>
</div>
</main>
=======
</div>
</main>
<hr>
<footer>
</footer>
>>>>>>> ca770be68ffdcb836bbddb3a47786c64f4f717a7
</body>
</html>

@ -0,0 +1,153 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<link rel="stylesheet" href="../../../../../assets/css/style.css" id="main-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="../../../../../assets/js/index.html"></script>
</head>
<body>
<main>
<div id="wrapper">
<h1 id="cmpt-225---introduction">CMPT 225 - Introduction</h1>
<h2 id="cmpt-225-d100--data-structures--programming">CMPT: 225, D100 — Data Structures &amp; Programming</h2>
<h2 id="graded-work">Graded Work</h2>
<ul>
<li>4 Assignments, 32%
<ul>
<li>Programming &amp; Written Components</li>
<li>Programs:
<ul>
<li>In C++</li>
<li>running on ESIL Linux machines</li>
<li>using command line tools</li>
</ul>
</li>
</ul>
</li>
<li>3 Tests, 33%
<ul>
<li>In class</li>
</ul>
</li>
<li>1 Final Exam, 35%</li>
</ul>
<h2 id="lectures">Lectures</h2>
<ul>
<li>Slides + audio recording will be posted <em>after</em> lectures.</li>
</ul>
<h2 id="labs">Labs</h2>
<ul>
<li>There are <em>help times</em> (first labs are <em>next week</em>)</li>
</ul>
<h2 id="instructor-office-hours">Instructor Office Hours</h2>
<ul>
<li>Will be primarily online — times TBA.</li>
</ul>
<h2 id="instructor-contact">Instructor Contact</h2>
<ul>
<li>Via Canvas or email (for email: write from your SFU account, use subject “225: …”)</li>
</ul>
<h2 id="some-basic-rules">Some Basic Rules</h2>
<ul>
<li>In class, do not distract others.</li>
<li>In class, no taking photos/videos/recording</li>
<li>Help each other, but submit your own work.</li>
<li>Masks are mandatory in class:
<ul>
<li>may be removed while asking a question</li>
<li>if you cannot wear a mask, please email me</li>
</ul>
</li>
<li>Please stay on “your” side of the table
<ul>
<li>and stay 6 away if you dont have a mask on</li>
</ul>
</li>
</ul>
<h2 id="course-content">Course Content</h2>
<ul>
<li>Algorithms: processes that operate on data</li>
<li>Programs: implementations of algorithms</li>
<li>Data in programs: stored in data structures
<ul>
<li>simple D.S.: variables</li>
<li>most algorithms required compound D.S.s: e.g. arrays, lists, …</li>
<li>most non-trivial applications require non-trivial D.S.s</li>
</ul>
</li>
<li>Data Type: collection of values + operations on these values</li>
<li>Multiple data types:
<ul>
<li>Cleaner/simpler slg. design</li>
<li>better code</li>
</ul>
</li>
<li>Abstract Data Type: defined by values + operations without reference to how things are implemented</li>
<li>ADTs provide an abstract view of data:
<ul>
<li>let us reason about algorithms at a high level, ignoring implementation details</li>
</ul>
</li>
<li>Good ADT choices reduce program complexity &amp; increase likelihood of success ( which is good).</li>
<li>a[i] vs. a(i)</li>
</ul>
<h2 id="we-will-look-at">We will look at:</h2>
<ul>
<li>fundamental ADTs</li>
<li>fundamental data structures (to implement them)</li>
<li>sorting algorithms</li>
<li>with attention to:
<ul>
<li>correctness</li>
<li>efficiency/speed</li>
<li>how to implement</li>
<li>how to choose (for an application)</li>
</ul>
</li>
</ul>
<h2 id="pre-regs">Pre-regs:</h2>
<ul>
<li>Basic Programming (e.g. CMPT 125)</li>
<li>Discrete Math (e.g. MACM 101)</li>
</ul>
<p>(students get these in many different ways)</p>
<h2 id="to-do">To Do</h2>
<ul>
<li>Read chapters 1 + 3 of text</li>
<li>Lear about CSIL</li>
</ul>
<h2 id="end">End</h2>
</div>
</main>
<hr>
<footer>
</footer>
</body>
</html>

@ -0,0 +1,154 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<link rel="stylesheet" href="/assets/css/style.css" id="main-css">
<link rel="stylesheet" href="/assets/css/transcription.css" id="trans-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/js/"></script>
</head>
<body>
<main>
<div id="wrapper">
<h1 id="cmpt-225---introduction">CMPT 225 - Introduction</h1>
<h2 id="cmpt-225-d100--data-structures--programming">CMPT: 225, D100 — Data Structures &amp; Programming</h2>
<h2 id="graded-work">Graded Work</h2>
<ul>
<li>4 Assignments, 32%
<ul>
<li>Programming &amp; Written Components</li>
<li>Programs:
<ul>
<li>In C++</li>
<li>running on ESIL Linux machines</li>
<li>using command line tools</li>
</ul>
</li>
</ul>
</li>
<li>3 Tests, 33%
<ul>
<li>In class</li>
</ul>
</li>
<li>1 Final Exam, 35%</li>
</ul>
<h2 id="lectures">Lectures</h2>
<ul>
<li>Slides + audio recording will be posted <em>after</em> lectures.</li>
</ul>
<h2 id="labs">Labs</h2>
<ul>
<li>There are <em>help times</em> (first labs are <em>next week</em>)</li>
</ul>
<h2 id="instructor-office-hours">Instructor Office Hours</h2>
<ul>
<li>Will be primarily online — times TBA.</li>
</ul>
<h2 id="instructor-contact">Instructor Contact</h2>
<ul>
<li>Via Canvas or email (for email: write from your SFU account, use subject “225: …”)</li>
</ul>
<h2 id="some-basic-rules">Some Basic Rules</h2>
<ul>
<li>In class, do not distract others.</li>
<li>In class, no taking photos/videos/recording</li>
<li>Help each other, but submit your own work.</li>
<li>Masks are mandatory in class:
<ul>
<li>may be removed while asking a question</li>
<li>if you cannot wear a mask, please email me</li>
</ul>
</li>
<li>Please stay on “your” side of the table
<ul>
<li>and stay 6 away if you dont have a mask on</li>
</ul>
</li>
</ul>
<h2 id="course-content">Course Content</h2>
<ul>
<li>Algorithms: processes that operate on data</li>
<li>Programs: implementations of algorithms</li>
<li>Data in programs: stored in data structures
<ul>
<li>simple D.S.: variables</li>
<li>most algorithms required compound D.S.s: e.g. arrays, lists, …</li>
<li>most non-trivial applications require non-trivial D.S.s</li>
</ul>
</li>
<li>Data Type: collection of values + operations on these values</li>
<li>Multiple data types:
<ul>
<li>Cleaner/simpler slg. design</li>
<li>better code</li>
</ul>
</li>
<li>Abstract Data Type: defined by values + operations without reference to how things are implemented</li>
<li>ADTs provide an abstract view of data:
<ul>
<li>let us reason about algorithms at a high level, ignoring implementation details</li>
</ul>
</li>
<li>Good ADT choices reduce program complexity &amp; increase likelihood of success ( which is good).</li>
<li>a[i] vs. a(i)</li>
</ul>
<h2 id="we-will-look-at">We will look at:</h2>
<ul>
<li>fundamental ADTs</li>
<li>fundamental data structures (to implement them)</li>
<li>sorting algorithms</li>
<li>with attention to:
<ul>
<li>correctness</li>
<li>efficiency/speed</li>
<li>how to implement</li>
<li>how to choose (for an application)</li>
</ul>
</li>
</ul>
<h2 id="pre-regs">Pre-regs:</h2>
<ul>
<li>Basic Programming (e.g. CMPT 125)</li>
<li>Discrete Math (e.g. MACM 101)</li>
</ul>
<p>(students get these in many different ways)</p>
<h2 id="to-do">To Do</h2>
<ul>
<li>Read chapters 1 + 3 of text</li>
<li>Lear about CSIL</li>
</ul>
<h2 id="end">End</h2>
</div>
</main>
<hr>
<footer>
</footer>
</body>
</html>

@ -0,0 +1,75 @@
body { background-color: #222222; padding: 16px; font-family: -apple-system, helvetica, arial, sans-serif; font-size: 16px; color: #ffffff; line-height: 1.5em; overflow-wrap: break-word; }
#wrapper { max-width: 800px; margin: auto; }
#wrapper > header { text-align: center; }
.clear-list { list-style-type: none; margin: 0; padding: 0; }
.clear-list li { margin: 0; padding: 0; }
.projects .namelink { font-weight: bold; }
h1, h2, h3, h4, h5, h6 { line-height: 1em; }
.center { text-align: center; }
header { margin-bottom: 18px; }
hr { border: none; border-bottom: 1px solid #999; }
a { text-decoration: underline; color: #7ad; }
a:visited { color: #ff3492; }
a.nav-link, a.post-title-link { color: #ffffff; text-decoration: none; }
.post-title { line-height: 1.5em; color: #ffffff; margin-bottom: 8px; }
a.citation-link { text-decoration: none; }
nav { text-align: center; padding: 1em 0px; }
nav a { margin: 1em; color: #ffffff; font-weight: bold; font-style: none; }
nav a:hover, a.post-title-link:hover { text-decoration: underline; }
li { margin: .5em; }
table, table tr, table td, table th { border: 1px solid #aaa; border-collapse: collapse; padding: 5px; font-weight: normal; }
table th { font-weight: bold; }
table { width: 75%; margin: auto; }
img { display: block; width: 55%; margin-left: auto; margin-right: auto; }
blockquote { font-style: italic; }
address { font-style: normal; }
@media screen and (max-width: 600px) { body { width: 90%; } nav { text-align: left; width: 100%; } nav a { display: block; text-align: left; padding-left: 0; margin-left: 0; } }
.mono { font-family: monospace; }
.bold { font-weight: bold; }
figcaption { margin-top: 10px; font-style: italic; }
footer { padding-top: 16px; margin-bottom: 100px; }
.terminal, .file { padding: 10px; overflow-x: scroll; }
.terminal { line-height: 1em; color: #00FF00; background-color: #000000; }
.file { line-height: 1.2em; background-color: #444444; color: #ffffff; }
.small-image { width: 100%; }
.post-date { text-transform: uppercase; font-weight: bold; color: #ffffff; }
.post-excerpt { margin-left: 24px; }
.post-header { margin-bottom: 8px; }
/*# sourceMappingURL=style.css.map */

@ -0,0 +1,31 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<TITLE>Index of /assets/js/</TITLE>
<style type="text/css">
<!--
.name, .mtime { text-align: left; }
.size { text-align: right; }
td { text-overflow: ellipsis; white-space: nowrap; overflow: hidden; }
table { border-collapse: collapse; }
tr th { border-bottom: 2px groove; }
//-->
</style>
</HEAD>
<BODY>
<H1>Index of /assets/js/</H1>
<TABLE width="100%"><THEAD><TR>
<TH class="name"><A HREF="http://localhost:4000/assets/js/?N=D">Name</A></TH><TH class="mtime"><A HREF="http://localhost:4000/assets/js/?M=D">Last modified</A></TH><TH class="size"><A HREF="http://localhost:4000/assets/js/?S=D">Size</A></TH>
</TR></THEAD>
<TBODY>
<TR><TD class="name"><A HREF="http://localhost:4000/assets/">Parent Directory</A></TD><TD class="mtime">2021/11/16 20:30</TD><TD class="size">-</TD></TR>
<TR><TD class="name"><A HREF="http://localhost:4000/assets/js/hacked.js">hacked.js</A></TD><TD class="mtime">2021/11/16 22:47</TD><TD class="size">213</TD></TR>
<TR><TD class="name"><A HREF="http://localhost:4000/assets/js/katex.js">katex.js</A></TD><TD class="mtime">2021/11/16 22:47</TD><TD class="size">264762</TD></TR>
<TR><TD class="name"><A HREF="http://localhost:4000/assets/js/katex/">katex/</A></TD><TD class="mtime">2021/11/16 20:30</TD><TD class="size">-</TD></TR>
<TR><TD class="name"><A HREF="http://localhost:4000/assets/js/md/">md/</A></TD><TD class="mtime">2021/11/16 20:30</TD><TD class="size">-</TD></TR>
</TBODY></TABLE><HR> <ADDRESS>
WEBrick/1.7.0 (Ruby/3.0.2/2021-07-07)<BR>
at localhost:4000
</ADDRESS>
</BODY>
</HTML>

@ -0,0 +1,153 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<link rel="stylesheet" href="../../../../../assets/css/style.css" id="main-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="../../../../../assets/js/index.html"></script>
</head>
<body>
<main>
<div id="wrapper">
<h1 id="cmpt-225---introduction">CMPT 225 - Introduction</h1>
<h2 id="cmpt-225-d100--data-structures--programming">CMPT: 225, D100 — Data Structures &amp; Programming</h2>
<h2 id="graded-work">Graded Work</h2>
<ul>
<li>4 Assignments, 32%
<ul>
<li>Programming &amp; Written Components</li>
<li>Programs:
<ul>
<li>In C++</li>
<li>running on ESIL Linux machines</li>
<li>using command line tools</li>
</ul>
</li>
</ul>
</li>
<li>3 Tests, 33%
<ul>
<li>In class</li>
</ul>
</li>
<li>1 Final Exam, 35%</li>
</ul>
<h2 id="lectures">Lectures</h2>
<ul>
<li>Slides + audio recording will be posted <em>after</em> lectures.</li>
</ul>
<h2 id="labs">Labs</h2>
<ul>
<li>There are <em>help times</em> (first labs are <em>next week</em>)</li>
</ul>
<h2 id="instructor-office-hours">Instructor Office Hours</h2>
<ul>
<li>Will be primarily online — times TBA.</li>
</ul>
<h2 id="instructor-contact">Instructor Contact</h2>
<ul>
<li>Via Canvas or email (for email: write from your SFU account, use subject “225: …”)</li>
</ul>
<h2 id="some-basic-rules">Some Basic Rules</h2>
<ul>
<li>In class, do not distract others.</li>
<li>In class, no taking photos/videos/recording</li>
<li>Help each other, but submit your own work.</li>
<li>Masks are mandatory in class:
<ul>
<li>may be removed while asking a question</li>
<li>if you cannot wear a mask, please email me</li>
</ul>
</li>
<li>Please stay on “your” side of the table
<ul>
<li>and stay 6 away if you dont have a mask on</li>
</ul>
</li>
</ul>
<h2 id="course-content">Course Content</h2>
<ul>
<li>Algorithms: processes that operate on data</li>
<li>Programs: implementations of algorithms</li>
<li>Data in programs: stored in data structures
<ul>
<li>simple D.S.: variables</li>
<li>most algorithms required compound D.S.s: e.g. arrays, lists, …</li>
<li>most non-trivial applications require non-trivial D.S.s</li>
</ul>
</li>
<li>Data Type: collection of values + operations on these values</li>
<li>Multiple data types:
<ul>
<li>Cleaner/simpler slg. design</li>
<li>better code</li>
</ul>
</li>
<li>Abstract Data Type: defined by values + operations without reference to how things are implemented</li>
<li>ADTs provide an abstract view of data:
<ul>
<li>let us reason about algorithms at a high level, ignoring implementation details</li>
</ul>
</li>
<li>Good ADT choices reduce program complexity &amp; increase likelihood of success ( which is good).</li>
<li>a[i] vs. a(i)</li>
</ul>
<h2 id="we-will-look-at">We will look at:</h2>
<ul>
<li>fundamental ADTs</li>
<li>fundamental data structures (to implement them)</li>
<li>sorting algorithms</li>
<li>with attention to:
<ul>
<li>correctness</li>
<li>efficiency/speed</li>
<li>how to implement</li>
<li>how to choose (for an application)</li>
</ul>
</li>
</ul>
<h2 id="pre-regs">Pre-regs:</h2>
<ul>
<li>Basic Programming (e.g. CMPT 125)</li>
<li>Discrete Math (e.g. MACM 101)</li>
</ul>
<p>(students get these in many different ways)</p>
<h2 id="to-do">To Do</h2>
<ul>
<li>Read chapters 1 + 3 of text</li>
<li>Lear about CSIL</li>
</ul>
<h2 id="end">End</h2>
</div>
</main>
<hr>
<footer>
</footer>
</body>
</html>

@ -0,0 +1,868 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<link rel="stylesheet" href="../../../../../assets/css/style.css" id="main-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="../../../../../assets/js/index.html"></script>
</head>
<body>
<main>
<div id="wrapper">
<h1 id="stacks--queues---1">Stacks &amp; Queues - 1</h1>
<p>CMPT 225, Fall 2021, Lecture 2</p>
<h2 id="stack">Stack</h2>
<ul>
<li>ADT that stores a collection of objects/values</li>
<li>Insertions and removals follow last-in-first-out pattern</li>
<li>Fundamental Operations:
<ul>
<li>push: inserts an element on the “top”</li>
<li>pop: removes + returns the top element</li>
</ul>
</li>
</ul>
<p>e.g.</p>
<table>
<tbody>
<tr>
<td>Stack index</td>
<td>Value</td>
</tr>
</tbody>
</table>
<p>push a</p>
<table>
<tbody>
<tr>
<td>Stack index</td>
<td>Value</td>
</tr>
<tr>
<td>0</td>
<td>a</td>
</tr>
</tbody>
</table>
<p>push b</p>
<table>
<tbody>
<tr>
<td>Stack index</td>
<td>Value</td>
</tr>
<tr>
<td>0</td>
<td>b</td>
</tr>
<tr>
<td>1</td>
<td>a</td>
</tr>
</tbody>
</table>
<p>push c</p>
<table>
<tbody>
<tr>
<td>Stack index</td>
<td>Value</td>
</tr>
<tr>
<td>0</td>
<td>c</td>
</tr>
<tr>
<td>1</td>
<td>b</td>
</tr>
<tr>
<td>2</td>
<td>a</td>
</tr>
</tbody>
</table>
<p>pop</p>
<table>
<tbody>
<tr>
<td>Stack index</td>
<td>Value</td>
</tr>
<tr>
<td>0</td>
<td>b</td>
</tr>
<tr>
<td>1</td>
<td>a</td>
</tr>
</tbody>
</table>
<ul>
<li>conventient optional operations
<ul>
<li>size: return # of elements on stack // encapsulation</li>
<li>empty: check for emptiness // better than “size=0?”</li>
<li>top: return top element, but dont remove it // better than x = pop(); push(x) then use x</li>
</ul>
</li>
</ul>
<h2 id="algorithm-applications">Algorithm Applications</h2>
<ul>
<li>parasing/evaluation/transformation of expressions</li>
<li>speech recognition coding/decoding</li>
<li>shared network access control</li>
<li>programming languages &amp; execution
<ul>
<li>Postscript, Forth, the call stack</li>
</ul>
</li>
<li>things we do daily with computers</li>
</ul>
<h2 id="parenthasies-checking">Parenthasies Checking</h2>
<p>Parenthasies: <code class="language-plaintext highlighter-rouge">(()(((()())()()(()))</code></p>
<p>A diagram showing:
For every left parenthasies, add one to a counter.
For every right parthenthasies, remove one from the counter.
If the counter is not zero by the end of the sequence, there are too many on one side of the parenthasies.</p>
<p>Can be done by counting unmached left parenthasies:</p>
<p>Successful example:</p>
<table>
<tbody>
<tr>
<td>Character</td>
<td>Counter</td>
</tr>
<tr>
<td> </td>
<td>0</td>
</tr>
<tr>
<td>(</td>
<td>1</td>
</tr>
<tr>
<td>(</td>
<td>2</td>
</tr>
<tr>
<td>)</td>
<td>1</td>
</tr>
<tr>
<td>(</td>
<td>2</td>
</tr>
<tr>
<td>(</td>
<td>3</td>
</tr>
<tr>
<td>)</td>
<td>2</td>
</tr>
<tr>
<td>)</td>
<td>1</td>
</tr>
<tr>
<td>)</td>
<td>0</td>
</tr>
<tr>
<td>Yay!</td>
<td>0</td>
</tr>
</tbody>
</table>
<p>Failed example:</p>
<table>
<tbody>
<tr>
<td>Character</td>
<td>Country</td>
</tr>
<tr>
<td> </td>
<td>0</td>
</tr>
<tr>
<td>(</td>
<td>1</td>
</tr>
<tr>
<td>(</td>
<td>2</td>
</tr>
<tr>
<td>)</td>
<td>1</td>
</tr>
<tr>
<td>(</td>
<td>2</td>
</tr>
<tr>
<td>)</td>
<td>1</td>
</tr>
<tr>
<td> </td>
<td>Oh no its not zero!</td>
</tr>
</tbody>
</table>
<p>Another fail:</p>
<table>
<tbody>
<tr>
<td>Character</td>
<td>Counter</td>
</tr>
<tr>
<td> </td>
<td>0</td>
</tr>
<tr>
<td>(</td>
<td>1</td>
</tr>
<tr>
<td>)</td>
<td>0</td>
</tr>
<tr>
<td>(</td>
<td>1</td>
</tr>
<tr>
<td>)</td>
<td>0</td>
</tr>
<tr>
<td>)</td>
<td>-1</td>
</tr>
<tr>
<td> </td>
<td>Negative 1 this time!</td>
</tr>
</tbody>
</table>
<p>Do this one yourself:</p>
<table>
<tbody>
<tr>
<td>Character</td>
<td>Counter</td>
</tr>
<tr>
<td>(</td>
<td> </td>
</tr>
<tr>
<td>)</td>
<td> </td>
</tr>
<tr>
<td>)</td>
<td> </td>
</tr>
<tr>
<td>(</td>
<td> </td>
</tr>
</tbody>
</table>
<p>But consider multiple grouping symbols: <code class="language-plaintext highlighter-rouge">(\{\{)</code>, <code class="language-plaintext highlighter-rouge">(\{)\{</code>, <code class="language-plaintext highlighter-rouge">(\{[( ... ]</code>.
Counting is not enough.</p>
<h2 id="parenthasies-checking-1">Parenthasies Checking</h2>
<p>Diagram showing failure on the last character of this sequence: <code class="language-plaintext highlighter-rouge">(()((()()))()(())))</code></p>
<p>Can be done by counting unmatched left parenthasies:</p>
<table>
<tbody>
<tr>
<td>Character</td>
<td>Counter</td>
</tr>
<tr>
<td>(</td>
<td>1</td>
</tr>
<tr>
<td>(</td>
<td>2</td>
</tr>
<tr>
<td>)</td>
<td>1</td>
</tr>
<tr>
<td>(</td>
<td>2</td>
</tr>
<tr>
<td>(</td>
<td>3</td>
</tr>
<tr>
<td>)</td>
<td>2</td>
</tr>
<tr>
<td>)</td>
<td>1</td>
</tr>
<tr>
<td>)</td>
<td>0</td>
</tr>
</tbody>
</table>
<p>Example 2:</p>
<table>
<tbody>
<tr>
<td>Character</td>
<td>Counter</td>
</tr>
<tr>
<td>(</td>
<td>1</td>
</tr>
<tr>
<td>(</td>
<td>2</td>
</tr>
<tr>
<td>)</td>
<td>1</td>
</tr>
<tr>
<td>(</td>
<td>2</td>
</tr>
<tr>
<td>)</td>
<td>1</td>
</tr>
</tbody>
</table>
<p>Example 3:</p>
<table>
<tbody>
<tr>
<td>Character</td>
<td>Counter</td>
</tr>
<tr>
<td>(</td>
<td>1</td>
</tr>
<tr>
<td>)</td>
<td>0</td>
</tr>
<tr>
<td>(</td>
<td>1</td>
</tr>
<tr>
<td>)</td>
<td>0</td>
</tr>
<tr>
<td>)</td>
<td>-1</td>
</tr>
</tbody>
</table>
<p>Example 4:</p>
<table>
<tbody>
<tr>
<td>Character</td>
<td>Counter</td>
</tr>
<tr>
<td>(</td>
<td>1</td>
</tr>
<tr>
<td>)</td>
<td>0</td>
</tr>
<tr>
<td>)</td>
<td>-1</td>
</tr>
<tr>
<td>(</td>
<td>0</td>
</tr>
</tbody>
</table>
<p>But consider multiple grouping symbols:</p>
<ul>
<li>sequence <code class="language-plaintext highlighter-rouge">(\{\})</code> will and should work</li>
<li>sequence <code class="language-plaintext highlighter-rouge">(\{)\}</code> will work and should not</li>
<li>sequence <code class="language-plaintext highlighter-rouge">(\{[( ...</code> ???</li>
</ul>
<p>Counting is not enough.</p>
<h2 id="stack-based-algorithm-for-checking-grouping-symbols">Stack-based Algorithm for Checking Grouping Symbols</h2>
<p>Pseudo-code:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>I is an input stream of symbols.
S is a new empty stack.
while there are signals to read from I {
c is next symbol from I
if c is a left grouping signal {
push c on S
} else if c is a right grouping signal{
if s in empty { report error and stop }
d is pop S
if c and d do not match { report error and stop }
endif // if c is not a grouping symbol, ignore it
end while
if S is not empty { report error and exit }
report ok
</code></pre></div></div>
<p>Diagram showing how each set of parenthasies are matched, innermost first torwards the outermost.</p>
<h2 id="stack-partially-filled-array-implementation">Stack: Partially-Filled Array Implementation</h2>
<p>Variables:</p>
<ul>
<li>A - an array of stack elements</li>
<li>capacity - size of array</li>
<li>top - index in array of top stack element
<ul>
<li>-1 if stack is empty</li>
</ul>
</li>
</ul>
<p>A starts out as:</p>
<table>
<tbody>
<tr>
<td>Index</td>
<td>0</td>
<td>1</td>
<td>2</td>
<td></td>
<td>capacity-1</td>
</tr>
<tr>
<td>Value</td>
<td>a</td>
<td>b</td>
<td>c</td>
<td></td>
<td> </td>
</tr>
</tbody>
</table>
<ul>
<li>Capacity = &lt;size of A&gt;</li>
<li>top = 2</li>
</ul>
<p>push e</p>
<p>A now equals</p>
<table>
<tbody>
<tr>
<td>Index</td>
<td>0</td>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
<td></td>
<td>capacity-1</td>
</tr>
<tr>
<td>Value</td>
<td>a</td>
<td>b</td>
<td>c</td>
<td>d</td>
<td>e</td>
<td></td>
<td> </td>
</tr>
</tbody>
</table>
<ul>
<li>capacity = &lt;size of A&gt;</li>
<li>top = 3</li>
</ul>
<h2 id="the-queue-adt">The Queue ADT</h2>
<p>A container that stores a collection of items with insertion and removal in “first-in-first-out” order.</p>
<p>Stack: a digram showing circled being placed on top of eachother, pushing circles into the tube, then popping them out from the same size (the top). Like a pringles can of elements.</p>
<p>Queue: a diagram showing circles being unqueued in on the left and dequeued on the right. Like waiting in line for food.</p>
<p>Basic operations:</p>
<ul>
<li>enqueue: add an item to the back of a list</li>
<li>dequeue: remove &amp; return the item at the front of the list</li>
</ul>
<h2 id="example-palindrome-checking">Example: Palindrome Checking</h2>
<p>Sequence <code class="language-plaintext highlighter-rouge">aba</code> should succeed.
Sequence <code class="language-plaintext highlighter-rouge">aab</code> should not.</p>
<p>In an array: a diagram showing the following pattern with the variable <code class="language-plaintext highlighter-rouge">i</code> set to the leftmost element and <code class="language-plaintext highlighter-rouge">j</code> set to the rightmost element.</p>
<table>
<tbody>
<tr>
<td>Values</td>
<td>a</td>
<td>b</td>
<td>c</td>
<td></td>
<td>s</td>
<td>b</td>
<td>a</td>
</tr>
</tbody>
</table>
<p>With a stack and queue:</p>
<ol>
<li>read symbols, starting each in a stack and a queue</li>
<li>while the stack, queue are not empty:
<ul>
<li>pop and element from the stack + delete an element from the queue</li>
<li>if different -&gt; not a palindrome</li>
</ul>
</li>
<li>palindrome</li>
</ol>
<h2 id="queue-array-implementations">Queue: Array Implementations</h2>
<p>Enqueue: a,b,c,d.
Front is now a, last is now d.</p>
<table>
<tbody>
<tr>
<td>Values</td>
<td>a</td>
<td>b</td>
<td>c</td>
<td>d</td>
<td></td>
</tr>
</tbody>
</table>
<p>Dequeue returns and deletes first element.
Front is now b, last is now d.</p>
<table>
<tbody>
<tr>
<td>Values</td>
<td>?</td>
<td>b</td>
<td>c</td>
<td>d</td>
<td></td>
</tr>
</tbody>
</table>
<p>Many enquques/dequeues later:</p>
<table>
<tbody>
<tr>
<td>Values</td>
<td>s</td>
<td></td>
<td>m</td>
<td>n</td>
<td>o</td>
</tr>
</tbody>
</table>
<p>Front element is now <code class="language-plaintext highlighter-rouge">m</code>, last element is now s.</p>
<table>
<tbody>
<tr>
<td>Values</td>
<td>?</td>
<td>t</td>
<td>u</td>
<td>v</td>
<td>w</td>
<td></td>
</tr>
</tbody>
</table>
<p>A similar slide is here, but I cant see the differnece.</p>
<p>Variables:</p>
<ul>
<li>array A is array of size capacity</li>
<li>front is 0</li>
<li>back is 0</li>
<li>size is 0</li>
<li>capacity = &lt;size of array&gt;</li>
</ul>
<p>Pseudo-code:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>array A = array of size capacity // holds queue contents
front = 0 // index in A of front element, if queue not empty
back = 0 // index where next unqueued element will go
size = 0 // number of elements in queue
capacity = &lt;size of array&gt; // ???(can't read) queue size supported
enqueue(x) { // adds x to the back of the queue
// requires size&lt;capacity&gt;
A[back] = x
size = size + 1
back = (back + 1) % capacity
}
dequeue() { // removes front element of queue and returns it
// required size &gt; 0
temp = A[front]
front = (front + 1) % capacity
size = size - 1
return temp
}
</code></pre></div></div>
<p>Is <code class="language-plaintext highlighter-rouge">size == front - back</code>?</p>
<p>Diagram showing only true if front and back havent been switched around due to wrapping around back to the beginning o the array.</p>
<h2 id="circular-array-queue-example">“Circular Array” Queue Example</h2>
<ul>
<li>size = 0</li>
<li>front = 0</li>
<li>back = 0</li>
</ul>
<table>
<tbody>
<tr>
<td>Values</td>
<td>empty</td>
<td>empty</td>
<td>empty</td>
<td>empty</td>
<td>empty</td>
<td>empty</td>
</tr>
</tbody>
</table>
<p>enqueue: a,b,c,d</p>
<ul>
<li>front = 0</li>
<li>back = 4</li>
</ul>
<table>
<tbody>
<tr>
<td>Values</td>
<td>a</td>
<td>b</td>
<td>c</td>
<td>d</td>
<td>empty</td>
<td>empty</td>
</tr>
</tbody>
</table>
<p>dequque 3 times</p>
<ul>
<li>front = 3</li>
<li>back = 4</li>
</ul>
<table>
<tbody>
<tr>
<td>Values</td>
<td>empty</td>
<td>empty</td>
<td>empty</td>
<td>d</td>
<td>empty</td>
<td>empty</td>
</tr>
</tbody>
</table>
<p>enqueue e,f,g,h</p>
<ul>
<li>front = 3</li>
<li>back = 2</li>
</ul>
<table>
<tbody>
<tr>
<td>Values</td>
<td>g</td>
<td>h</td>
<td>empty</td>
<td>d</td>
<td>e</td>
<td>f</td>
</tr>
</tbody>
</table>
<p>unqueue j</p>
<ul>
<li>size = 6</li>
<li>font = 3</li>
<li>back = 3</li>
</ul>
<table>
<tbody>
<tr>
<td>Values</td>
<td>g</td>
<td>h</td>
<td>j</td>
<td>d</td>
<td>e</td>
<td>f</td>
</tr>
</tbody>
</table>
<p>dequeue 3 times</p>
<ul>
<li>back = 3</li>
<li>front = 0</li>
</ul>
<table>
<tbody>
<tr>
<td>Values</td>
<td>g</td>
<td>h</td>
<td>j</td>
<td>empty</td>
<td>empty</td>
<td>empty</td>
</tr>
</tbody>
</table>
<p>dequeue 3 times</p>
<ul>
<li>back = 3</li>
<li>front = 3</li>
</ul>
<table>
<tbody>
<tr>
<td>Values</td>
<td>empty</td>
<td>empty</td>
<td>empty</td>
<td>empty</td>
<td>empty</td>
<td>empty</td>
</tr>
</tbody>
</table>
<h2 id="end">End</h2>
</div>
</main>
<hr>
<footer>
</footer>
</body>
</html>

@ -0,0 +1,869 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<link rel="stylesheet" href="/assets/css/style.css" id="main-css">
<link rel="stylesheet" href="/assets/css/transcription.css" id="trans-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/js/"></script>
</head>
<body>
<main>
<div id="wrapper">
<h1 id="stacks--queues---1">Stacks &amp; Queues - 1</h1>
<p>CMPT 225, Fall 2021, Lecture 2</p>
<h2 id="stack">Stack</h2>
<ul>
<li>ADT that stores a collection of objects/values</li>
<li>Insertions and removals follow last-in-first-out pattern</li>
<li>Fundamental Operations:
<ul>
<li>push: inserts an element on the “top”</li>
<li>pop: removes + returns the top element</li>
</ul>
</li>
</ul>
<p>e.g.</p>
<table>
<tbody>
<tr>
<td>Stack index</td>
<td>Value</td>
</tr>
</tbody>
</table>
<p>push a</p>
<table>
<tbody>
<tr>
<td>Stack index</td>
<td>Value</td>
</tr>
<tr>
<td>0</td>
<td>a</td>
</tr>
</tbody>
</table>
<p>push b</p>
<table>
<tbody>
<tr>
<td>Stack index</td>
<td>Value</td>
</tr>
<tr>
<td>0</td>
<td>b</td>
</tr>
<tr>
<td>1</td>
<td>a</td>
</tr>
</tbody>
</table>
<p>push c</p>
<table>
<tbody>
<tr>
<td>Stack index</td>
<td>Value</td>
</tr>
<tr>
<td>0</td>
<td>c</td>
</tr>
<tr>
<td>1</td>
<td>b</td>
</tr>
<tr>
<td>2</td>
<td>a</td>
</tr>
</tbody>
</table>
<p>pop</p>
<table>
<tbody>
<tr>
<td>Stack index</td>
<td>Value</td>
</tr>
<tr>
<td>0</td>
<td>b</td>
</tr>
<tr>
<td>1</td>
<td>a</td>
</tr>
</tbody>
</table>
<ul>
<li>conventient optional operations
<ul>
<li>size: return # of elements on stack // encapsulation</li>
<li>empty: check for emptiness // better than “size=0?”</li>
<li>top: return top element, but dont remove it // better than x = pop(); push(x) then use x</li>
</ul>
</li>
</ul>
<h2 id="algorithm-applications">Algorithm Applications</h2>
<ul>
<li>parasing/evaluation/transformation of expressions</li>
<li>speech recognition coding/decoding</li>
<li>shared network access control</li>
<li>programming languages &amp; execution
<ul>
<li>Postscript, Forth, the call stack</li>
</ul>
</li>
<li>things we do daily with computers</li>
</ul>
<h2 id="parenthasies-checking">Parenthasies Checking</h2>
<p>Parenthasies: <code class="language-plaintext highlighter-rouge">(()(((()())()()(()))</code></p>
<p>A diagram showing:
For every left parenthasies, add one to a counter.
For every right parthenthasies, remove one from the counter.
If the counter is not zero by the end of the sequence, there are too many on one side of the parenthasies.</p>
<p>Can be done by counting unmached left parenthasies:</p>
<p>Successful example:</p>
<table>
<tbody>
<tr>
<td>Character</td>
<td>Counter</td>
</tr>
<tr>
<td> </td>
<td>0</td>
</tr>
<tr>
<td>(</td>
<td>1</td>
</tr>
<tr>
<td>(</td>
<td>2</td>
</tr>
<tr>
<td>)</td>
<td>1</td>
</tr>
<tr>
<td>(</td>
<td>2</td>
</tr>
<tr>
<td>(</td>
<td>3</td>
</tr>
<tr>
<td>)</td>
<td>2</td>
</tr>
<tr>
<td>)</td>
<td>1</td>
</tr>
<tr>
<td>)</td>
<td>0</td>
</tr>
<tr>
<td>Yay!</td>
<td>0</td>
</tr>
</tbody>
</table>
<p>Failed example:</p>
<table>
<tbody>
<tr>
<td>Character</td>
<td>Country</td>
</tr>
<tr>
<td> </td>
<td>0</td>
</tr>
<tr>
<td>(</td>
<td>1</td>
</tr>
<tr>
<td>(</td>
<td>2</td>
</tr>
<tr>
<td>)</td>
<td>1</td>
</tr>
<tr>
<td>(</td>
<td>2</td>
</tr>
<tr>
<td>)</td>
<td>1</td>
</tr>
<tr>
<td> </td>
<td>Oh no its not zero!</td>
</tr>
</tbody>
</table>
<p>Another fail:</p>
<table>
<tbody>
<tr>
<td>Character</td>
<td>Counter</td>
</tr>
<tr>
<td> </td>
<td>0</td>
</tr>
<tr>
<td>(</td>
<td>1</td>
</tr>
<tr>
<td>)</td>
<td>0</td>
</tr>
<tr>
<td>(</td>
<td>1</td>
</tr>
<tr>
<td>)</td>
<td>0</td>
</tr>
<tr>
<td>)</td>
<td>-1</td>
</tr>
<tr>
<td> </td>
<td>Negative 1 this time!</td>
</tr>
</tbody>
</table>
<p>Do this one yourself:</p>
<table>
<tbody>
<tr>
<td>Character</td>
<td>Counter</td>
</tr>
<tr>
<td>(</td>
<td> </td>
</tr>
<tr>
<td>)</td>
<td> </td>
</tr>
<tr>
<td>)</td>
<td> </td>
</tr>
<tr>
<td>(</td>
<td> </td>
</tr>
</tbody>
</table>
<p>But consider multiple grouping symbols: <code class="language-plaintext highlighter-rouge">(\{\{)</code>, <code class="language-plaintext highlighter-rouge">(\{)\{</code>, <code class="language-plaintext highlighter-rouge">(\{[( ... ]</code>.
Counting is not enough.</p>
<h2 id="parenthasies-checking-1">Parenthasies Checking</h2>
<p>Diagram showing failure on the last character of this sequence: <code class="language-plaintext highlighter-rouge">(()((()()))()(())))</code></p>
<p>Can be done by counting unmatched left parenthasies:</p>
<table>
<tbody>
<tr>
<td>Character</td>
<td>Counter</td>
</tr>
<tr>
<td>(</td>
<td>1</td>
</tr>
<tr>
<td>(</td>
<td>2</td>
</tr>
<tr>
<td>)</td>
<td>1</td>
</tr>
<tr>
<td>(</td>
<td>2</td>
</tr>
<tr>
<td>(</td>
<td>3</td>
</tr>
<tr>
<td>)</td>
<td>2</td>
</tr>
<tr>
<td>)</td>
<td>1</td>
</tr>
<tr>
<td>)</td>
<td>0</td>
</tr>
</tbody>
</table>
<p>Example 2:</p>
<table>
<tbody>
<tr>
<td>Character</td>
<td>Counter</td>
</tr>
<tr>
<td>(</td>
<td>1</td>
</tr>
<tr>
<td>(</td>
<td>2</td>
</tr>
<tr>
<td>)</td>
<td>1</td>
</tr>
<tr>
<td>(</td>
<td>2</td>
</tr>
<tr>
<td>)</td>
<td>1</td>
</tr>
</tbody>
</table>
<p>Example 3:</p>
<table>
<tbody>
<tr>
<td>Character</td>
<td>Counter</td>
</tr>
<tr>
<td>(</td>
<td>1</td>
</tr>
<tr>
<td>)</td>
<td>0</td>
</tr>
<tr>
<td>(</td>
<td>1</td>
</tr>
<tr>
<td>)</td>
<td>0</td>
</tr>
<tr>
<td>)</td>
<td>-1</td>
</tr>
</tbody>
</table>
<p>Example 4:</p>
<table>
<tbody>
<tr>
<td>Character</td>
<td>Counter</td>
</tr>
<tr>
<td>(</td>
<td>1</td>
</tr>
<tr>
<td>)</td>
<td>0</td>
</tr>
<tr>
<td>)</td>
<td>-1</td>
</tr>
<tr>
<td>(</td>
<td>0</td>
</tr>
</tbody>
</table>
<p>But consider multiple grouping symbols:</p>
<ul>
<li>sequence <code class="language-plaintext highlighter-rouge">(\{\})</code> will and should work</li>
<li>sequence <code class="language-plaintext highlighter-rouge">(\{)\}</code> will work and should not</li>
<li>sequence <code class="language-plaintext highlighter-rouge">(\{[( ...</code> ???</li>
</ul>
<p>Counting is not enough.</p>
<h2 id="stack-based-algorithm-for-checking-grouping-symbols">Stack-based Algorithm for Checking Grouping Symbols</h2>
<p>Pseudo-code:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>I is an input stream of symbols.
S is a new empty stack.
while there are signals to read from I {
c is next symbol from I
if c is a left grouping signal {
push c on S
} else if c is a right grouping signal{
if s in empty { report error and stop }
d is pop S
if c and d do not match { report error and stop }
endif // if c is not a grouping symbol, ignore it
end while
if S is not empty { report error and exit }
report ok
</code></pre></div></div>
<p>Diagram showing how each set of parenthasies are matched, innermost first torwards the outermost.</p>
<h2 id="stack-partially-filled-array-implementation">Stack: Partially-Filled Array Implementation</h2>
<p>Variables:</p>
<ul>
<li>A - an array of stack elements</li>
<li>capacity - size of array</li>
<li>top - index in array of top stack element
<ul>
<li>-1 if stack is empty</li>
</ul>
</li>
</ul>
<p>A starts out as:</p>
<table>
<tbody>
<tr>
<td>Index</td>
<td>0</td>
<td>1</td>
<td>2</td>
<td></td>
<td>capacity-1</td>
</tr>
<tr>
<td>Value</td>
<td>a</td>
<td>b</td>
<td>c</td>
<td></td>
<td> </td>
</tr>
</tbody>
</table>
<ul>
<li>Capacity = &lt;size of A&gt;</li>
<li>top = 2</li>
</ul>
<p>push e</p>
<p>A now equals</p>
<table>
<tbody>
<tr>
<td>Index</td>
<td>0</td>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
<td></td>
<td>capacity-1</td>
</tr>
<tr>
<td>Value</td>
<td>a</td>
<td>b</td>
<td>c</td>
<td>d</td>
<td>e</td>
<td></td>
<td> </td>
</tr>
</tbody>
</table>
<ul>
<li>capacity = &lt;size of A&gt;</li>
<li>top = 3</li>
</ul>
<h2 id="the-queue-adt">The Queue ADT</h2>
<p>A container that stores a collection of items with insertion and removal in “first-in-first-out” order.</p>
<p>Stack: a digram showing circled being placed on top of eachother, pushing circles into the tube, then popping them out from the same size (the top). Like a pringles can of elements.</p>
<p>Queue: a diagram showing circles being unqueued in on the left and dequeued on the right. Like waiting in line for food.</p>
<p>Basic operations:</p>
<ul>
<li>enqueue: add an item to the back of a list</li>
<li>dequeue: remove &amp; return the item at the front of the list</li>
</ul>
<h2 id="example-palindrome-checking">Example: Palindrome Checking</h2>
<p>Sequence <code class="language-plaintext highlighter-rouge">aba</code> should succeed.
Sequence <code class="language-plaintext highlighter-rouge">aab</code> should not.</p>
<p>In an array: a diagram showing the following pattern with the variable <code class="language-plaintext highlighter-rouge">i</code> set to the leftmost element and <code class="language-plaintext highlighter-rouge">j</code> set to the rightmost element.</p>
<table>
<tbody>
<tr>
<td>Values</td>
<td>a</td>
<td>b</td>
<td>c</td>
<td></td>
<td>s</td>
<td>b</td>
<td>a</td>
</tr>
</tbody>
</table>
<p>With a stack and queue:</p>
<ol>
<li>read symbols, starting each in a stack and a queue</li>
<li>while the stack, queue are not empty:
<ul>
<li>pop and element from the stack + delete an element from the queue</li>
<li>if different -&gt; not a palindrome</li>
</ul>
</li>
<li>palindrome</li>
</ol>
<h2 id="queue-array-implementations">Queue: Array Implementations</h2>
<p>Enqueue: a,b,c,d.
Front is now a, last is now d.</p>
<table>
<tbody>
<tr>
<td>Values</td>
<td>a</td>
<td>b</td>
<td>c</td>
<td>d</td>
<td></td>
</tr>
</tbody>
</table>
<p>Dequeue returns and deletes first element.
Front is now b, last is now d.</p>
<table>
<tbody>
<tr>
<td>Values</td>
<td>?</td>
<td>b</td>
<td>c</td>
<td>d</td>
<td></td>
</tr>
</tbody>
</table>
<p>Many enquques/dequeues later:</p>
<table>
<tbody>
<tr>
<td>Values</td>
<td>s</td>
<td></td>
<td>m</td>
<td>n</td>
<td>o</td>
</tr>
</tbody>
</table>
<p>Front element is now <code class="language-plaintext highlighter-rouge">m</code>, last element is now s.</p>
<table>
<tbody>
<tr>
<td>Values</td>
<td>?</td>
<td>t</td>
<td>u</td>
<td>v</td>
<td>w</td>
<td></td>
</tr>
</tbody>
</table>
<p>A similar slide is here, but I cant see the differnece.</p>
<p>Variables:</p>
<ul>
<li>array A is array of size capacity</li>
<li>front is 0</li>
<li>back is 0</li>
<li>size is 0</li>
<li>capacity = &lt;size of array&gt;</li>
</ul>
<p>Pseudo-code:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>array A = array of size capacity // holds queue contents
front = 0 // index in A of front element, if queue not empty
back = 0 // index where next unqueued element will go
size = 0 // number of elements in queue
capacity = &lt;size of array&gt; // ???(can't read) queue size supported
enqueue(x) { // adds x to the back of the queue
// requires size&lt;capacity&gt;
A[back] = x
size = size + 1
back = (back + 1) % capacity
}
dequeue() { // removes front element of queue and returns it
// required size &gt; 0
temp = A[front]
front = (front + 1) % capacity
size = size - 1
return temp
}
</code></pre></div></div>
<p>Is <code class="language-plaintext highlighter-rouge">size == front - back</code>?</p>
<p>Diagram showing only true if front and back havent been switched around due to wrapping around back to the beginning o the array.</p>
<h2 id="circular-array-queue-example">“Circular Array” Queue Example</h2>
<ul>
<li>size = 0</li>
<li>front = 0</li>
<li>back = 0</li>
</ul>
<table>
<tbody>
<tr>
<td>Values</td>
<td>empty</td>
<td>empty</td>
<td>empty</td>
<td>empty</td>
<td>empty</td>
<td>empty</td>
</tr>
</tbody>
</table>
<p>enqueue: a,b,c,d</p>
<ul>
<li>front = 0</li>
<li>back = 4</li>
</ul>
<table>
<tbody>
<tr>
<td>Values</td>
<td>a</td>
<td>b</td>
<td>c</td>
<td>d</td>
<td>empty</td>
<td>empty</td>
</tr>
</tbody>
</table>
<p>dequque 3 times</p>
<ul>
<li>front = 3</li>
<li>back = 4</li>
</ul>
<table>
<tbody>
<tr>
<td>Values</td>
<td>empty</td>
<td>empty</td>
<td>empty</td>
<td>d</td>
<td>empty</td>
<td>empty</td>
</tr>
</tbody>
</table>
<p>enqueue e,f,g,h</p>
<ul>
<li>front = 3</li>
<li>back = 2</li>
</ul>
<table>
<tbody>
<tr>
<td>Values</td>
<td>g</td>
<td>h</td>
<td>empty</td>
<td>d</td>
<td>e</td>
<td>f</td>
</tr>
</tbody>
</table>
<p>unqueue j</p>
<ul>
<li>size = 6</li>
<li>font = 3</li>
<li>back = 3</li>
</ul>
<table>
<tbody>
<tr>
<td>Values</td>
<td>g</td>
<td>h</td>
<td>j</td>
<td>d</td>
<td>e</td>
<td>f</td>
</tr>
</tbody>
</table>
<p>dequeue 3 times</p>
<ul>
<li>back = 3</li>
<li>front = 0</li>
</ul>
<table>
<tbody>
<tr>
<td>Values</td>
<td>g</td>
<td>h</td>
<td>j</td>
<td>empty</td>
<td>empty</td>
<td>empty</td>
</tr>
</tbody>
</table>
<p>dequeue 3 times</p>
<ul>
<li>back = 3</li>
<li>front = 3</li>
</ul>
<table>
<tbody>
<tr>
<td>Values</td>
<td>empty</td>
<td>empty</td>
<td>empty</td>
<td>empty</td>
<td>empty</td>
<td>empty</td>
</tr>
</tbody>
</table>
<h2 id="end">End</h2>
</div>
</main>
<hr>
<footer>
</footer>
</body>
</html>

@ -0,0 +1,75 @@
body { background-color: #222222; padding: 16px; font-family: -apple-system, helvetica, arial, sans-serif; font-size: 16px; color: #ffffff; line-height: 1.5em; overflow-wrap: break-word; }
#wrapper { max-width: 800px; margin: auto; }
#wrapper > header { text-align: center; }
.clear-list { list-style-type: none; margin: 0; padding: 0; }
.clear-list li { margin: 0; padding: 0; }
.projects .namelink { font-weight: bold; }
h1, h2, h3, h4, h5, h6 { line-height: 1em; }
.center { text-align: center; }
header { margin-bottom: 18px; }
hr { border: none; border-bottom: 1px solid #999; }
a { text-decoration: underline; color: #7ad; }
a:visited { color: #ff3492; }
a.nav-link, a.post-title-link { color: #ffffff; text-decoration: none; }
.post-title { line-height: 1.5em; color: #ffffff; margin-bottom: 8px; }
a.citation-link { text-decoration: none; }
nav { text-align: center; padding: 1em 0px; }
nav a { margin: 1em; color: #ffffff; font-weight: bold; font-style: none; }
nav a:hover, a.post-title-link:hover { text-decoration: underline; }
li { margin: .5em; }
table, table tr, table td, table th { border: 1px solid #aaa; border-collapse: collapse; padding: 5px; font-weight: normal; }
table th { font-weight: bold; }
table { width: 75%; margin: auto; }
img { display: block; width: 55%; margin-left: auto; margin-right: auto; }
blockquote { font-style: italic; }
address { font-style: normal; }
@media screen and (max-width: 600px) { body { width: 90%; } nav { text-align: left; width: 100%; } nav a { display: block; text-align: left; padding-left: 0; margin-left: 0; } }
.mono { font-family: monospace; }
.bold { font-weight: bold; }
figcaption { margin-top: 10px; font-style: italic; }
footer { padding-top: 16px; margin-bottom: 100px; }
.terminal, .file { padding: 10px; overflow-x: scroll; }
.terminal { line-height: 1em; color: #00FF00; background-color: #000000; }
.file { line-height: 1.2em; background-color: #444444; color: #ffffff; }
.small-image { width: 100%; }
.post-date { text-transform: uppercase; font-weight: bold; color: #ffffff; }
.post-excerpt { margin-left: 24px; }
.post-header { margin-bottom: 8px; }
/*# sourceMappingURL=style.css.map */

@ -0,0 +1,31 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<TITLE>Index of /assets/js/</TITLE>
<style type="text/css">
<!--
.name, .mtime { text-align: left; }
.size { text-align: right; }
td { text-overflow: ellipsis; white-space: nowrap; overflow: hidden; }
table { border-collapse: collapse; }
tr th { border-bottom: 2px groove; }
//-->
</style>
</HEAD>
<BODY>
<H1>Index of /assets/js/</H1>
<TABLE width="100%"><THEAD><TR>
<TH class="name"><A HREF="http://localhost:4000/assets/js/?N=D">Name</A></TH><TH class="mtime"><A HREF="http://localhost:4000/assets/js/?M=D">Last modified</A></TH><TH class="size"><A HREF="http://localhost:4000/assets/js/?S=D">Size</A></TH>
</TR></THEAD>
<TBODY>
<TR><TD class="name"><A HREF="http://localhost:4000/assets/">Parent Directory</A></TD><TD class="mtime">2021/11/16 20:30</TD><TD class="size">-</TD></TR>
<TR><TD class="name"><A HREF="http://localhost:4000/assets/js/hacked.js">hacked.js</A></TD><TD class="mtime">2021/11/16 22:47</TD><TD class="size">213</TD></TR>
<TR><TD class="name"><A HREF="http://localhost:4000/assets/js/katex.js">katex.js</A></TD><TD class="mtime">2021/11/16 22:47</TD><TD class="size">264762</TD></TR>
<TR><TD class="name"><A HREF="http://localhost:4000/assets/js/katex/">katex/</A></TD><TD class="mtime">2021/11/16 20:30</TD><TD class="size">-</TD></TR>
<TR><TD class="name"><A HREF="http://localhost:4000/assets/js/md/">md/</A></TD><TD class="mtime">2021/11/16 20:30</TD><TD class="size">-</TD></TR>
</TBODY></TABLE><HR> <ADDRESS>
WEBrick/1.7.0 (Ruby/3.0.2/2021-07-07)<BR>
at localhost:4000
</ADDRESS>
</BODY>
</HTML>

@ -0,0 +1,868 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<link rel="stylesheet" href="../../../../../assets/css/style.css" id="main-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="../../../../../assets/js/index.html"></script>
</head>
<body>
<main>
<div id="wrapper">
<h1 id="stacks--queues---1">Stacks &amp; Queues - 1</h1>
<p>CMPT 225, Fall 2021, Lecture 2</p>
<h2 id="stack">Stack</h2>
<ul>
<li>ADT that stores a collection of objects/values</li>
<li>Insertions and removals follow last-in-first-out pattern</li>
<li>Fundamental Operations:
<ul>
<li>push: inserts an element on the “top”</li>
<li>pop: removes + returns the top element</li>
</ul>
</li>
</ul>
<p>e.g.</p>
<table>
<tbody>
<tr>
<td>Stack index</td>
<td>Value</td>
</tr>
</tbody>
</table>
<p>push a</p>
<table>
<tbody>
<tr>
<td>Stack index</td>
<td>Value</td>
</tr>
<tr>
<td>0</td>
<td>a</td>
</tr>
</tbody>
</table>
<p>push b</p>
<table>
<tbody>
<tr>
<td>Stack index</td>
<td>Value</td>
</tr>
<tr>
<td>0</td>
<td>b</td>
</tr>
<tr>
<td>1</td>
<td>a</td>
</tr>
</tbody>
</table>
<p>push c</p>
<table>
<tbody>
<tr>
<td>Stack index</td>
<td>Value</td>
</tr>
<tr>
<td>0</td>
<td>c</td>
</tr>
<tr>
<td>1</td>
<td>b</td>
</tr>
<tr>
<td>2</td>
<td>a</td>
</tr>
</tbody>
</table>
<p>pop</p>
<table>
<tbody>
<tr>
<td>Stack index</td>
<td>Value</td>
</tr>
<tr>
<td>0</td>
<td>b</td>
</tr>
<tr>
<td>1</td>
<td>a</td>
</tr>
</tbody>
</table>
<ul>
<li>conventient optional operations
<ul>
<li>size: return # of elements on stack // encapsulation</li>
<li>empty: check for emptiness // better than “size=0?”</li>
<li>top: return top element, but dont remove it // better than x = pop(); push(x) then use x</li>
</ul>
</li>
</ul>
<h2 id="algorithm-applications">Algorithm Applications</h2>
<ul>
<li>parasing/evaluation/transformation of expressions</li>
<li>speech recognition coding/decoding</li>
<li>shared network access control</li>
<li>programming languages &amp; execution
<ul>
<li>Postscript, Forth, the call stack</li>
</ul>
</li>
<li>things we do daily with computers</li>
</ul>
<h2 id="parenthasies-checking">Parenthasies Checking</h2>
<p>Parenthasies: <code class="language-plaintext highlighter-rouge">(()(((()())()()(()))</code></p>
<p>A diagram showing:
For every left parenthasies, add one to a counter.
For every right parthenthasies, remove one from the counter.
If the counter is not zero by the end of the sequence, there are too many on one side of the parenthasies.</p>
<p>Can be done by counting unmached left parenthasies:</p>
<p>Successful example:</p>
<table>
<tbody>
<tr>
<td>Character</td>
<td>Counter</td>
</tr>
<tr>
<td> </td>
<td>0</td>
</tr>
<tr>
<td>(</td>
<td>1</td>
</tr>
<tr>
<td>(</td>
<td>2</td>
</tr>
<tr>
<td>)</td>
<td>1</td>
</tr>
<tr>
<td>(</td>
<td>2</td>
</tr>
<tr>
<td>(</td>
<td>3</td>
</tr>
<tr>
<td>)</td>
<td>2</td>
</tr>
<tr>
<td>)</td>
<td>1</td>
</tr>
<tr>
<td>)</td>
<td>0</td>
</tr>
<tr>
<td>Yay!</td>
<td>0</td>
</tr>
</tbody>
</table>
<p>Failed example:</p>
<table>
<tbody>
<tr>
<td>Character</td>
<td>Country</td>
</tr>
<tr>
<td> </td>
<td>0</td>
</tr>
<tr>
<td>(</td>
<td>1</td>
</tr>
<tr>
<td>(</td>
<td>2</td>
</tr>
<tr>
<td>)</td>
<td>1</td>
</tr>
<tr>
<td>(</td>
<td>2</td>
</tr>
<tr>
<td>)</td>
<td>1</td>
</tr>
<tr>
<td> </td>
<td>Oh no its not zero!</td>
</tr>
</tbody>
</table>
<p>Another fail:</p>
<table>
<tbody>
<tr>
<td>Character</td>
<td>Counter</td>
</tr>
<tr>
<td> </td>
<td>0</td>
</tr>
<tr>
<td>(</td>
<td>1</td>
</tr>
<tr>
<td>)</td>
<td>0</td>
</tr>
<tr>
<td>(</td>
<td>1</td>
</tr>
<tr>
<td>)</td>
<td>0</td>
</tr>
<tr>
<td>)</td>
<td>-1</td>
</tr>
<tr>
<td> </td>
<td>Negative 1 this time!</td>
</tr>
</tbody>
</table>
<p>Do this one yourself:</p>
<table>
<tbody>
<tr>
<td>Character</td>
<td>Counter</td>
</tr>
<tr>
<td>(</td>
<td> </td>
</tr>
<tr>
<td>)</td>
<td> </td>
</tr>
<tr>
<td>)</td>
<td> </td>
</tr>
<tr>
<td>(</td>
<td> </td>
</tr>
</tbody>
</table>
<p>But consider multiple grouping symbols: <code class="language-plaintext highlighter-rouge">(\{\{)</code>, <code class="language-plaintext highlighter-rouge">(\{)\{</code>, <code class="language-plaintext highlighter-rouge">(\{[( ... ]</code>.
Counting is not enough.</p>
<h2 id="parenthasies-checking-1">Parenthasies Checking</h2>
<p>Diagram showing failure on the last character of this sequence: <code class="language-plaintext highlighter-rouge">(()((()()))()(())))</code></p>
<p>Can be done by counting unmatched left parenthasies:</p>
<table>
<tbody>
<tr>
<td>Character</td>
<td>Counter</td>
</tr>
<tr>
<td>(</td>
<td>1</td>
</tr>
<tr>
<td>(</td>
<td>2</td>
</tr>
<tr>
<td>)</td>
<td>1</td>
</tr>
<tr>
<td>(</td>
<td>2</td>
</tr>
<tr>
<td>(</td>
<td>3</td>
</tr>
<tr>
<td>)</td>
<td>2</td>
</tr>
<tr>
<td>)</td>
<td>1</td>
</tr>
<tr>
<td>)</td>
<td>0</td>
</tr>
</tbody>
</table>
<p>Example 2:</p>
<table>
<tbody>
<tr>
<td>Character</td>
<td>Counter</td>
</tr>
<tr>
<td>(</td>
<td>1</td>
</tr>
<tr>
<td>(</td>
<td>2</td>
</tr>
<tr>
<td>)</td>
<td>1</td>
</tr>
<tr>
<td>(</td>
<td>2</td>
</tr>
<tr>
<td>)</td>
<td>1</td>
</tr>
</tbody>
</table>
<p>Example 3:</p>
<table>
<tbody>
<tr>
<td>Character</td>
<td>Counter</td>
</tr>
<tr>
<td>(</td>
<td>1</td>
</tr>
<tr>
<td>)</td>
<td>0</td>
</tr>
<tr>
<td>(</td>
<td>1</td>
</tr>
<tr>
<td>)</td>
<td>0</td>
</tr>
<tr>
<td>)</td>
<td>-1</td>
</tr>
</tbody>
</table>
<p>Example 4:</p>
<table>
<tbody>
<tr>
<td>Character</td>
<td>Counter</td>
</tr>
<tr>
<td>(</td>
<td>1</td>
</tr>
<tr>
<td>)</td>
<td>0</td>
</tr>
<tr>
<td>)</td>
<td>-1</td>
</tr>
<tr>
<td>(</td>
<td>0</td>
</tr>
</tbody>
</table>
<p>But consider multiple grouping symbols:</p>
<ul>
<li>sequence <code class="language-plaintext highlighter-rouge">(\{\})</code> will and should work</li>
<li>sequence <code class="language-plaintext highlighter-rouge">(\{)\}</code> will work and should not</li>
<li>sequence <code class="language-plaintext highlighter-rouge">(\{[( ...</code> ???</li>
</ul>
<p>Counting is not enough.</p>
<h2 id="stack-based-algorithm-for-checking-grouping-symbols">Stack-based Algorithm for Checking Grouping Symbols</h2>
<p>Pseudo-code:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>I is an input stream of symbols.
S is a new empty stack.
while there are signals to read from I {
c is next symbol from I
if c is a left grouping signal {
push c on S
} else if c is a right grouping signal{
if s in empty { report error and stop }
d is pop S
if c and d do not match { report error and stop }
endif // if c is not a grouping symbol, ignore it
end while
if S is not empty { report error and exit }
report ok
</code></pre></div></div>
<p>Diagram showing how each set of parenthasies are matched, innermost first torwards the outermost.</p>
<h2 id="stack-partially-filled-array-implementation">Stack: Partially-Filled Array Implementation</h2>
<p>Variables:</p>
<ul>
<li>A - an array of stack elements</li>
<li>capacity - size of array</li>
<li>top - index in array of top stack element
<ul>
<li>-1 if stack is empty</li>
</ul>
</li>
</ul>
<p>A starts out as:</p>
<table>
<tbody>
<tr>
<td>Index</td>
<td>0</td>
<td>1</td>
<td>2</td>
<td></td>
<td>capacity-1</td>
</tr>
<tr>
<td>Value</td>
<td>a</td>
<td>b</td>
<td>c</td>
<td></td>
<td> </td>
</tr>
</tbody>
</table>
<ul>
<li>Capacity = &lt;size of A&gt;</li>
<li>top = 2</li>
</ul>
<p>push e</p>
<p>A now equals</p>
<table>
<tbody>
<tr>
<td>Index</td>
<td>0</td>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
<td></td>
<td>capacity-1</td>
</tr>
<tr>
<td>Value</td>
<td>a</td>
<td>b</td>
<td>c</td>
<td>d</td>
<td>e</td>
<td></td>
<td> </td>
</tr>
</tbody>
</table>
<ul>
<li>capacity = &lt;size of A&gt;</li>
<li>top = 3</li>
</ul>
<h2 id="the-queue-adt">The Queue ADT</h2>
<p>A container that stores a collection of items with insertion and removal in “first-in-first-out” order.</p>
<p>Stack: a digram showing circled being placed on top of eachother, pushing circles into the tube, then popping them out from the same size (the top). Like a pringles can of elements.</p>
<p>Queue: a diagram showing circles being unqueued in on the left and dequeued on the right. Like waiting in line for food.</p>
<p>Basic operations:</p>
<ul>
<li>enqueue: add an item to the back of a list</li>
<li>dequeue: remove &amp; return the item at the front of the list</li>
</ul>
<h2 id="example-palindrome-checking">Example: Palindrome Checking</h2>
<p>Sequence <code class="language-plaintext highlighter-rouge">aba</code> should succeed.
Sequence <code class="language-plaintext highlighter-rouge">aab</code> should not.</p>
<p>In an array: a diagram showing the following pattern with the variable <code class="language-plaintext highlighter-rouge">i</code> set to the leftmost element and <code class="language-plaintext highlighter-rouge">j</code> set to the rightmost element.</p>
<table>
<tbody>
<tr>
<td>Values</td>
<td>a</td>
<td>b</td>
<td>c</td>
<td></td>
<td>s</td>
<td>b</td>
<td>a</td>
</tr>
</tbody>
</table>
<p>With a stack and queue:</p>
<ol>
<li>read symbols, starting each in a stack and a queue</li>
<li>while the stack, queue are not empty:
<ul>
<li>pop and element from the stack + delete an element from the queue</li>
<li>if different -&gt; not a palindrome</li>
</ul>
</li>
<li>palindrome</li>
</ol>
<h2 id="queue-array-implementations">Queue: Array Implementations</h2>
<p>Enqueue: a,b,c,d.
Front is now a, last is now d.</p>
<table>
<tbody>
<tr>
<td>Values</td>
<td>a</td>
<td>b</td>
<td>c</td>
<td>d</td>
<td></td>
</tr>
</tbody>
</table>
<p>Dequeue returns and deletes first element.
Front is now b, last is now d.</p>
<table>
<tbody>
<tr>
<td>Values</td>
<td>?</td>
<td>b</td>
<td>c</td>
<td>d</td>
<td></td>
</tr>
</tbody>
</table>
<p>Many enquques/dequeues later:</p>
<table>
<tbody>
<tr>
<td>Values</td>
<td>s</td>
<td></td>
<td>m</td>
<td>n</td>
<td>o</td>
</tr>
</tbody>
</table>
<p>Front element is now <code class="language-plaintext highlighter-rouge">m</code>, last element is now s.</p>
<table>
<tbody>
<tr>
<td>Values</td>
<td>?</td>
<td>t</td>
<td>u</td>
<td>v</td>
<td>w</td>
<td></td>
</tr>
</tbody>
</table>
<p>A similar slide is here, but I cant see the differnece.</p>
<p>Variables:</p>
<ul>
<li>array A is array of size capacity</li>
<li>front is 0</li>
<li>back is 0</li>
<li>size is 0</li>
<li>capacity = &lt;size of array&gt;</li>
</ul>
<p>Pseudo-code:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>array A = array of size capacity // holds queue contents
front = 0 // index in A of front element, if queue not empty
back = 0 // index where next unqueued element will go
size = 0 // number of elements in queue
capacity = &lt;size of array&gt; // ???(can't read) queue size supported
enqueue(x) { // adds x to the back of the queue
// requires size&lt;capacity&gt;
A[back] = x
size = size + 1
back = (back + 1) % capacity
}
dequeue() { // removes front element of queue and returns it
// required size &gt; 0
temp = A[front]
front = (front + 1) % capacity
size = size - 1
return temp
}
</code></pre></div></div>
<p>Is <code class="language-plaintext highlighter-rouge">size == front - back</code>?</p>
<p>Diagram showing only true if front and back havent been switched around due to wrapping around back to the beginning o the array.</p>
<h2 id="circular-array-queue-example">“Circular Array” Queue Example</h2>
<ul>
<li>size = 0</li>
<li>front = 0</li>
<li>back = 0</li>
</ul>
<table>
<tbody>
<tr>
<td>Values</td>
<td>empty</td>
<td>empty</td>
<td>empty</td>
<td>empty</td>
<td>empty</td>
<td>empty</td>
</tr>
</tbody>
</table>
<p>enqueue: a,b,c,d</p>
<ul>
<li>front = 0</li>
<li>back = 4</li>
</ul>
<table>
<tbody>
<tr>
<td>Values</td>
<td>a</td>
<td>b</td>
<td>c</td>
<td>d</td>
<td>empty</td>
<td>empty</td>
</tr>
</tbody>
</table>
<p>dequque 3 times</p>
<ul>
<li>front = 3</li>
<li>back = 4</li>
</ul>
<table>
<tbody>
<tr>
<td>Values</td>
<td>empty</td>
<td>empty</td>
<td>empty</td>
<td>d</td>
<td>empty</td>
<td>empty</td>
</tr>
</tbody>
</table>
<p>enqueue e,f,g,h</p>
<ul>
<li>front = 3</li>
<li>back = 2</li>
</ul>
<table>
<tbody>
<tr>
<td>Values</td>
<td>g</td>
<td>h</td>
<td>empty</td>
<td>d</td>
<td>e</td>
<td>f</td>
</tr>
</tbody>
</table>
<p>unqueue j</p>
<ul>
<li>size = 6</li>
<li>font = 3</li>
<li>back = 3</li>
</ul>
<table>
<tbody>
<tr>
<td>Values</td>
<td>g</td>
<td>h</td>
<td>j</td>
<td>d</td>
<td>e</td>
<td>f</td>
</tr>
</tbody>
</table>
<p>dequeue 3 times</p>
<ul>
<li>back = 3</li>
<li>front = 0</li>
</ul>
<table>
<tbody>
<tr>
<td>Values</td>
<td>g</td>
<td>h</td>
<td>j</td>
<td>empty</td>
<td>empty</td>
<td>empty</td>
</tr>
</tbody>
</table>
<p>dequeue 3 times</p>
<ul>
<li>back = 3</li>
<li>front = 3</li>
</ul>
<table>
<tbody>
<tr>
<td>Values</td>
<td>empty</td>
<td>empty</td>
<td>empty</td>
<td>empty</td>
<td>empty</td>
<td>empty</td>
</tr>
</tbody>
</table>
<h2 id="end">End</h2>
</div>
</main>
<hr>
<footer>
</footer>
</body>
</html>

@ -0,0 +1,172 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<link rel="stylesheet" href="../../../../../assets/css/style.css" id="main-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="../../../../../assets/js/index.html"></script>
</head>
<body>
<main>
<div id="wrapper">
<h1 id="memory--pointers-1">Memory &amp; Pointers 1</h1>
<p>CMPT-225, Fall 2021</p>
<h2 id="computer-memory">Computer Memory</h2>
<ul>
<li>A sequence of locations</li>
<li>Indexed by address: 0,1,2,…</li>
<li>Each location stores a data <em>byte</em></li>
<li>Processor can <em>read</em> or <em>write</em> the byte at each address.</li>
<li>Regions of memory are allocated to processes <em>as needed</em>, according to some scheme.</li>
</ul>
<p>Diagram displaying “Code + Data for running part of OS” at the start of memory, “Free memory” in the middle, and “Code + Data for running user processes” and the end.</p>
<h2 id="variables--memory">Variables &amp; Memory</h2>
<p>A variable is (roughly) and names &amp; tagged collection of bytes:</p>
<p>Diagram showing:</p>
<ul>
<li>“int x; x = 6” taking 4 bytes of memory,</li>
<li>“char c; c = x;” taking 1 byte of memory</li>
<li>
<p>“bool b; b = true;” taking 1 byte of memory</p>
</li>
<li>So, <em>at run time</em>, each variable has an <em>address</em> in memory.</li>
<li>In C, C++ we can:
<ul>
<li>access the address of a variable</li>
<li>access a variable or memory location by its address</li>
<li>declare variables by storing addresses (pointers).</li>
</ul>
</li>
</ul>
<h2 id="addresses--pointers---by-example">Addresses &amp; Pointers - By Example</h2>
<ul>
<li>“int i = 5;”
<ul>
<li>allocate space for an <em>int</em>,</li>
<li>name the space “i”,</li>
<li>store 5 there</li>
</ul>
</li>
<li>“int *p;”
<ul>
<li>allocate space for an address,</li>
<li>name it p,</li>
<li>record its type as “pointer to int”</li>
</ul>
</li>
<li>“p = ∧i;”
<ul>
<li>&amp;i” is the address of “i”</li>
<li>store ∧i in p</li>
<li>so, p becomes a <em>pointer to i</em></li>
</ul>
</li>
<li>“cout « i;”
<ul>
<li>outputs the value stored in i, <em>5</em></li>
</ul>
</li>
<li>“cout « p;”
<ul>
<li>outputs the address of i: 0xbffffbbc</li>
</ul>
</li>
<li>“cout « *p;”
<ul>
<li>”*” <em>dereferences</em> p. That is, *p is the value <em>pointed to by p</em>. In this case <em>5</em></li>
</ul>
</li>
</ul>
<p>Diagram of memory:</p>
<table>
<tbody>
<tr>
<td>Address</td>
<td>Name</td>
<td>Value</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td><span id="point">254</span></td>
<td>i</td>
<td>5</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>923</td>
<td>p</td>
<td><a href="index.html#point">254</a></td>
</tr>
</tbody>
</table>
<p>Second diagram of memory:</p>
<table>
<tbody>
<tr>
<td>Address</td>
<td>Name</td>
<td>Value</td>
<td>Size</td>
</tr>
<tr>
<td>0x6fffbe</td>
<td>i</td>
<td>5</td>
<td>4 bytes</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>???</td>
<td>p</td>
<td>0x6fffbe</td>
<td>4 bytesa</td>
</tr>
</tbody>
</table>
<p>Slide showing program code: see pointers.c</p>
<p>Slide showing output: see output.txt</p>
<p>Slide showing same program with different highlights.</p>
<p>Slide showing same output with different highlights.</p>
<h2 id="end">End</h2>
</div>
</main>
<hr>
<footer>
</footer>
</body>
</html>

@ -0,0 +1,173 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<link rel="stylesheet" href="/assets/css/style.css" id="main-css">
<link rel="stylesheet" href="/assets/css/transcription.css" id="trans-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/js/"></script>
</head>
<body>
<main>
<div id="wrapper">
<h1 id="memory--pointers-1">Memory &amp; Pointers 1</h1>
<p>CMPT-225, Fall 2021</p>
<h2 id="computer-memory">Computer Memory</h2>
<ul>
<li>A sequence of locations</li>
<li>Indexed by address: 0,1,2,…</li>
<li>Each location stores a data <em>byte</em></li>
<li>Processor can <em>read</em> or <em>write</em> the byte at each address.</li>
<li>Regions of memory are allocated to processes <em>as needed</em>, according to some scheme.</li>
</ul>
<p>Diagram displaying “Code + Data for running part of OS” at the start of memory, “Free memory” in the middle, and “Code + Data for running user processes” and the end.</p>
<h2 id="variables--memory">Variables &amp; Memory</h2>
<p>A variable is (roughly) and names &amp; tagged collection of bytes:</p>
<p>Diagram showing:</p>
<ul>
<li>“int x; x = 6” taking 4 bytes of memory,</li>
<li>“char c; c = x;” taking 1 byte of memory</li>
<li>
<p>“bool b; b = true;” taking 1 byte of memory</p>
</li>
<li>So, <em>at run time</em>, each variable has an <em>address</em> in memory.</li>
<li>In C, C++ we can:
<ul>
<li>access the address of a variable</li>
<li>access a variable or memory location by its address</li>
<li>declare variables by storing addresses (pointers).</li>
</ul>
</li>
</ul>
<h2 id="addresses--pointers---by-example">Addresses &amp; Pointers - By Example</h2>
<ul>
<li>“int i = 5;”
<ul>
<li>allocate space for an <em>int</em>,</li>
<li>name the space “i”,</li>
<li>store 5 there</li>
</ul>
</li>
<li>“int *p;”
<ul>
<li>allocate space for an address,</li>
<li>name it p,</li>
<li>record its type as “pointer to int”</li>
</ul>
</li>
<li>“p = ∧i;”
<ul>
<li>&amp;i” is the address of “i”</li>
<li>store ∧i in p</li>
<li>so, p becomes a <em>pointer to i</em></li>
</ul>
</li>
<li>“cout « i;”
<ul>
<li>outputs the value stored in i, <em>5</em></li>
</ul>
</li>
<li>“cout « p;”
<ul>
<li>outputs the address of i: 0xbffffbbc</li>
</ul>
</li>
<li>“cout « *p;”
<ul>
<li>”*” <em>dereferences</em> p. That is, *p is the value <em>pointed to by p</em>. In this case <em>5</em></li>
</ul>
</li>
</ul>
<p>Diagram of memory:</p>
<table>
<tbody>
<tr>
<td>Address</td>
<td>Name</td>
<td>Value</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td><span id="point">254</span></td>
<td>i</td>
<td>5</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>923</td>
<td>p</td>
<td><a href="#point">254</a></td>
</tr>
</tbody>
</table>
<p>Second diagram of memory:</p>
<table>
<tbody>
<tr>
<td>Address</td>
<td>Name</td>
<td>Value</td>
<td>Size</td>
</tr>
<tr>
<td>0x6fffbe</td>
<td>i</td>
<td>5</td>
<td>4 bytes</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>???</td>
<td>p</td>
<td>0x6fffbe</td>
<td>4 bytesa</td>
</tr>
</tbody>
</table>
<p>Slide showing program code: see pointers.c</p>
<p>Slide showing output: see output.txt</p>
<p>Slide showing same program with different highlights.</p>
<p>Slide showing same output with different highlights.</p>
<h2 id="end">End</h2>
</div>
</main>
<hr>
<footer>
</footer>
</body>
</html>

@ -0,0 +1,75 @@
body { background-color: #222222; padding: 16px; font-family: -apple-system, helvetica, arial, sans-serif; font-size: 16px; color: #ffffff; line-height: 1.5em; overflow-wrap: break-word; }
#wrapper { max-width: 800px; margin: auto; }
#wrapper > header { text-align: center; }
.clear-list { list-style-type: none; margin: 0; padding: 0; }
.clear-list li { margin: 0; padding: 0; }
.projects .namelink { font-weight: bold; }
h1, h2, h3, h4, h5, h6 { line-height: 1em; }
.center { text-align: center; }
header { margin-bottom: 18px; }
hr { border: none; border-bottom: 1px solid #999; }
a { text-decoration: underline; color: #7ad; }
a:visited { color: #ff3492; }
a.nav-link, a.post-title-link { color: #ffffff; text-decoration: none; }
.post-title { line-height: 1.5em; color: #ffffff; margin-bottom: 8px; }
a.citation-link { text-decoration: none; }
nav { text-align: center; padding: 1em 0px; }
nav a { margin: 1em; color: #ffffff; font-weight: bold; font-style: none; }
nav a:hover, a.post-title-link:hover { text-decoration: underline; }
li { margin: .5em; }
table, table tr, table td, table th { border: 1px solid #aaa; border-collapse: collapse; padding: 5px; font-weight: normal; }
table th { font-weight: bold; }
table { width: 75%; margin: auto; }
img { display: block; width: 55%; margin-left: auto; margin-right: auto; }
blockquote { font-style: italic; }
address { font-style: normal; }
@media screen and (max-width: 600px) { body { width: 90%; } nav { text-align: left; width: 100%; } nav a { display: block; text-align: left; padding-left: 0; margin-left: 0; } }
.mono { font-family: monospace; }
.bold { font-weight: bold; }
figcaption { margin-top: 10px; font-style: italic; }
footer { padding-top: 16px; margin-bottom: 100px; }
.terminal, .file { padding: 10px; overflow-x: scroll; }
.terminal { line-height: 1em; color: #00FF00; background-color: #000000; }
.file { line-height: 1.2em; background-color: #444444; color: #ffffff; }
.small-image { width: 100%; }
.post-date { text-transform: uppercase; font-weight: bold; color: #ffffff; }
.post-excerpt { margin-left: 24px; }
.post-header { margin-bottom: 8px; }
/*# sourceMappingURL=style.css.map */

@ -0,0 +1,31 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<TITLE>Index of /assets/js/</TITLE>
<style type="text/css">
<!--
.name, .mtime { text-align: left; }
.size { text-align: right; }
td { text-overflow: ellipsis; white-space: nowrap; overflow: hidden; }
table { border-collapse: collapse; }
tr th { border-bottom: 2px groove; }
//-->
</style>
</HEAD>
<BODY>
<H1>Index of /assets/js/</H1>
<TABLE width="100%"><THEAD><TR>
<TH class="name"><A HREF="http://localhost:4000/assets/js/?N=D">Name</A></TH><TH class="mtime"><A HREF="http://localhost:4000/assets/js/?M=D">Last modified</A></TH><TH class="size"><A HREF="http://localhost:4000/assets/js/?S=D">Size</A></TH>
</TR></THEAD>
<TBODY>
<TR><TD class="name"><A HREF="http://localhost:4000/assets/">Parent Directory</A></TD><TD class="mtime">2021/11/16 20:30</TD><TD class="size">-</TD></TR>
<TR><TD class="name"><A HREF="http://localhost:4000/assets/js/hacked.js">hacked.js</A></TD><TD class="mtime">2021/11/16 22:47</TD><TD class="size">213</TD></TR>
<TR><TD class="name"><A HREF="http://localhost:4000/assets/js/katex.js">katex.js</A></TD><TD class="mtime">2021/11/16 22:47</TD><TD class="size">264762</TD></TR>
<TR><TD class="name"><A HREF="http://localhost:4000/assets/js/katex/">katex/</A></TD><TD class="mtime">2021/11/16 20:30</TD><TD class="size">-</TD></TR>
<TR><TD class="name"><A HREF="http://localhost:4000/assets/js/md/">md/</A></TD><TD class="mtime">2021/11/16 20:30</TD><TD class="size">-</TD></TR>
</TBODY></TABLE><HR> <ADDRESS>
WEBrick/1.7.0 (Ruby/3.0.2/2021-07-07)<BR>
at localhost:4000
</ADDRESS>
</BODY>
</HTML>

@ -0,0 +1,172 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<link rel="stylesheet" href="../../../../../assets/css/style.css" id="main-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="../../../../../assets/js/index.html"></script>
</head>
<body>
<main>
<div id="wrapper">
<h1 id="memory--pointers-1">Memory &amp; Pointers 1</h1>
<p>CMPT-225, Fall 2021</p>
<h2 id="computer-memory">Computer Memory</h2>
<ul>
<li>A sequence of locations</li>
<li>Indexed by address: 0,1,2,…</li>
<li>Each location stores a data <em>byte</em></li>
<li>Processor can <em>read</em> or <em>write</em> the byte at each address.</li>
<li>Regions of memory are allocated to processes <em>as needed</em>, according to some scheme.</li>
</ul>
<p>Diagram displaying “Code + Data for running part of OS” at the start of memory, “Free memory” in the middle, and “Code + Data for running user processes” and the end.</p>
<h2 id="variables--memory">Variables &amp; Memory</h2>
<p>A variable is (roughly) and names &amp; tagged collection of bytes:</p>
<p>Diagram showing:</p>
<ul>
<li>“int x; x = 6” taking 4 bytes of memory,</li>
<li>“char c; c = x;” taking 1 byte of memory</li>
<li>
<p>“bool b; b = true;” taking 1 byte of memory</p>
</li>
<li>So, <em>at run time</em>, each variable has an <em>address</em> in memory.</li>
<li>In C, C++ we can:
<ul>
<li>access the address of a variable</li>
<li>access a variable or memory location by its address</li>
<li>declare variables by storing addresses (pointers).</li>
</ul>
</li>
</ul>
<h2 id="addresses--pointers---by-example">Addresses &amp; Pointers - By Example</h2>
<ul>
<li>“int i = 5;”
<ul>
<li>allocate space for an <em>int</em>,</li>
<li>name the space “i”,</li>
<li>store 5 there</li>
</ul>
</li>
<li>“int *p;”
<ul>
<li>allocate space for an address,</li>
<li>name it p,</li>
<li>record its type as “pointer to int”</li>
</ul>
</li>
<li>“p = ∧i;”
<ul>
<li>&amp;i” is the address of “i”</li>
<li>store ∧i in p</li>
<li>so, p becomes a <em>pointer to i</em></li>
</ul>
</li>
<li>“cout « i;”
<ul>
<li>outputs the value stored in i, <em>5</em></li>
</ul>
</li>
<li>“cout « p;”
<ul>
<li>outputs the address of i: 0xbffffbbc</li>
</ul>
</li>
<li>“cout « *p;”
<ul>
<li>”*” <em>dereferences</em> p. That is, *p is the value <em>pointed to by p</em>. In this case <em>5</em></li>
</ul>
</li>
</ul>
<p>Diagram of memory:</p>
<table>
<tbody>
<tr>
<td>Address</td>
<td>Name</td>
<td>Value</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td><span id="point">254</span></td>
<td>i</td>
<td>5</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>923</td>
<td>p</td>
<td><a href="index.html#point">254</a></td>
</tr>
</tbody>
</table>
<p>Second diagram of memory:</p>
<table>
<tbody>
<tr>
<td>Address</td>
<td>Name</td>
<td>Value</td>
<td>Size</td>
</tr>
<tr>
<td>0x6fffbe</td>
<td>i</td>
<td>5</td>
<td>4 bytes</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>???</td>
<td>p</td>
<td>0x6fffbe</td>
<td>4 bytesa</td>
</tr>
</tbody>
</table>
<p>Slide showing program code: see pointers.c</p>
<p>Slide showing output: see output.txt</p>
<p>Slide showing same program with different highlights.</p>
<p>Slide showing same output with different highlights.</p>
<h2 id="end">End</h2>
</div>
</main>
<hr>
<footer>
</footer>
</body>
</html>

@ -0,0 +1,38 @@
main() begin
XXXX = 111111111
XXXX is stored at &XXXX = 0xfffff40750e0
YYYY is a pointer to XXXX: YYYY = 0xfffff40750e0
* dereferences the pointer: *YYYY = 111111111
Array AAAA can be accessed with array notaions:
AAAA[0] = 222222222
AAAA[1] = 333333333
AAAA[2] = 444444444
Array variable AAAA is a pointer to A[0]: AAAA = 0xfffff40750f8
So, dereferencing AAAA should give us A[0]: *AAAA = 222222222
Adding 1 to an int pointer makes it point to the next int
AAAA = 0xfffff40750f8
AAAA+1 = 0xfffff40750fc
*(AAAA+1) = 333333333
We can look at contents of a chunk of memory:
Peeking at the memory in the neighbourhood of &XXXX, we see:
Address Contents in Hex Contents in Decimal
0xfffff40750fc: 13de4355 = 333333333
0xfffff40750f8: d3ed78e = 222222222
0xfffff40750f4: ffff = 65535
0xfffff40750f0: f40750e0 = -200847136
0xfffff40750ec: ffff = 65535
0xfffff40750e8: f40750e8 = -200847128
0xfffff40750e4: 6 = 6
0xfffff40750e0: 69f6bc7 = 111111111
0xfffff40750dc: ffff = 65535
0xfffff40750d8: a478f4e0 = -1535576864
0xfffff40750d4: aaaa = 43690
0xfffff40750d0: c46a13e0 = -999681056
0xfffff40750cc: ffff = 65535
0xfffff40750c8: a478f538 = -1535576776
0xfffff40750c4: ffff = 65535
main() ends

@ -0,0 +1,43 @@
/* a small program to demonstrate C++ addresses, pointers and arrays */
#include <iostream> /* Tait: missing name for import */
#include <iomanip> /* Tait: missing name from import */
using namespace std;
int main(){
cout << "main() begin\n";
int XXXX = 111111111;
cout << "XXXX = " << XXXX << endl;
cout << "XXXX is stored at &XXXX = " << &XXXX << endl;
int * YYYY = &XXXX;
cout << "YYYY is a pointer to XXXX: YYYY = " << YYYY << endl;
cout << "* dereferences the pointer: *YYYY = " << *YYYY << endl;
int AAAA[3] = { 222222222, 333333333, 444444444 };
cout << "Array AAAA can be accessed with array notaions: " << endl;
cout << " AAAA[0] = " << AAAA[0] << endl;
cout << " AAAA[1] = " << AAAA[1] << endl;
cout << " AAAA[2] = " << AAAA[2] << endl << endl;
cout << "Array variable AAAA is a pointer to A[0]: AAAA = " << AAAA << endl;
cout << "So, dereferencing AAAA should give us A[0]: *AAAA = " << *AAAA << endl << endl;
cout << "Adding 1 to an int pointer makes it point to the next int" << endl;
cout << "AAAA = " << AAAA << endl;
cout << "AAAA+1 = " << (AAAA+1) << endl;
cout << "*(AAAA+1) = " << *(AAAA+1) << endl << endl;
cout << "We can look at contents of a chunk of memory:" << endl;
cout << "Peeking at the memory in the neighbourhood of &XXXX, we see: " << endl << endl;
cout << "Address Contents in Hex Contents in Decimal " << endl;
int * p = (&XXXX)+7;
for (int i = 0; i < 15; i++) {
cout << p << ": " << setw(8) << hex << *p << " = " << setw(11) << dec << *p << endl;
p -= 1;
}
cout << "main() ends" << endl;
}

@ -0,0 +1,102 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<link rel="stylesheet" href="../../../../../assets/css/style.css" id="main-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="../../../../../assets/js/index.html"></script>
<link rel="stylesheet" href="../../../../../assets/css/katex.css" id="math-css">
</head>
<body>
<main>
<div id="wrapper">
<h1 id="vector-implementation-basics">Vector Implementation Basics</h1>
<ul>
<li>CMPT 225</li>
<li>Fall 2021</li>
<li>Lecture 4</li>
</ul>
<h2 id="example-using-a-simple-vector-class">Example Using a Simple “Vector” Class</h2>
<p>Take a look at the <a href="http://localhost:4000/transcriptions/src/cmpt-225/04/04/simple_vector.cpp">simple_vector.cpp</a> file.</p>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<tr>
<td><span id="y1">y</span></td>
<td>float</td>
<td>(empty)</td>
</tr>
<tr>
<td><span id="x1">x</span></td>
<td>int</td>
<td>5</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>p</td>
<td>int *</td>
<td><a href="index.html#x1">address</a></td>
</tr>
<tr>
<td>g</td>
<td>int *</td>
<td><a href="index.html#y1">p+1</a></td>
</tr>
</tbody>
</table>
<p>What is *g?</p>
<h2 id="implementation-in-ivectorh">Implementation in <em>IVector.h</em></h2>
<p>See <a href="http://localhost:4000/transcriptions/src/cmpt-225/04/04/IVector.h">IVector.h</a></p>
<h2 id="templates">Templates</h2>
<ul>
<li>Often, we have algorithms that will work on many data types, with few or no changes.</li>
<li>In <em>strongly typed</em> languages, we need a way to produce “generic” codecode that can work on different types in different places.</li>
<li>In C++, <em>templates</em> let us write generic code.</li>
<li>A template function or class defineition has a <em>placeholder</em> for one or more data types that is instanciated at compile time.</li>
<li>The instanciation may be different at different places in the same code.</li>
</ul>
<h2 id="test-program">Test Program</h2>
<p>See <a href="http://localhost:4000/transcriptions/src/cmpt-225/04/04/test_program.cpp">test_program.cpp</a></p>
<p>See <a href="http://localhost:4000/transcriptions/src/cmpt-225/04/04/simple_vector2.cpp">simple_vector2.cpp</a></p>
<h2 id="tvector-is-a-templated-version-of-ivector">TVector is a templated version of IVector</h2>
<p>See <a href="http://localhost:4000/transcriptions/src/cmpt-225/04/04/TVector.h">TVector.h</a></p>
<p>See <a href="http://localhost:4000/transcriptions/src/cmpt-225/04/04/Vector.h">Vector.h</a></p>
<p>See <a href="http://localhost:4000/transcriptions/src/cmpt-225/04/04/TestVector.cpp">TestVector.cpp</a></p>
</div>
</main>
<hr>
<footer>
</footer>
</body>
</html>

@ -0,0 +1,103 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title> | tait.tech</title>
<link rel="stylesheet" href="/assets/css/style.css" id="main-css">
<link rel="stylesheet" href="/assets/css/transcription.css" id="trans-css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/assets/js/"></script>
<link rel="stylesheet" href="/assets/css/katex.css" id="math-css">
</head>
<body>
<main>
<div id="wrapper">
<h1 id="vector-implementation-basics">Vector Implementation Basics</h1>
<ul>
<li>CMPT 225</li>
<li>Fall 2021</li>
<li>Lecture 4</li>
</ul>
<h2 id="example-using-a-simple-vector-class">Example Using a Simple “Vector” Class</h2>
<p>Take a look at the <a href="./simple_vector.cpp">simple_vector.cpp</a> file.</p>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<tr>
<td><span id="y1">y</span></td>
<td>float</td>
<td>(empty)</td>
</tr>
<tr>
<td><span id="x1">x</span></td>
<td>int</td>
<td>5</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>p</td>
<td>int *</td>
<td><a href="#x1">address</a></td>
</tr>
<tr>
<td>g</td>
<td>int *</td>
<td><a href="#y1">p+1</a></td>
</tr>
</tbody>
</table>
<p>What is *g?</p>
<h2 id="implementation-in-ivectorh">Implementation in <em>IVector.h</em></h2>
<p>See <a href="./IVector.h">IVector.h</a></p>
<h2 id="templates">Templates</h2>
<ul>
<li>Often, we have algorithms that will work on many data types, with few or no changes.</li>
<li>In <em>strongly typed</em> languages, we need a way to produce “generic” codecode that can work on different types in different places.</li>
<li>In C++, <em>templates</em> let us write generic code.</li>
<li>A template function or class defineition has a <em>placeholder</em> for one or more data types that is instanciated at compile time.</li>
<li>The instanciation may be different at different places in the same code.</li>
</ul>
<h2 id="test-program">Test Program</h2>
<p>See <a href="./test_program.cpp">test_program.cpp</a></p>
<p>See <a href="./simple_vector2.cpp">simple_vector2.cpp</a></p>
<h2 id="tvector-is-a-templated-version-of-ivector">TVector is a templated version of IVector</h2>
<p>See <a href="./TVector.h">TVector.h</a></p>
<p>See <a href="./Vector.h">Vector.h</a></p>
<p>See <a href="./TestVector.cpp">TestVector.cpp</a></p>
</div>
</main>
<hr>
<footer>
</footer>
</body>
</html>

@ -0,0 +1,84 @@
/*Transcriber's note: these first two lines of ifndef and define are added to make compilation work.*/
#ifndef _H_IVECTOR
#define _H_IVECTOR
#include <iostream>
class IVector
{
public:
// Constructor
IVector(int initSize=0)
: theSize{initSize}, theCapacity{initSize+10}
{
objects = new int(theCapacity);
}
// Destructor
~IVector()
{delete [] objects;}
// Check for emptyness
bool empty() const {return size() == 0;}
// Return size of list
int size() const {return theSize;}
// Access the element at a given index
// This is the non-const version, so you can change the element.
int& operator[](int index)
{
return objects[index];
}
// Access the element at a given index
// This is the const version, for accessing the value only
const int& operator[](int index) const
{
return objects[index];
}
// Increase the capacity (i.e., array size)
void reserve(int newCapacity)
{
if(newCapacity>theSize){
int *newArray = new int[newCapacity];
for (int k=0;k<theSize;++k){
newArray[k] = std::move(objects[k]);
}
theCapacity = newCapacity;
std::swap(objects, newArray);
delete [] newArray;
}
}
// add a new element to end of the list
void push_back(const int& x)
{
if(theSize==theCapacity) reserve(2*theCapacity+1);
objects[theSize++]=x;
}
// remove the last element from the list
void pop_back()
{
--theSize;
}
// Print out the size and contents of the list
void display() const
{
std::cout << "size=" << theSize << std::endl;
for(int i=0;i<theSize;++i){
std::cout<<"["<<i<<"]"<<"="<<objects[i]<<std::endl;
}
}
private:
int theSize;
int theCapacity;
int* objects; // The array is of type int.
// In C, C++ a variable of type int array is just a pointer to an int.
};
#endif

@ -0,0 +1,87 @@
/*
Transcriber's note: these first two lines of ifndef and define are added to make compilation work.
Note 2: all changed lines are labled with "//CHANGE" (without the quotes)
*/
#ifndef _H_TVECTOR
#define _H_TVECTOR
#include <iostream>
template <typename Object>//CHANGE
class TVector
{
public:
// Constructor
TVector(int initSize=0)
: theSize{initSize}, theCapacity{initSize+10}
{
objects = new Object(theCapacity);//CHANGE: annotation: in IVector object(...) was int(...)
}
// Destructor
~TVector()
{delete[] objects;}
// Check for emptyness
bool empty() const {return size() == 0;}
// Return size of list
int size() const {return theSize;}
// Access the element at a given index
// This is the non-const version, so you can change the element.
Object& operator[](int index)//CHANGE
{
return objects[index];
}
// Access the element at a given index
// This is the const version, for accessing the value only
const Object& operator[](int index) const //CHANGE
{
return objects[index];
}
// Increase the capacity (i.e., array size)
void reserve(int newCapacity)
{
if(newCapacity>theSize){
Object *newArray = new int[newCapacity]; //CHANGE
for (int k=0;k<theSize;++k){
newArray[k] = std::move(objects[k]);
}
theCapacity = newCapacity;
std::swap(objects, newArray);
delete [] newArray;
}
}
// add a new element to end of the list
void push_back(const Object& x)//CHANGE
{
if(theSize==theCapacity) reserve(2*theCapacity+1);
objects[theSize++]=x;
}
// remove the last element from the list
void pop_back()
{
--theSize;
}
// Print out the size and contents of the list
void display() const
{
std::cout << "size=" << theSize << std::endl;
for(int i=0;i<theSize;++i){
std::cout<<"["<<i<<"]"<<"="<<objects[i]<<std::endl;
}
}
private:
int theSize;
int theCapacity;
Object* objects;//CHANGE
};
#endif

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save