MENTAL
 Main Menu
 Union of Opposites
 MENTAL and the Hardware-Software Union


MENTAL and the Hardware and Software Union
 MENTAL AND THE
HARDWARE AND
SOFTWARE UNION


The Union of Hardware and Software

It is logical to wonder about the possibility of the unification of hardware and software and about the nature of that union.

To say hardware, as the name implies, is to say rigidity. And to say software is to say flexibility. In fact software was invented to make a hardware design more flexible. In the early days of computers, changing a program meant changing the machine's circuitry connections. The great evolutionary leap was the idea of storing the program code in memory, along with the data. This had several advantages: Hardware has evolved to support certain aspects of programming, such as modularization, structured programming, multiprocessing, virtual memory, etc.

It is obvious that software dependence on hardware should be as low as possible, because the less dependence on hardware, the greater the flexibility. In addition, there has always been the issue of the design of the ideal processor and the ideal language, as well as the form of interaction between the two.

To make a processor flexible, programmable microcode, a code based on very low-level instructions (microinstructions), has been used. This technology has now completely disappeared because advanced tools are available to design complex control units that have significantly higher performance than any microprogrammed unit.


The source code - machine code duality

In conventional systems, the computer hardware cannot directly execute the user's source program. A compiler or interpreter is needed to transform the source program into object code, the binary code or machine code executable by the hardware. The problems with this process are: 1) its computational cost (processing time and machine resources); 2) inefficiency, because the object code is usually not optimal or is poorly suited; 3) the generation of compilation errors, because compilers are difficult to develop; 4) error messages during execution are usually cryptic because they are expressed in the low-level language of the machine, and not in the high-level language of the user.

Binary compatibility has been a problem since the beginning of programming languages, because binary code binds software to particular hardware. To reduce or eliminate this problem, basically two solutions have been proposed:
  1. The development of "virtual machines", intermediary machines between the real hardware and the program to be executed.

  2. The development of processors oriented to a given language, in order to optimize performance by having a homogeneous interface between software and hardware.

Virtual machines

Virtual machines use an abstract instruction set, not belonging to any specific machine. A compiler generates abstract code in that abstract language and the virtual machine interprets and executes that abstract code. The advantage of abstract code is its portability: the same code can be executed by different platforms. Abstract code is very compact, so performance is higher. To make such object code possible, it is necessary to develop a virtual machine on each hardware platform. The virtual machine can be used as a complete operating system or run under another operating system.

There are two abstract code formats for virtual machine: bytecode and code. Java and Smalltalk use bytecode. UCSD Pascal uses p-code.

A Java virtual machine is a virtual machine capable of interpreting and executing instructions expressed in the bytecode Java, the binary code generated by the Java language compiler. The Java virtual machine acts as an intermediary between the hardware and the bytecode. There are different Java virtual machines for different hardware architectures.

The Smalltalk virtual machine −the first object-oriented language− is a virtual machine that allows a Smalltalk image (file bytecode) to run under a platform. The name "image" refers to the fact that an image of the machine's internal memory is written to external memory (disk). Smalltalk objects "survive" after the execution is finished.

UCSD Pascal is a programming language that runs on top of the UCSD p-System, a machine-independent operating system, which was once described as a "universal operating system". UCSD Pascal had a major influence on the Smalltalk virtual machine and the design of the Java virtual machine.

UCSD's p-System virtual machine is called "p-machine" (or psedo-machine), with its own instruction set called p-code (or pseudo-code). Each hardware platform only needs one p-code interpreter to port the entire p-System and all its tools.


Programming language oriented processors

The advantages of the unification between hardware and software by means of a programming language-oriented processor are:
The Evolution of Processors

Processors have evolved throughout the history of computing. From complex, rigid and restrictive processors, to simplified processors, to minimalist processors, always in the direction of greater simplicity, flexibility and efficiency. The evolution has been as follows:


CISC (Complex Instruction Set Computer)

They were the first processors. Their name was given by the supporters of smaller and simpler processors (RISC). CISC processors implement a very large set of complex instructions, with operands located in memory or in internal registers of the machine.

In the early days of computers, compiler technology did not exist. Programming had to be done in assembly language. To facilitate the programmer's task, complex instructions were created, which were like the functions of high-level programming languages. This led to increasingly complex and sophisticated processors. When compilers appeared, in which a high-level instruction could be implemented in several elementary instructions, it was no longer necessary to do this, so hardware could be simplified.


RISC (Reduced Instruction Set Computer)

RISC processors were created to improve the performance of CISC processors. To this end, the design was simplified: Today, the vast majority of processors are RISC.


MISC (Minimal Instruction Set Computer)

It is a processor with a very small number of instructions. It is stack-based, rather than register-based to reduce the size of the operands, as all instructions take operands from the top of the stack. Typically, a MISC consists of 32 instructions at most.

