-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
79 lines (72 loc) · 15.6 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<!doctype html>
<html>
<head>
<title>RESM MICROCORE and VM (HW/SW implementations and test programs)</title>
<meta charset="UTF-8">
</head>
<body>
<p>Documentation: https://arkenidar.github.io/resm_aka_bbjj/</p>
<a href="https://github.com/arkenidar/resm_aka_bbjj">https://github.com/arkenidar/resm_aka_bbjj</a> <br>
<p>Raw Execution-Step Machine also known as <a href="https://esolangs.org/wiki/BitBitJump#Featuring_a_Path_Selector_Bit_.28BBJ_Machine.29" target="_blank">Bit Bit Jump Jump machine</a></p>
<p>Simple computer design. Files and ideas, documentation to the concept of <a href="https://esolangs.org/wiki/BitBitJump#Featuring_a_Path_Selector_Bit_.28BBJ_Machine.29" target="_blank">BitBitJump</a> machine, extended, popularized, applied.</p>
<p>My explorations of "<a href="https://esolangs.org/wiki/BitBitJump#Featuring_a_Path_Selector_Bit_.28BBJ_Machine.29" target="_blank">Bit Bit Jump Jump</a>" *uniform instruction set* CPU design.</p>
<ul>
<li><a href="#1">A few introductory words</a></li>
<li><a href="#2">Attached file (Logisim-based simulable schematics and Violet-based flow-chart)</a></li>
<li><a href="#3">Rediscovery of this machine design</a></li>
<li><a href="#4">Circuital schematics</a></li>
<li><a href="#5">Documentation for circuital schematics and abstract concept of Bit Bit Jump Jump machine</a></li>
<li><a href="#6">More informations on this machine, with further exploration directions and ideas</a></li>
<li><a href="#7">Bit Bit Jump Jump programs and its interpreter/VM (Software Versions of VM and related tools)</a></li>
<li><a href="#8">Flow-charts of Bit Bit Jump Jump programs</a></li>
<li><a href="#9">Answers to Common question a.k.a. FAQ</a></li>
</ul>
<h2 id="1">A few introductory words</h2>
<p>[IT] concetto di computer minimo, avente istruzioni uniformi, implementato con circuito (hardware) e con interprete di questo tipo di istruzioni (software) </p>
<p><strong>[EN]</strong> concept of minimal computer, having uniform instructions, implemented with circuits (<strong>hardware</strong>) and with interpreter of this type of instructions (<strong>software</strong>)</p>
<h2 id="2"><a href="https://github.com/arkenidar/resm_aka_bbjj/archive/master.zip" target="_blank">Attached file (Logisim-based simulable schematics and Violet-based flow-chart)</a></h2>
<h4><em>I did put together some <strong>documentation</strong> and <strong>interactive material</strong> about my <span style="text-decoration: underline;">Explorations of Bit Bit Jump Jump "uniform instruction set" CPU design</span>. This design is a direct application of <strong>Turing Machines</strong> and <strong>flow-charts</strong>, and is able to show its validity across centuries if given the chance, since <strong>it is the quintessence of binary computing</strong>. </em></h4>
<h2 id="3">Rediscovery of this machine design</h2>
<p>I would like to pass on this knowledge so other people may experiment and re-apply the knowledge and wisdom contained herein. My only role and merit could be having documented a little bit the already existing BitBitJump design, but this is not to be underestimated because precious knowledge tend to be lost in time if not valued and actively preserved.</p>
Possibly, with sufficient resources <strong>this design can be rediscovered</strong>, as I did for example. I have used again the more popular name "Bit Bit Jump Jump Machine", but if I had to choose a <strong>new name</strong> I would have labeled this machine design: <em><strong>R.E.S.M. </strong></em>(<strong>R</strong>aw <strong>E</strong>xecution-<strong>S</strong>tep <strong>M</strong>achine). The rest of the paragraph is more theoretical, I hope no one is hurt by these words <strong>;)</strong>. This design features <strong>energetic transference and pathways formation</strong>, found in many other systems, including neural living systems, but this machine is not so similar to living systems, as the program (and pathways definition) is constant in time. However programs can be executed using different paths. Energy transference can happen in this machine, of course, whenever a bit copy is done.
<h2 id="4">Circuital schematics</h2>
<p>Use <a href="http://www.cburch.com/logisim/" target="_blank"><strong>Logisim</strong></a> (<a href="http://www.cburch.com/logisim/" target="_blank">http://www.cburch.com/logisim/</a>).<br /><em>Logisim is a <strong>circuit design and emulation software</strong>,</em><br /> <strong>free</strong> and open source,<br /> cross-platform because it is written in Java+Swing,<br /> <strong>works on all major platforms</strong> including Windows and Linux and Mac OS.<br /><br /><a href="https://github.com/arkenidar/resm_aka_bbjj/archive/master.zip" target="_blank">Logisim file from me for BitBitJumpJump CPU. It is missing proper I/O (using simulator features for I/O into/from memories)</a><br /><a href="circuits_in_logisim/circuit_schematics.png" target="_blank"><img src="circuits_in_logisim/circuit_schematics.png" alt="Logisim file for BitBitJumpJump CPU. It is missing proper I/O (using simulator features for I/O into/from memories)" border="0" /></a></p>
<h2 id="5">Documentation for circuital schematics and abstract concept of Bit Bit Jump Jump machine</h2>
<p>The circuits executes endlessly instructions (no halting in current design). Every instruction is composed of <strong>four operands</strong> (COPY_FROM, COPY_TO, IP_CASE_0, IP_CASE_1). Every instruction is executed in <strong>3 phases</strong>. In <strong>phase 1</strong> the bit pointed by the COPY_FROM register is fetched. Then in <strong>phase 2</strong> the fetched bit is written in the memory location pointed by COPY_TO. This is the bit copying, "Bit Bit" part of the BitBitJumpJump instruction type. In <strong>phase 3</strong>, the "Jump Jump" part, the registers IP_CASE_0 and IP_CASE_1 are used to specify where to jump, selecting the next instruction. If Program Path Selector (PPS) is 0 the <strong> IP</strong> (Instruction Pointer) will have the value contained in IP_CASE_0, otherwise, for PPS=1: IP <- IP_CASE_1 (IP will have the value of the associated register). PPS register can be written when the destination (COPY_TO register) is equal to 0x02 (third bit of RAM, RAM has single-bit words, this is a feature possible in Logisim). So <strong>copy by copy, and path selection by path selection the program processes data</strong>. I/O is usually implemented using a special Input memory location and a special Output memory location. I will do that ASAP, for now I am using the simulator ways to insert bits and to show bits.</p>
<h2 id="6">More informations on this machine, with further exploration directions and ideas</h2>
<p>The "Bit Bit Jump Jump machine/CPU" is <strong>Turing complete</strong>, so it is a matter of coding the proper instructions but every computation can be done. <strong>This concept of computational machine is very educational and straight to the essence, and should be more commonly and widely known.</strong> I intending to document and to spread knowledge and I hope this will be successful and appreciated in due time, by wise people who can reap the wisdom of this beautifully simple design and concept. This machine has no concept of "words", so it is not 32 or 64 bit but words can be composed of an arbitrary number of bits, given a proper quantity of associated instructions. This is another beautiful feature of the essentialness of this design. More to come: stay tuned! One last word: this extremely expanded way to describe computation is useful for <strong>rewriting programs</strong> in different ways, e.g. <strong>size-optimizing programs</strong>, in a very <strong>granular</strong> and thorough way. Some one has used this way to <strong>obfuscate programs</strong> (and that is a kind of rewrite certainly) but the real deal AFAIK will be experimenting code-optimizations by code-rewriting. Also this is an abstract representation that could possibly be used as an intermediary representation when <strong>converting a program code from one format to another</strong>, e.g. in case of porting from a CPU architecture to another. Indeed every program is the equivalent of a <strong>flowchart</strong> where every instruction is an assignment activity (<strong>rectangular shape</strong>) followed a decision (<strong>diamond shape</strong>). So again you can shape this at will and write any kinds of programs (I/O is made this way: for input "var <- in" activity and for output "out <- var" activity).</p>
<h2 id="7">Bit Bit Jump Jump programs and its interpreter/VM (Software Versions of VM and related tools)</h2>
<p>I wrote many versions of software implementations of Virtual Machine and related tools (such as compilers). Example programs (for this kind of machine and its variations) are included.</p>
<ul>
<li>A <b>JavaScript</b>-based version: <a href="https://github.com/arkenidar/copyjump.js" target="_blank">Bit Bit Jump Jump programs and interpreter using web standards</a>.</li>
<li>A <b>Python</b>-based version. It can parse textual format of this type of VM (<i>*.prg.txt files</i>). This project includes the most complex program I wrote for this machine so far, without an automation tool like a compiler: a program that sums 2 bytes that produces an output of 1 byte and 1 bit for carry. No compiler was used, only a text-editor, but using a compiler writing more complex programs should be easier and possible.: <a target="_blank" href="https://github.com/arkenidar/CopyJumpMachine">https://github.com/arkenidar/CopyJumpMachine</a></li>
<li>A <b>Java</b>-based version: It can parse numeric format of this type of VM (<i>*.cj</i>) and convert from textual format (<i>*.prg.txt</i>) to numeric format (<i>*.cj</i>). <a href="https://github.com/arkenidar/copyjumpvm" target="_blank">https://github.com/arkenidar/copyjumpvm</a>. This is a "copy+jump only" virtual machine. You can execute the program in file: "copyjumpvm/integer_counter<i>.cj</i>" for a <b>quick demo</b> (a program that counts a byte from 0 to 255).</li>
</ul>
<h2 id="8">Flow-charts of Bit Bit Jump Jump programs</h2>
<p>Use <strong><a href="https://sourceforge.net/projects/violet/" target="_blank">Violet</a></strong> (<a href="https://sourceforge.net/projects/violet/" target="_blank">https://sourceforge.net/projects/violet/</a>).<br /><em>Violet is a UML Editor, you can <strong>draw flow-charts and more</strong>,</em><br /> <strong>free</strong> and open source,<br /> cross-platform because it is written in Java,<br /> <strong>works on all major platforms</strong> including Windows and Linux and Mac OS.</p>
<a href="https://github.com/arkenidar/resm_aka_bbjj/archive/master.zip" target="_blank">Violet files from me for program flow-charts. Programs: not gate, or gate.</a>
<h3>Flow-chart of "NOT gate" Bit Bit Jump Jump program</h3>
<a href="flowcharts_in_violet/flowchart_of_not_gate_program.png"
alt="Flow-chart of &quot;NOT gate&quot; Bit Bit Jump Jump program">
<img src="flowcharts_in_violet/flowchart_of_not_gate_program.png"
alt="Flow-chart of &quot;NOT gate&quot; Bit Bit Jump Jump program"
/></a>
<br />
<h3>Flow-chart of "OR gate" Bit Bit Jump Jump program</h3>
<a href="flowcharts_in_violet/flowchart_of_or_gate_program.png"
alt="Flow-chart of &quot;OR gate&quot; Bit Bit Jump Jump program">
<img src="flowcharts_in_violet/flowchart_of_or_gate_program.png"
alt="Flow-chart of &quot;OR gate&quot; Bit Bit Jump Jump program"
/></a>
<h2 id="9">Answers to Common question a.k.a. Frequently Asked Questions</h2>
<ul>
<li><em>Is this a Turing machine?</em> Answer: No, because it has at least one difference: Turing machine has a tape so the next instruction could be the previous or the following position (contiguous access a.k.a. linear access) in the tape. In this design the next instruction could be any instruction, including the current instruction (<strong>arbitrary access</strong> a.k.a. random access). This design has Turing completeness, however, likewise many other Turing-complete systems that are not Turing machines, even if it is an inspiration for the design of a computational system.</li>
<li><em>Is there any possibility of facilitating programs design?</em> Answer: A software that translates a more human-friendly language to this executable instruction format is of possible realization. This is what is commonly called a "compiler". <strong>Compiling</strong> from C or BASIC to RESM format is a possible way to go. It would be also possible to implement <strong>other systems on top</strong> of this, for example an <strong>interpreter</strong>. That would allow to execute programs in other, possibly more human-friendly, formats. Note that today is common practice that a Central Processing Unit (CPU) is implemented using microcode (my computer use proper CPU microcode, I installed an Ubuntu Linux package for this), so this is a <strong>very common and successfully tested way to build on top on microcode</strong> systems (the RESM code could be considered <strong>microcode</strong> so this discourse applies, <strong>building higher level on low-level</strong> or in this case <strong>very very low-level</strong>).</li>
<li><em>Is there any possibility to speed up the execution of the programs in this system?</em> Answer: The <strong>clock frequency</strong> can be a factor in the speed of the circuit (more instructions per second). Another factor is the <strong>rewriting of the programs</strong> to speed up (e.g. less instructions to execute a task). Another speed factor is the parallelization, the use of many of these circuits in parallel. The program would be "spread over" many of this circuits, many cores. The circuits are possibly synchronized (they would use the same phase timing signals), and keeping them in sync is facilitated by the same time requirement for each instruction in each "core" (<strong>multi-core design</strong>). An FPGA or an ASIC could be used to physically implement this "many micro-cores" design. The FPGA would be programmed using the native and possibly closed tools, but <em><strong>the resulting circuitry could be programmed using RESM microcode, a more open, well-known and free-to-use format</strong></em>. Just-In-Time (<strong>JIT</strong>) code production and reconfigurable (<strong>re-programmable on the field</strong>) computing style are quite well suited for these designs. These reconfigurability using a low-level language could be labeled as "<strong>low-level reconfigurability</strong>" (on FPGA or ASIC). That would allow run-time optimizations, besides static compile time optimizations. The cores would communicate using I/O ports (i.e. specific dedicated memory addresses, like the I/O of the single-core version).</li>
<li><em>Do you foresee other uses of this design?</em> Answer: A possible use is in the context of software synthesis: the program format allows <strong>micro-mutations</strong>. This could be paired well, in my estimations, with <strong>genetic programming</strong>, even if making the coupling work may require addition insights.</li>
<li><em>How about creating or presenting it to communities?</em> Answer: I like the idea of presenting a VHDL/Verilog design to <a href="https://twitter.com/librecores" target="_blank">LibreCores</a>. Also <strong>crowd-funding</strong> some project and/or research based on it could be another way to go, possibly.</li>
<li><em>Are there any further directions to explore?</em> Answer: Self-modifying code could be used. This could open a way to reduce code size by allowing the program to write the program, then there is a possibility to "decompress" the program, even progressively (not in one sigle stage, but as an intertwined process of execution and production of code.</li>
</ul>
<p>... and now for a motto: life is unpredictably short so open the sources #open_the_sources #memento_mori</p>
</body>
</html>