loading

A Study in Non-Standard Distributed Computer Architecture

Featured
Picture of A Study in Non-Standard Distributed Computer Architecture
In the following tutorial, directions are given for creating a single node for the DoHas (Distributed Optical Harvard Architecture System). After constructing two of these nodes, a small distributed computer can be implemented which uses one node for sending instructions, mimicking input and the instruction set to manage it, and another node which will act as memory.

One unique feature about this system is that although it does separate the instruction and memory, it also has an important feature that is shared with the Von Neumann architecture, in that since both nodes are identical physically, they are both capable of fulfilling either role, depending on the state that either machine is in at the time of transmission.

This platform was designed by Marty Miller and William Tolley, two students at Berea College, and it should be pretty easily extensible. Have fun writing your own programs to be executed by our DoHas system.
 
Remove these adsRemove these ads by Signing Up

Step 1: Acquiring Materials

Picture of Acquiring Materials
instructable-schematic_schem_revised.png
For each node, you will need:

- Arduino
- Breadboard
- Infrared Emitter
- Infrared Receiver
- (3) 1,000 ohm resistor
- (3) LED
- solid core hookup wire

Additionally, you may want a blank PCB board to create a permanent machine, as shown in the first photograph.

This project has been designed for individuals interest in creating small programming projects with the Arduino platform that may not necessarily have any background in creating circuits or following circuit diagrams. If this doesn't apply to you, however, and you would rather simply follow a schematic of the project, one has been provided in addition to the step-by-step instructions.

Step 2: Preparing the Wires

Picture of Preparing the Wires
The hookup wire should be cut into pieces as follows:

(9) 3 - 4 inch pieces with 1/2 inch exposed wire
(3) 6+ inch pieces with 1/2 inch exposed wire

Step 3: The Pins of the IR Receiver

Picture of The Pins of the IR Receiver
The Left Pin is the pin that will be outputting data to the Arduino.
The Middle Pin is the ground.
The Right Pin is for receiving power.

Step 4: Wiring the IR Receiver

Picture of Wiring the IR Receiver
IMG_20130424_205846.jpg
IMG_20130424_205837.jpg
IMG_20130424_205821.jpg
IMG_20130424_205750.jpg
IMG_20130424_205658.jpg
Instructions:

1.) Connect a 6 inch wire (to act as a global ground) from the GND port on the Arduino to the ground on the breadboard.

2.) Insert the IR Receiver onto the breadboard (location is not necessarily important).

3.) Connect a 6 inch wire from the 5V port on the Arduino to the Right Pin of the IR Receiver.

4.) Connect one of the short wires from the global ground area on the breadboard to the Middle Pin of the IR Receiver.

5.) Connect the last 6 inch wire from the A4 port on the Arduino to the Left Pin of the IR Receiver.

Step 5: Wiring the Standard LEDs

Instructions:

1.) Connect a short wire from the D12 Pin on the Arduino to the closet side of the breadboard, leaving a notch closet to the inseam.

2.) Connect a resister in the adjacent notch and bridge the gap to the other side of the breadboard, leaving a notch on the nearest side.

3.) Insert the cathode of an LED in the remaining notch, and insert the anode into a notch next to the other one.

4.) Connect  short wire from a notch on the same line as the anode end of the LED to the global ground of the bread board.

5.) Connect a short wire from the D10 Pin on the Arduino to the closet side of the breadboard, leaving a notch closet to the inseam.

6.) Connect a resister in the adjacent notch and bridge the gap to the other side of the breadboard, leaving a notch on the nearest side.

7.) Insert the cathode of an LED in the remaining notch, and insert the anode into a notch next to the other one.

8.) Connect  short wire from a notch on the same line as the anode end of the LED to the global ground of the bread board.

9.) Connect a short wire from the D8 Pin on the Arduino to the closet side of the breadboard, leaving a notch closet to the inseam.

10.) Connect a resister in the adjacent notch and bridge the gap to the other side of the breadboard, leaving a notch on the nearest side.

11.) Insert the cathode of an LED in the remaining notch, and insert the anode into a notch next to the other one.

12.) Connect  short wire from a notch on the same line as the anode end of the LED to the global ground of the bread board.

Step 6: Wiring the IR Emitter

Picture of Wiring the IR Emitter
IMG_20130424_205200.jpg
IMG_20130424_205146.jpg
IMG_20130423_141238.jpg
Instructions:

1.) Connect a short wire from the D3 Pin of the Arduino to the far side of the breadboard.

2.) Insert the cathode end of the IR LED into an adjacent notch to the D3 wire.

3.) Connect the anode end of the IR LED to an adjacent notch.

4.) Connect a short wire from the anode end of the LED to the global ground.

Step 7: Upload the Test Program

Instructions:

The files that are needed to test the system can be found here (mirrors below). You will need the Arduino programming environment found here to upload the proper code to each node and test the system.

1.) After downloading the files, be sure that you put the IRSendRev folder into the Libraries folder of your Arduino directory.

2.) Then open both the Send test and Rev test in the Arduino environment.

3.) Click on the checkmark in the upper-left corner to compile the code. This may take a few moments.

4.) Then click on the right arrow next to the checkmark to upload upload the Rev test to a single node, and the Send test to a single node to ensure that everything is working (repeat this uploading each of the files to the other node).

You should see the LEDs start to light up in sequence on the node that had the Rev test uploaded to it. This indicates that the system is functioning, but if you want to see what data is being sent, you can open the serial monitor (CTRL + SHIFT + M) to view the data being transmitted by the sending node.

Mirrors:

https://sourceforge.net/projects/dohas/files/DoHasTest.zip

Step 8: Understanding the System