The advantages are that the decoding unit (code interpretation) is simpler and faster, and the instructions are more efficient.


OISC (One Instruction Set Computer)

A theoretical (or abstract) machine that has only one instruction but a larger number of operands. The instruction chosen is usually of the type "Subtract and branch if condition". The condition is usually "less than or equal to zero", "negative" or "non-zero". If the condition is not met, execution proceeds to the next instruction. Examples: Features: Examples of instructions derived from Sbnz:
VLIW (Very Long Instruction Word)

It is a processor architecture designed to take advantage of instruction-level parallelism. It is the compiler's job to control instruction scheduling and data protection.


NISC (No Instruction Set Computer)

NISC processors are the successor to the VLIW. It is a highly efficient processor architecture that allows a compiler to have low-level control of hardware resources. It has horizontal control (the sequence of instructions) and vertical control (the parallelism of instructions). The architecture is much simpler (no need to decode instructions), more flexible and efficient.


ZISC (Zero Instruction Set Computer)

It is a processor without instructions. It incorporates instead a pattern recognition oriented technology (pattern matching), so it has no instructions in the classical sense. It is based on the ideas of artificial neural networks and massively parallel processing.

The first generation of a ZISC chip contained 36 independent cells, where each cell can be thought of as an artificial neuron or parallel processor. Each cell can compare an input vector of up to 64 bytes with another vector in memory. If the input vector matches the vector in memory, the cells emit an output signal containing the number of the cell that has recognized the vector or a non-recognition signal.

The power of a ZISC lies in scalability. A ZISC network can be expanded by adding more ZISC processors without decreasing its recognition speed. And there is no theoretical limitation on the number of cells that can be in a network.

ZISC chips can also be used for fuzzy recognition. Instead of exact recognition, the closest recognition can be obtained. Cells above a certain threshold are triggered simultaneously and the ZISC controller locates the cell that returns the closest value.


Programming Language Oriented Processors

There is a history of hardware implementation of a programming language. The most prominent are the following:


Rekursiv

Rekursiv was an object-oriented microprocessor developed by David M. Harland (of Glasgow University) in the mid 1980's for Linn Smart (Glasgow) to control their Hi-Fi manufacturing system. The main motivation was to improve the performance of Lingo, an object-oriented language (derived from Smalltalk and Algol), also developed by the same company, which was not satisfactory with the hardware of its time (Digital Vax). At that time, the object paradigm was not yet well known, so it had quite a lot of merit to embark on that adventure. The processor was truly innovative and was surprisingly easy to implement. The project was eventually abandoned because Linn did not have sufficient resources to pursue this promising architecture. But it demonstrated the feasibility of building high-level hardware abstraction processors to bring them closer to object-oriented languages.


Forth processors

Forth is a simple and efficient language, developed by Chuck Moore and Elisabeth Rather between 1965 and 1970, for real-time astronomical applications, but which evolved into a general programming language and programming environment. It is now used primarily for programming embedded systems (small computerized devices) and boot loaders. Forth processors use Forth as a machine language. Stack processors (stack computers) are inspired by the Forth language. The advantages of these processors are: Forth and stack processors have been less widely used than traditional register machines.


Lisp processors

A Lisp processor (or Lisp machine) is a general-purpose, high-abstraction-level processor designed to efficiently execute Lisp code. Lisp is a functional-type artificial intelligence language and one of the most widely used because of its extraordinary flexibility. The Lisp machine was oriented to the development and execution of artificial intelligence applications. Lisp machines were the first single-user-oriented workstations. Many common technologies today, such as graphical user interfaces and the use of the mouse, were originally developed on Lisp machines.

With the advent of personal computers, Lisp machines virtually disappeared. Only two have survived: Symbolics and Macrosyma.


Java processors

Sun introduced Java Virtual Machine (JVM), a software layer on top of a hardware platform for developing and running Java programs.

There have been several attempts to build a processor that would directly interpret bytecode Java as its machine language, but all attempts in this direction were unsuccessful. Perhaps the failure was due to the complexity of Java. A processor should be as simple as possible.


The Hardware-Software Union in MENTAL

With MENTAL all dualities are united at the conceptual level. The last duality to overcome is the implementer issue: to unite hardware and software. Let hardware and software speak the same language: let the set of universal semantic primitives also be the hardware instruction set.

Just as with universal semantic primitives we have reached the conceptual roots of programming, we must reflect that same essence in hardware to achieve maximum homogeneity, consistency and efficiency.

It would be the "ideal" hardware, as MENTAL is the ideal language. The "instruction set" of a universal (or general purpose) computer (or abstract machine), a machine more general than the Turing machine, since it is operational and descriptive.

If this were possible we would have many advantages:

Addenda

MENTAL vs. Forth

There are numerous overlaps between Forth and MENTAL in the following respects:
Bibliography