Thursday, July 30, 2009

Universe of Binary Switches

As I indicated in a previous post, Digital Cosmology, there exist multiple digital universes, and each universe is initialized to a very large chunk of bits. The no. of bits per universe = 2 ^ 65,536, and the no. of universes is equal to the total no. of possible unique universes = 2 ^ (2 ^ 65,536). Each universe, though initialized to a pile of bits, is actually composed of 2 ^ 65,519 binary switches. Each switch has 2 words of length 65,536 bits. Each word contains a 65,519-bit pointer to another switch, and can be either on or off.

The switches are organized into a binary tree of depth 65,519. Each leaf of the binary tree points to a linear array of 65,519 switches. There are 2 special kinds of switches: a termination switch, in which the right pointer is null, and a bit-writing switch, in which the left pointer is null. For any switch, if the switch is on, the left pointer is active. If the switch is off, the right pointer is active.

At the top of memory there are 16 registers of length 65,519 bits: 8 data registers and 8 address registers. Two special data registers are the accumulator and the instruction register. A special address register is the program counter. During each iteration of the main loop, the following operations take place:
  1. Decode the program counter
  2. Fetch one bit of memory into the instruction register
  3. If that bit is zero, fetch the op code from memory into the instruction register
  4. If that bit is one, fetch the op code and 65,519 bits from memory into the instruction register and the instruction operand data register, respectively
  5. Decode the instruction register
  6. Perform the instruction
  7. If the most significant bit in the instruction register is a zero, increment the program counter
  8. Else if the instruction evaluates to true, copy the instruction operand data register into the program counter
  9. Else increment the program counter
Note that even though at universe-initialization time, each switch is initialized to 2 words each of length 2 ^ 65,536 bits, the amount of time it takes to traverse one switch is just one clock cycle.

When the switches are being traversed, there is only a small no. (say up to 16) of possible instructions, performed at a particular switch:
  • 0 - Write a zero
  • 1 - Write a one
  • W - Write value of current flag
  • R - Read the switch (follow it)
  • R' - Read the opposite of the switch (follow inactive pointer)
  • T - Toggle the switch
When an open termination switch is encountered (a switch in the off position with a right pointer of null), a short sequence of the above commands is processed, depending on where in the microcode the microcode program counter is pointing to. The following loop is processed every time all of the previously closed termination switches need to be opened:
  • If current switch is a closed termination switch, open it and then follow it: 0, R'
  • Keep on doing that until there are no more closed termination switches
On the long weekend I intend to write the microcode, determine the exact wiring diagram of the address decoder, main memory, instruction decoder, registers, and accumulator, as well as design the instruction set (which should be similar to the instruction set in my previous post, Digital Cosmology). So that's the way it is here in the Land of the Digital Multiverse.

No comments:

Post a Comment