Picture of Understanding the System
receive.png
Now that you have hopefully verified that your system is working physically, it might be nice to take a look at how the code works. The following gists (send code and receive code) and the accompanying pictures show what the code is, although you should already have it downloaded if you have tested your system. We will provide a short explanation of what is happening with each.


The Sender code does a few different things. First it establishes some variables, the most important of which are the instructions for the sending device, labeled 'a' through 'f' and are character arrays. These arrays function much like CPU instructions for something like a Hack CPU, although it is very much simplified; the first several of the numbers in these instructions are needed for determining the specification of IR signal to send and are not essential to understanding the system itself. The most important of the the 'bits' of the instruction are the last three, which determine which LED is turned on (or off). These are the workhorses of our very small instruction set, and it is important to note that more significant information could be sent and acted upon. We imagine that if you built up some infrastructure, then you could send things such as pictures or objects of classes you created that could be used as input on your Receiver nodes or more complicated instruction sets that could mimic something more akin to a full computer or CPU.

The fourth 'bit' from the right could be implemented as a control 'bit' if you wanted to add more nodes to your system. You could change this to various numbers that would represent which device (or group of devices) the instruction was intended for and then the Receiver devices would check to see if the instruction was for them, and execute it if so, and ignore the instruction if not.

The Receiver code essentially turns on the infrared receiver and then listens for input. Once some sort of IR input has been received, it then takes this data, which is a string of characters in this example, and executes an instruction (turning on or off an LED) depending on the instruction that was sent. In this system, the last three 'bits' represent which LED to turn on and which to turn off. If the bit is 1, then the corresponding LED is turned on, and of it is 0, then that LED is turned off. If you were to add more nodes to your system, it would be necessary to code each device to determine if the instruction it received was actually for it, which could be implemented by checking for a control 'bit' before executing the instruction.

What we have provided is more of a template than a complete system, and it is provided as a system to be built upon. Feel free to try out your own programs and test the capabilities of the platform. Our original intentions were to build a distributed Harvard Architecture, which is a computing platform that physically separates data memory and instructions memory. We wanted to do this by separating each of the operations associated with both data types into its own Arduino, with both devices communicating via infrared light. There are surely plenty of cool things that could be made with this setup, however, and we hope you have fun testing out new configurations or programs. If you do come up with something cool, please share it back with us, we would like to see it.

Step 9: Optional Additions

The same components are used here, but they are soldered directly onto a PCB board and the connections are made using wires that are also soldered to the board and then connected on the bottom using solder as well. The layout shown below works pretty well, but feel free to try out different configurations that may decrease the complexity of the wiring or soldering.

The box for our project was completed using a template generator here, and then printed using a laser engraver located in the Berea College Woods Lab.

The dimensions needed for a perfect fitting box (read: goldilocks tight) are as follows:

Width: 61.595 cm
Height: 33.02 cm
Depth: 83.82 cm
Thickness: 4 cm
Notch Length: 9.525 cm
Cut Width: 0 cm
Can you have more than 2 of these units? I am wondering about having one that acts like a central hub feeding information out to several subsidiary units?
Yes, we originally planned to have a three node system, where one node acted as an input device and the other two functioned as the memory and processor of the system. That's about as far as we got with the thinking for that, but one thing to consider is interference between the different devices or a node incorrectly taking as input what was meant for another. One idea to fight this kind of interference would be to have each node only act on data that had a certain attribute. For instance, the data being sent in the test file determines which of the LEDs the other node lights up. We did this by sending a series of data, with a few of the characters (functioning like bits in a CPU instruction) being 0 or 1 depending on which LED is to be lit. You could extend the "instruction set" we created and add in a "bit" to account for which node the data is intended for. So, a device would take in the data and check to see if the appropriate "bit" is set for it to execute the instruction. After I've written that though, I see a possible problem still if data is being sent to multiple devices or from multiple devices simultaneously. The data might simply be missed while a node is processing whether or not it should execute another instruction it has received. You could also physically arrange them in a way that would reduce interference. Whatever works, the main point with this is that it creates a platform that can be built upon, so I think that yes you can have more than two nodes, and I think it would be awesome. Post back and let us know what you come up with or if you run into any issues.
joshumax2 years ago
The files seem to have been removed from media fire.. Is there a mirror of them anywhere?
tolleyw (author)  joshumax2 years ago
Thanks for letting me know about this, joshumax. We never expected to get a fraction of the traffic that we have received.

I have added a mirror at Sourceforge in the tutorial: https://sourceforge.net/projects/dohas/files/DoHasTest.zip

I will add more soon if it is needed.

Thanks again.
sspence2 years ago
Schematics would have been so much easier to follow than the connect here, connect there instructions. Could you upload the schematic?
tolleyw (author)  sspence2 years ago
Thanks for the suggestion, sspence! I will include a schematic shortly, hopefully before the weekend is over.

We had thought about including a schematic initially, but since the primary intent of this particular instructable was to provide a simple platform on which many systems could be created with a minimal amount programming for those less familiar with hardware and electronic configurations, we decided to give the unintimidating, step by step instructions found here.

I was honestly surprised that it got so much attention in such a short amount of time, and that other people were interested in it, since the device is essentially just 4 LEDs and a 3-pin Infrared Receiver.

I thought that the system was simple enough that anyone familiar with electronics would probably laugh at our schematic, and that it would only serve to intimidate the intended audience that has little to no experience with electronics, as I myself have been when searching through the different projects on this website, among others.

Thanks again for the feedback, it is helpful to know that there are people of all different skill levels that need to be accounted for, and we will attempt to make our current and future project accessible to amateur and pro alike, as we continue to learn through all of the positive, constructive comments that we received here and in our inboxes.
Zakaria.K2 years ago
this was very well documented
esl401k2 years ago
This is so cool!!!