Memory
Last updated
Last updated
The memory structure of ZK WorldVM consists of two types (read-write and write-once) and disjoint regions mapped to the memory space.
ZK WorldVM uses B-Tree algorithm to manage memory addresses and supports random access to memory. When inserting data by address, the b-tree algorithm sorts memory by address and by CPU clock.
When random access memory, the time complexity of searching is O(log N).
When the memory tracking table is generated in ascending order by address and clock, the memory can be directly accessed without reordering.
The memory structure description is shown in Figure 10:
Function mod (feeling x, feeling y) ->feeling{
Returns x% y;
}
Entry (){
cid r = mod (cidx , cidy) ;. . .
}% }
The prophetic translation instructions are as follows. The pink squares are logic related to prophet translation. The blue blocks are logic related to the ZK WorldVM executor. The green squares are the start and end. The Prophet interpreter is embedded into the ZK WorldVM executor as a module. ZK Worldvm executes the program, and the process is shown in Figure 11: