MC14500B
A real chip with a 1-bit register and sixteen 4-bit instructions, written as one hex digit each.
Motorola · Turing complete: no · ●○○ easy · esolangs.org
Tested with 3 known programs · Test method
Run it
The idea
The MC14500B is a 1-bit microcontroller that Motorola designed. It has one 1-bit register, a 1-bit data bus and sixteen instructions of 4 bits each. The specification writes a program as a string of hex digits, one per instruction, and gives a short implementation in which the data bus is a single bit.
Read the story
So the whole memory is two bits. The only ways to change the path are a jump back to the start and two instructions that skip the next one, so a program that loops runs until a skip carries it past its jump.
The machine
| Digit | Name | Does |
|---|---|---|
1 2 | LD, LDC | Load the data bit, or its complement, into R |
3 5 7 | AND, OR, XNOR | Combine R with the data bit |
4 6 | ANDC, ORC | Not (R and data), not (R or data) |
8 9 | STO, STOC | Store R, or its complement, in the data bit |
A | IEN | Read the next input bit into R |
B | OEN | Print R |
C | JMP | Go back to the start |
D | RTN | Skip the next instruction |
E | SKZ | Skip the next instruction if R is 0 |
0 F | NOPO, NOPF | Set a flag that nothing reads |
R and the data bit start at 0. When the input runs out, the signal stays at the last bit.
Example
The truth machine is four digits.
The truth machine is four digits. It reads a bit and prints it. A 1 lets the jump run, so it reads and prints again; a 0 skips the jump and the program ends. Given the signal 1, 1, 1, 0 it prints each one.
Without input R can still be set, since the data bit is 0 and LDC loads its complement.
Further
See also
Also in Turing tarpits
Write your own in Run Convert a program from MC14500B
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: mc14500b.
Command line
shib run mc14500b -e 'ABEC' --input '0'shib manual mc14500bSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/mc14500b.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org