etherforth_logo

Node 313

This node is a part of block buffer memory.

Source code

usb node 314 node 312 node 313
313 buffer
intro screen
717171 o, 727272 o, 727272 o, 727272 o,
675472 o, 675472 o, 727272 o, 727272 o,
727272 o, 727054 o, 727272 o, 727272 o,
727272 o, 705472 o, 705471 o, 727272 o,
727272 o, 727276 o, 545454 o, 675472 o,
727272 o, 727272 o, 727272 o, 705472 o,
727272 o, 727272 o, 727270 o, 545454 o,
705471 o, 727272 o, 727267 o, 547272 o,
675472 o, 675454 o, 727267 o, 547272 o,
675454 o, 705454 o, 727054 o, 727270 o,
545472 o, 705472 o, 705454 o, 717272 o,
727267 o, 546754 o, 726754 o,

47 org
ad 2F a-an left 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 right b! go ; 43

3 d 4 r 0 ether

Definitions

ad
If address a belongs to this node, returned n is negative.
go
Fetch address from RIGHT. 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 RIGHT 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 LEFT, then fetch data from RIGHT and send it LEFT. 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 LEFT, and wait to read data from LEFT, then pass it to RIGHT. 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 (RIGHT). 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 LEFT port), inverting it first if performing write operation.

Data read from local RAM are immediately sent back where the request came from (RIGHT port). If data is stored in another node, we suspend reading downstream port (LEFT) 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.