<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Roger Davies &#187; ssem</title>
	<atom:link href="http://www.rogerdavies.com/tag/ssem/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rogerdavies.com</link>
	<description>The Ramblings of a Weirdo</description>
	<lastBuildDate>Sun, 08 Aug 2010 19:00:03 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>The Manchester Baby, Small Scale Experimental Machine</title>
		<link>http://www.rogerdavies.com/2009/12/manchester-ssem-baby/</link>
		<comments>http://www.rogerdavies.com/2009/12/manchester-ssem-baby/#comments</comments>
		<pubDate>Mon, 21 Dec 2009 22:30:17 +0000</pubDate>
		<dc:creator>Roger Davies</dc:creator>
				<category><![CDATA[Techno Babble]]></category>
		<category><![CDATA[baby]]></category>
		<category><![CDATA[instructions]]></category>
		<category><![CDATA[manchester]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[programs]]></category>
		<category><![CDATA[small scale experimental machine]]></category>
		<category><![CDATA[ssem]]></category>

		<guid isPermaLink="false">http://www.rogerdavies.com/?p=3897</guid>
		<description><![CDATA[Today I visited the Manchester Institute of Science and Technology (MOSI) and paid my respects to the Small Scale Experimental Machine (SSEM) - the first computer ever constructed.  Along with some neat photos, I explain some of the gritty issues facing programmers and give some example code of my own.]]></description>
			<content:encoded><![CDATA[<p>The study of ancestry can teach us a great deal.  Knowing the origins of something gives us a renewed appreciation for where we are today, and affords us a better perspective on where we are going tomorrow.<br />
<img class="alignnone size-full wp-image-3908" style="margin-left: 0px;" title="Manchester Baby - Small Scale Experimental Machine" src="http://www.rogerdavies.com/wp-content/uploads/2009/12/ssem-baby-pic.jpg" alt="Manchester Baby - Small Scale Experimental Machine" /></p>
<p>Today I stood and basked in the awesome glory of the Manchester <strong>Small Scale Experimental Machine</strong> (<strong>SSEM</strong>) nicknamed the &#8216;<strong>Baby</strong>&#8216;. Built <strong>1948,</strong> it was the first ever electronic computer system in the world and has been on display here at the <a href="http://www.mosi.org.uk" target="_new">Manchester Institute of Science and Technology</a>.  I was dismayed to learn that the computer is being packed away in to storage, but the kind staff allowed me up close to pay my respects and bring you these great photos.</p>
<h2>Programming the Small Scale Experimental Machine</h2>
<p>Having spent much of last weekend writing my first programs for this great ancestor of modern computing, I find renewed appreciation for the technology that is available to us now. <img class="size-full wp-image-3898 alignright" title="Roger Visits the SSEM Baby" src="http://www.rogerdavies.com/wp-content/uploads/2009/12/ssem1.jpg" alt="Roger Visits the SSEM Baby" width="273" height="277" />I have written code for a few computers, including some home consoles like the Super Nintendo, but nothing could have prepared me for the <strong>Manchester Baby</strong>.</p>
<p>Why? Well, firstly, it has a humble instruction set consisting of <a href="#ssem-baby-instructions">7 valid instructions</a>, with only <strong>ONE</strong> arithmetic operation &#8211; <em><strong>subtract</strong></em>! In order to add two values, a programmer would need to use the form: <strong>-(-x-y)</strong>.  Software multiplication can be achieved by creating a loop which repeatedly &#8216;adds&#8217; in this manner &#8211; don&#8217;t even ask me about divide!</p>
<p>Another exciting fact about the <strong>SSEM </strong>is it&#8217;s memory store.  By today&#8217;s standards it would be considered backward.</p>
<table style="float:left; margin:10px; align:center;" border="0">
<tbody>
<tr>
<td>
<div id="attachment_4034" class="wp-caption alignleft" style="width: 250px"><img class="size-full wp-image-4034" title="Normal Binary Example" src="http://www.rogerdavies.com/wp-content/uploads/2009/12/binary-example-normal.jpg" alt="Normal Binary Example" width="240" height="66" /><p class="wp-caption-text">How Binary Numbers are Usually Stored</p></div></td>
</tr>
<tr>
<td>
<p><div id="attachment_4035" class="wp-caption alignleft" style="width: 250px"><img class="size-full wp-image-4035" title="SSEM Binary Example" src="http://www.rogerdavies.com/wp-content/uploads/2009/12/binary-example-baby.jpg" alt="SSEM Binary Example" width="240" height="66" /><p class="wp-caption-text">How SSEM Stores Binary Numbers</p></div></td>
</tr>
</tbody>
</table>
<p>No, I mean that it&#8217;s memory is <em><strong>literally</strong></em> a mirror image of how we might expect today&#8217;s computers to store binary numbers, with the least significant bit (<strong>LSB</strong>) is on the <em><strong>left</strong></em> and the most significant bit (<strong>MBR</strong>) on the <em><strong>right</strong></em>!</p>
<p>The memory store itself is made up of <strong>32 rows</strong> of 32-bit words, giving the SSEM <strong><em>128 bytes (0.125 KB) </em></strong> of total memory for both program and data.  Not a lot when you compare it to computers available today.  To put everything back in perspective, the SSEM executes <em><strong>1,100 instructions per second</strong></em>.  Yet my <strong>Apple iPhone</strong> used to photograph this exhibit can execute <em><strong>620,000,000 instruction per second</strong></em> and has <em><strong>8,000,000 KB</strong></em> of storage and (AND!) &#8230; it fits right in my pocket.</p>
<p><a name="ssem-simulator"><br />
</a></p>
<h2><a name="ssem-simulator">How To Run Virtual SSEM Programs At Home</a></h2>
<p><a href="http://www.rogerdavies.com/wp-content/uploads/2009/12/thefraj.jpg"><img class="aligncenter size-full wp-image-3948" title="TheFraj Demo on the SSEM Baby" src="http://www.rogerdavies.com/wp-content/uploads/2009/12/thefraj-small.jpg" alt="TheFraj Demo on the SSEM Baby" width="404" height="257" /></a>[ See The Source Code For This Example <a href="#thefraj-source-code">Here</a> ]
<p>But you don&#8217;t have to travel all the way to <strong>Manchester</strong> to use the <strong>SSEM</strong>.  <strong>David Sharp</strong> has developed a fantastic <a href="http://www.davidsharp.com/baby/" target="_blank">Java based SSEM simulator</a> which you can run directly through your browser.  Not only does it include the imagery of the original machine, but includes several working program examples and the ability to import/export memory snapshots and assembly code.</p>
<table border="0">
<tbody>
<tr>
<td><a href="http://www.rogerdavies.com/wp-content/uploads/2009/12/ssem3.jpg"><img class="alignleft size-full wp-image-3977" title="Small Scale Experimental Machine" src="http://www.rogerdavies.com/wp-content/uploads/2009/12/ssem3.jpg" alt="Small Scale Experimental Machine" width="215" height="286" /></a></td>
<td><a href="http://www.rogerdavies.com/wp-content/uploads/2009/12/ssem4.jpg"><img class="size-full wp-image-3978 alignleft" title="Small Scale Experimental Machine" src="http://www.rogerdavies.com/wp-content/uploads/2009/12/ssem4.jpg" alt="Small Scale Experimental Machine" width="215" height="286" /></a></td>
</tr>
</tbody>
</table>
<h2>Conclusion</h2>
<p>All in all it was a very humbling experience.  I am told that the Baby will go back on display in about 7 months and I strongly urge others to see this exhibit.  While the Small Scale Experimental Machine may not be all that impressive technically, it provided a solid blueprint upon which all modern computers are built.  In doing so, it leaves a timeless mark in the computer world that will live on beyond it&#8217;s physical components.   These principles seem far removed when I&#8217;m sat at my desk working with luxuriously high-level language like <strong>PHP. </strong>But sometimes it helps to remind myself of the sheer toil and pain it has taken to get to this stage.</p>
<h2>Extras</h2>
<p><a name="thefraj-source-code"> </a>Here is the source code to the &#8216;TheFraj&#8217; example featured in this article, a scrolling marquee based on an example program that comes with the simulator.  Try saving this into a file and importing to the <a href="#ssem-simulator">simulator</a>!<br />
<code><br />
30<br />
1  NUM -1207943145<br />
2  CMP<br />
3  SUB 22<br />
4  STO 18<br />
5  LDN 18<br />
6  SUB 18<br />
7  STO 23<br />
8  LDN 1<br />
9  STO 18<br />
10  LDN 18<br />
11  SUB 20<br />
12  CMP<br />
13  LDN 19<br />
14  STO 1<br />
15  SUB 21<br />
16  STO 7<br />
19  NUM 1207943145<br />
20  NUM -134217729<br />
21  NUM -8192<br />
22  JMP 1<br />
23  NUM 2039410350<br />
24  NUM 575808164<br />
25  NUM 575808164<br />
26  NUM 600729316<br />
27  NUM 600729316<br />
28  NUM 575283876<br />
29  NUM 710025892<br />
30  NUM 307375780<br />
31  NUM 0<br />
</code></p>
<table style="text-align:center; border-style:dotted" border="1" width="95%"><a name="ssem-baby-instructions"></a></p>
<caption>Instruction Set List for SSEM Baby </caption>
<tbody>
<tr bgcolor="#56809c">
<th style="width: 9%; color: white;">Binary Code</th>
<th style="width: 11%; color: white;">Assembly Instruction</th>
<th style="width: 80%; color: white;">Explaination of Operation</th>
</tr>
<tr>
<td>000</td>
<td>JMP S</td>
<td style="text-align:left;">Jump to the instruction at the specified memory address (absolute unconditional jump)</td>
</tr>
<tr>
<td>100</td>
<td>JRP S</td>
<td style="text-align:left;">Jump to the instruction at the specified memory address plus the number in the accumulator (relative unconditional jump)</td>
</tr>
<tr>
<td>010</td>
<td>LDN S</td>
<td style="text-align:left;">Take the number from the specified memory address, negate it, and load it into the accumulator</td>
</tr>
<tr>
<td>110</td>
<td>STO S</td>
<td style="text-align:left;">Store the number in the accumulator to the specified memory address</td>
</tr>
<tr>
<td>001 <strong>OR</strong><br />
101<sup id="cite_ref-27" class="reference"><a href="#cite_note-27"></a></sup></td>
<td>SUB S</td>
<td style="text-align:left;">Subtract the number at the specified memory address from the value in accumulator, and store the result in the accumulator</td>
</tr>
<tr>
<td>011</td>
<td>CMP</td>
<td style="text-align:left;">Skip next instruction if the accumulator contains a negative value</td>
</tr>
<tr>
<td>111</td>
<td>STP</td>
<td style="text-align:left;">Stop</td>
</tr>
</tbody>
</table>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.rogerdavies.com%2F2009%2F12%2Fmanchester-ssem-baby%2F&amp;linkname=The%20Manchester%20Baby%2C%20Small%20Scale%20Experimental%20Machine"><img src="http://www.rogerdavies.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Save/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.rogerdavies.com/2009/12/manchester-ssem-baby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
