etherforth_logo

Node 314

Block buffer memory.

Source code

usb node 315 node 313 node 314
314 buffer
intro screen
726754 o, 675467 o, 546754 o, 675472 o,
727054 o, 727054 o, 705470 o, 547272 o,
727054 o, 727054 o, 705471 o, 727272 o,
726754 o, 545472 o, 675472 o, 675467 o,
546754 o, 545467 o, 547272 o, 705472 o,
705470 o, 547054 o, 727272 o, 705472 o,
705470 o, 547172 o, 727272 o, 675472 o,
727267 o, 547267 o, 546754 o, 675472 o,
726754 o, 727270 o, 547270 o, 547054 o,
705472 o, 727270 o, 547270 o, 547054 o,
707272 o, 727272 o, 675454 o, 727267 o,
546754 o, 675472 o, 675454 o,

47 org
ad 2F a-an right a! dup -47 . + ;
go 33 @b -if - ad -if drop a! @b ! go ; then - ! @b ! go ;
then ad -if drop a! @ !b go ; then ! @ !b go ; 40

init left b! go ; 43

3 d 5 r 0 ether

Definitions

ad
If address a belongs to this node, returned n is negative.
go
Fetch address from LEFT. Negative value indicates write, so invert it, and call ad. If it returns negative flag the address belongs to this node. In such a case drop the flag, set A to the address, fetch data from LEFT and store it to RAM, then jump back to go. If ad returns positive, invert the flag, which actually becomes modified address indicating write, send it RIGHT, then fetch data from LEFT and send it RIGHT. Finally, jump to go.

Similarly, for positive address (meaning read from RAM) call ad to see if it belongs here, and return word from RAM. If address not intended for this node, send it RIGHT, and wait to read data from RIGHT, then pass it to LEFT. Then jump to go.

init
Set register B, and jump to go.

Description

Chuck invented this method of linking several nodes together to create a large memory. Each node in the chain reserves 47 words of RAM (59 in the last node) as data storage. Word go reads an address from entry port (LEFT). A fast and easy way of choosing between write and read operations (using -if instruction) is to invert the address for write.

Next step is to check if the memory operation is to be carried out in this node's RAM. Subtracting number of words reserved for data gives a negative value if this node is the target one. In that case we use the original address to write to RAM or to retrieve data from RAM. Otherwise, we use the decremented address and send it to the next node in the chain (via RIGHT port), inverting it first if performing write operation.

Data read from local RAM are immediately sent back where the request came from (LEFT port). If data is stored in another node, we suspend reading downstream port (RIGHT) until data comes, then we send it upstream to the requester.

Access to such a memory is transparent from the outside. We do not need to care how many nodes the request travels through, provided the longest delay is still within acceptable limits.

Block buffer memory is filled with intro screen out of reset.