
<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://wiki.hh.se/ceres/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.hh.se/ceres/index.php?action=history&amp;feed=atom&amp;title=PA_8001_2015_Practical_1</id>
		<title>PA 8001 2015 Practical 1 - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.hh.se/ceres/index.php?action=history&amp;feed=atom&amp;title=PA_8001_2015_Practical_1"/>
		<link rel="alternate" type="text/html" href="https://wiki.hh.se/ceres/index.php?title=PA_8001_2015_Practical_1&amp;action=history"/>
		<updated>2026-04-04T14:06:34Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.22.6</generator>

	<entry>
		<id>https://wiki.hh.se/ceres/index.php?title=PA_8001_2015_Practical_1&amp;diff=5521&amp;oldid=prev</id>
		<title>Ceres at 15:29, 18 September 2015</title>
		<link rel="alternate" type="text/html" href="https://wiki.hh.se/ceres/index.php?title=PA_8001_2015_Practical_1&amp;diff=5521&amp;oldid=prev"/>
				<updated>2015-09-18T15:29:07Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 15:29, 18 September 2015&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 77:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 77:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Note: showSquareRoot() function does not have to stop printing. When you get to the last line of the screen, go to the first line and replace it with the prime factorization of the next integer.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Note: showSquareRoot() function does not have to stop printing. When you get to the last line of the screen, go to the first line and replace it with the prime factorization of the next integer.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;After you finish implementing the above-mentioned functions, insert the SD-card into a computer using the USB reader, empty the SD card, and copy the files from&amp;#160; [[media:&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Boot_2015&lt;/del&gt;.zip|&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;boot_2015&lt;/del&gt;.zip]] into it, then perform the following sequence of actions:&amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;After you finish implementing the above-mentioned functions, insert the SD-card into a computer using the USB reader, empty the SD card, and copy the files from&amp;#160; [[media:&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Boot&lt;/ins&gt;.zip|&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;boot&lt;/ins&gt;.zip]] &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt; &lt;/ins&gt;into it, then perform the following sequence of actions:&amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# power off the Raspberry Pi&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# power off the Raspberry Pi&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Ceres</name></author>	</entry>

	<entry>
		<id>https://wiki.hh.se/ceres/index.php?title=PA_8001_2015_Practical_1&amp;diff=5519&amp;oldid=prev</id>
		<title>Ceres at 15:26, 18 September 2015</title>
		<link rel="alternate" type="text/html" href="https://wiki.hh.se/ceres/index.php?title=PA_8001_2015_Practical_1&amp;diff=5519&amp;oldid=prev"/>
				<updated>2015-09-18T15:26:33Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 15:26, 18 September 2015&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 63:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 63:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Download the [[media:screen_2015.zip|screen_2015.zip]] and complete the implementation for the functions specified in numbers.&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;c&lt;/del&gt;, i.e., &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Download the [[media:screen_2015.zip|screen_2015.zip]] and complete the implementation for the functions specified in numbers.&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;h&lt;/ins&gt;, i.e., &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; void writeChar(unsigned int pos, char ch);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; void writeChar(unsigned int pos, char ch);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; void &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;cleanPos&lt;/del&gt;(unsigned int &lt;del class=&quot;diffchange diffchange-inline&quot;&gt; pos&lt;/del&gt;);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; void &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;writeLong&lt;/ins&gt;(unsigned int &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;line, float i&lt;/ins&gt;);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; void &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;writeLong&lt;/del&gt;(&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;long i&lt;/del&gt;);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; void &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;cleanLine&lt;/ins&gt;(&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;unsigned int&amp;#160; pos&lt;/ins&gt;);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; void showSquareRoot(void);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; void showSquareRoot(void);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The current screen resolution is &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;64X48&lt;/del&gt;. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;To change the &lt;/del&gt;resolution &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;modify &lt;/del&gt;the below lines (screen.c, init_screen() function):&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The current screen resolution is &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;640X480, defiened in screen&lt;/ins&gt;.&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;h by SCREEN_WIDTH and SCREEN_HEIGHT. The &lt;/ins&gt;resolution &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;is set in &lt;/ins&gt;the below lines (screen.c, init_screen() function):&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; PUT32(0x40040000, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;64&lt;/del&gt;); /* #0 Physical Width */&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; PUT32(0x40040000, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;SCREEN_WIDTH&lt;/ins&gt;); /* #0 Physical Width */&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; PUT32(0x40040004, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;48&lt;/del&gt;); /* #4 Physical Height */&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; PUT32(0x40040004, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;SCREEN_HEIGHT&lt;/ins&gt;); /* #4 Physical Height */&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; PUT32(0x40040008, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;64&lt;/del&gt;); /* #8 Virtual Width */&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; PUT32(0x40040008, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;SCREEN_WIDTH&lt;/ins&gt;); /* #8 Virtual Width */&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; PUT32(0x4004000C, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;48&lt;/del&gt;); /* #12 Virtual Height */&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; PUT32(0x4004000C, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;SCREEN_HEIGHT&lt;/ins&gt;); /* #12 Virtual Height */&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Note: showSquareRoot() function does not have to stop printing. When you get to the last line of the screen, go to the first line and replace it with the prime factorization of the next integer.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Note: showSquareRoot() function does not have to stop printing. When you get to the last line of the screen, go to the first line and replace it with the prime factorization of the next integer.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Ceres</name></author>	</entry>

	<entry>
		<id>https://wiki.hh.se/ceres/index.php?title=PA_8001_2015_Practical_1&amp;diff=5506&amp;oldid=prev</id>
		<title>Ceres at 03:47, 17 September 2015</title>
		<link rel="alternate" type="text/html" href="https://wiki.hh.se/ceres/index.php?title=PA_8001_2015_Practical_1&amp;diff=5506&amp;oldid=prev"/>
				<updated>2015-09-17T03:47:53Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 03:47, 17 September 2015&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 93:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 93:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Part 3: Interleaving ===&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Part 3: Interleaving ===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''Part 3.1.''' Take the blinking program from Lab0, and the square root program from Part 2. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''Part 3.1.''' Take the blinking program from Lab0&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;, modify it so that the time between each two blinking is constant. &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'''Part 3.2.''' Take the blinking program from part 3.1&lt;/ins&gt;, and the square root program from Part 2. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Make an interleaving of the two programs. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Make an interleaving of the two programs. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Load the interleave on Raspberry Pi using a similar procedure as in Part 3. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Load the interleave on Raspberry Pi using a similar procedure as in Part 3. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''Part 3.2.''' Observe that the &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;LEDs blink &lt;/del&gt;more slowly than &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;they are &lt;/del&gt;supposed to as the square root of the number grows; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''Part 3.2.''' Observe that the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;LED blinks &lt;/ins&gt;more slowly than &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;it is &lt;/ins&gt;supposed to as the square root of the number grows; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;devise a fair interleaving of the tasks such that the blinking speed remains constant.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;devise a fair interleaving of the tasks such that the blinking speed remains constant.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Ceres</name></author>	</entry>

	<entry>
		<id>https://wiki.hh.se/ceres/index.php?title=PA_8001_2015_Practical_1&amp;diff=5501&amp;oldid=prev</id>
		<title>Ceres: Created page with &quot;== Objectives ==  There are three objectives for this practical:   * Experiment with concurrency (without any underlying support) and observe its issues * Experiment with a un...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.hh.se/ceres/index.php?title=PA_8001_2015_Practical_1&amp;diff=5501&amp;oldid=prev"/>
				<updated>2015-09-16T12:40:06Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;== Objectives ==  There are three objectives for this practical:   * Experiment with concurrency (without any underlying support) and observe its issues * Experiment with a un...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Objectives ==&lt;br /&gt;
&lt;br /&gt;
There are three objectives for this practical: &lt;br /&gt;
&lt;br /&gt;
* Experiment with concurrency (without any underlying support) and observe its issues&lt;br /&gt;
* Experiment with a unit testing framework (such as CUnit) &lt;br /&gt;
* Get more insight into the working of the Raspberry Pi, particularly with respect to input and output&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Instructions ==&lt;br /&gt;
&lt;br /&gt;
Submit a single .zip file on blackboard with separate folders, each containing the solutions to the below-specified parts. &lt;br /&gt;
&lt;br /&gt;
For each function in the code, you need to write evidence of test-driven development, both in terms of comments (description, pre- and post-condition and properties) and unit testing test suites (e.g., in CUnit, see below).  To show the successful execution of your test suite, also include the XML file resulting from its execution. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Part 1: Square Root ===&lt;br /&gt;
&lt;br /&gt;
'''Part 1.1.''' Write the specification (description, pre- and post-condition, test-cases) for  the function isqroot() with the following signature: &lt;br /&gt;
&lt;br /&gt;
 struct rootStruct {&lt;br /&gt;
   int rootInt;&lt;br /&gt;
   int rootFraction;&lt;br /&gt;
  }; &lt;br /&gt;
 &lt;br /&gt;
  typedef struct rootStruct RootStruct;&lt;br /&gt;
&lt;br /&gt;
  RootStruct * isqroot ( int ); &lt;br /&gt;
&lt;br /&gt;
This function is supposed to calculate the square root of its only parameter with one degree of precision and &lt;br /&gt;
return it in a struct comprising its integer part, its fractional part (one digit after the &amp;quot;.&amp;quot;, the decimal separator).&lt;br /&gt;
We suggest that you use the simple [https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method Babylonian method] with 1 as the start value for your implementation. &lt;br /&gt;
 &lt;br /&gt;
'''Part 1.2.''' Implement its test suite using a unit testing framework such as CUnit. &lt;br /&gt;
&lt;br /&gt;
Note that different development environments come with their built in unit testing framework and &lt;br /&gt;
you can use any of those instead of CUnit. &lt;br /&gt;
&lt;br /&gt;
If you decide to use CUnit, please download it from [http://sourceforge.net/projects/cunit/files/CUnit/2.1-3/ its sourceforge repository], &lt;br /&gt;
unpack it and install it in your local directory. &lt;br /&gt;
Here is a useful [http://ubuntuforums.org/archive/index.php/t-1727067.html discussion about installing CUnit].&lt;br /&gt;
&lt;br /&gt;
Review the [http://cunit.sourceforge.net/example.html examples provided at the CUnit repository] or [http://people.cs.aau.dk/~bnielsen/TOV07/lektioner/cunit-intro-07.pdf the tutorial by Nielsen and Skou]. &lt;br /&gt;
&lt;br /&gt;
Implement a test suite for square root, based on the description provided in part 1.1.&lt;br /&gt;
In the implementation, you may use your own helper functions, but for each function, you need to provide evidence of test-driven development. &lt;br /&gt;
&lt;br /&gt;
'''Part 1.3''' Implement isqroot(int) and run all your tests.&lt;br /&gt;
&lt;br /&gt;
=== Part 2: Square Root on Raspberry Pi ===&lt;br /&gt;
Write a program that shows the square root of natural numbers, starting from 1 and moving upwards, on the monitor screen connected through the HDMI port to Raspberri Pi.&lt;br /&gt;
The output of the program should look like the following: &lt;br /&gt;
&lt;br /&gt;
 1: 1,&lt;br /&gt;
 2: 1.4, &lt;br /&gt;
 3: 1.7,&lt;br /&gt;
 4: 2.0,&lt;br /&gt;
 5: 2.2, &lt;br /&gt;
 .&lt;br /&gt;
 .&lt;br /&gt;
 .&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
Download the [[media:screen_2015.zip|screen_2015.zip]] and complete the implementation for the functions specified in numbers.c, i.e., &lt;br /&gt;
&lt;br /&gt;
 void writeChar(unsigned int pos, char ch);&lt;br /&gt;
 void cleanPos(unsigned int  pos);&lt;br /&gt;
 void writeLong(long i);&lt;br /&gt;
 void showSquareRoot(void);&lt;br /&gt;
The current screen resolution is 64X48. To change the resolution modify the below lines (screen.c, init_screen() function):&lt;br /&gt;
    PUT32(0x40040000, 64); /* #0 Physical Width */&lt;br /&gt;
    PUT32(0x40040004, 48); /* #4 Physical Height */&lt;br /&gt;
    PUT32(0x40040008, 64); /* #8 Virtual Width */&lt;br /&gt;
    PUT32(0x4004000C, 48); /* #12 Virtual Height */&lt;br /&gt;
&lt;br /&gt;
Note: showSquareRoot() function does not have to stop printing. When you get to the last line of the screen, go to the first line and replace it with the prime factorization of the next integer.&lt;br /&gt;
&lt;br /&gt;
After you finish implementing the above-mentioned functions, insert the SD-card into a computer using the USB reader, empty the SD card, and copy the files from  [[media:Boot_2015.zip|boot_2015.zip]] into it, then perform the following sequence of actions:  &lt;br /&gt;
&lt;br /&gt;
# power off the Raspberry Pi&lt;br /&gt;
# remove the SD card&lt;br /&gt;
# insert the SD card into a computer using the usb reader&lt;br /&gt;
# open GCC Command Prompt (click start and go to GNU Tools ARM Embedded 4.7 2013q3)&lt;br /&gt;
# go to your working path (screen folder)&lt;br /&gt;
# run build.bat&lt;br /&gt;
# copy kernel.img to the SD card&lt;br /&gt;
# remove the SD card and insert it into the Raspberry Pi&lt;br /&gt;
# power on the Raspberry Pi.&lt;br /&gt;
&lt;br /&gt;
You should now be able to see the outcome of prime factorization on the screen. &lt;br /&gt;
&lt;br /&gt;
=== Part 3: Interleaving ===&lt;br /&gt;
&lt;br /&gt;
'''Part 3.1.''' Take the blinking program from Lab0, and the square root program from Part 2. &lt;br /&gt;
Make an interleaving of the two programs. &lt;br /&gt;
Load the interleave on Raspberry Pi using a similar procedure as in Part 3. &lt;br /&gt;
&lt;br /&gt;
'''Part 3.2.''' Observe that the LEDs blink more slowly than they are supposed to as the square root of the number grows; &lt;br /&gt;
devise a fair interleaving of the tasks such that the blinking speed remains constant.&lt;/div&gt;</summary>
		<author><name>Ceres</name></author>	</entry>

	</feed>