Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Minimal instruction set to solve any problem with a computer program

Years ago, I have heard that someone was about to demonstrate that every computer program could be solved with just three instructions:

  • Assignment
  • Conditional
  • Loop

Please I would like to hear your opinion. I mean representing any algorithm as a computer program. Do you agree with this?

like image 269
Ramon Araujo Avatar asked Sep 14 '10 17:09

Ramon Araujo


People also ask

What is the smallest instruction set?

A simple instruction set of only 8 instructions used for teaching is known as the MU0 instruction set. It originated at Manchester University and is used for teaching both compiler writing and hardware design.

What are the 3 types of instructions?

A basic computer has three instruction code formats such as the memory reference instruction, the register reference instruction, and the input-output instruction format.

What are sets of computer instructions?

An instruction set is a group of commands for a central processing unit (CPU) in machine language. The term can refer to all possible instructions for a CPU or a subset of instructions to enhance its performance in certain situations.

Is a list of instructions for a computer to solve a specific problem?

A program is a list of instructions or program statements composed in such a way as to enable a computer to solve a problem.


1 Answers

No need. The minimal theoretical computer needs just one instruction. They are called One Instruction Set Computers (OISC for short, kinda like the ultimate RISC).

There are two types. The first is a theoretically "pure" one instruction machine in which the instruction really works like a regular instruction in normal CPUs. The instruction is usually:

subtract and branch if less than zero

or variations thereof. The wikipedia article have examples of how this single instruction can be used to write code that emulates other instructions.

The second type is not theoretically pure. It is the transfer triggered architecture (wikipedia again, sorry). This family of architectures are also known as move machines and I have designed and built some myself.

Some consider move machines cheating since the machine actually have all the regular instructions only that they are memory mapped instead of being part of the opcode. But move machines are not merely theoretical, they are practical (like I said, I've built some myself). There is even a commercially available family of CPUs built by Maxim: the MAXQ. If you look at the MAXQ instruction set (they call it transfer set since there is really only one instruction, I usually call it register set) you will see that MAXQ assembly looks rather like a standard accumulator based architecture.

like image 161
slebetman Avatar answered Sep 17 '22 16:09

slebetman