Project:Ball Computer: Difference between revisions

From London Hackspace Wiki

Added thoughts on memory and encoding.
(Added thoughts on memory and encoding.)
Line 26: Line 26:
* Could use different ball sizes for 1 and 0 (e.g. 4mm as 0 and 5mm as 1 - in which case a 0 ball weighs roughly half a 1 ball)
* Could use different ball sizes for 1 and 0 (e.g. 4mm as 0 and 5mm as 1 - in which case a 0 ball weighs roughly half a 1 ball)
* Consider using compressed air or solenoids to hold ball bearings in place
* Consider using compressed air or solenoids to hold ball bearings in place
Will has ordered 100x4mm (0.2610g) and 100x5mm (0.5099g) high grade steel ball bearings for experimentation.


== Encoding ==
== Encoding ==
Do we use pure decimal or [http://en.wikipedia.org/wiki/Binary-coded_decimal binary coded decimal] or something else? BCD has the advantage it's easy to convert for display, but is a bit more complex to process arithmetically.
Do we use pure decimal or [http://en.wikipedia.org/wiki/Binary-coded_decimal binary coded decimal] or something else? BCD has the advantage it's easy to convert for display, but is a bit more complex to process arithmetically.
What about letters and other characters? The larger we make a byte the more complex everything becomes. One possible scheme is to use 4-bit nibbles for numbers with BCD, with two nibbles used for to represent a character or instruction. In BCD no number is of the form 11xx. So could separate letters from numbers by using 110x xxxx for letters and punctuation (room for 32 of them) and 111x xxxx for instructions (also leaves room for 32 of them).
Some possible examples:
0000 = 0
0010 = 2
1001 = 9
1100 0001 = a
1101 0010 = r
1110 0001 = read nibble from memory
1110 0010 = write nibble to memory
1110 0011 = add
This isn't especially compact, but would seem to make it easy to separate different operations.


== Memory ==
== Memory ==
Initial simple approach is to have a plastic grid with a ball indicating 1 and a void 0 (or magnetised balls indicating 1 and non-magnetised 0). If we use 3mm ball bearings then a 256 bit memory would be a sane size (around 10cm square). Need to work out how to read and write to this.  
Some approaches within a plastic grid (could use stepper motors and simple arm to move or read balls):
 
* a ball indicating 1 and a void 0  
* a magnetised balls indicating 1 and non-magnetised 0
* a 5mm ball representing a 1 and a 4mm ball representing a 0
 
Do we read individual bit or a whole nibble? Nibbles make addressing easier. With a 16x16 grid of nibbles (so 32x32 ball slots) you'd be able to use 2 nibbles as an address (16x16 = 256 = 2^8). This would give 1 kilobit (256 nibbles) of memory. If we're using 4/5mm bearings and you allow 8mm by memory cell then this memory would be about 26cm to a side.


''More to come...''
''More to come...''