DicemanX
Brain of Cthulhu
Thanks to ZeroGravitas and his work on hoiktronics, I present my version of an early Terraria computer with arithmetic functions. Here's a video of the computer in action:
Terraria Computer:
Computer Wiring:
How the Binary Computer Functions:
The computer consists of three registers:
1) 8-bit Memory Register (output via orange numbers bottom right of the player corridor)
2) 8-bit MQ Register (output via yellow numbers top right of the player corridor)
3) 9-bit Accumulator Register (output via yellow numbers above the player corridor)
The registers hold numbers from 0-255 for the 8-bit registers, and 0-511 for the 9-bit register. The number that's held can be determined by summing up the numbers in the registry display that are lit up. For example, let's suppose that the following numbers are lit up:
The Accumulator Register holds 16+32+256 = 304
The MQ Register holds 16+32 = 48
The Memory Register holds 8+64+128 = 200
3 levers control the mathematical operations:
1) The M lever (for multiplication, addition, and subtraction)
2) The C lever (complement for subtraction and division)
3) The Q lever (for determining quotients when dividing)
Two additional levers:
1) The 0 lever (CLEAR function - sets all registers to 0)
2) The T lever (translates the binary output in the Accumulator Register to a Decimal output using seven-segment 0-999 display)
Computer Arithmetic:
The way multiplication works is to take the information stored in the Memory Register and add it to the Accumulator Register. The number of times that the info is added is determined by the MQ Register. For instance, if the Memory Register holds 87, and the MQ register holds 5, then 87 will be added 5 times to the Accumulator Register. After the process of adding is finished, the output in the Accumulator Register will be 87x5 = 435.
Addition is essentially multiplication by 1. The content of the Memory Register is added to the Accumulator Register once. For instance, if the Accumulator Register holds 34, and the Memory Register holds 210, then 210 will be added once to 34 (so long as the MQ Register holds 1) for addition of 210+34 = 244.
Division and subtraction are more complicated, and require taking the complements of numbers. Since this is meant to be a more basic guide, I will instead give the protocols for all arithmetic operations below and let you have the fun of figuring out how everything works.
Programs:
To make the presentation of the programs more user friendly, I will use the the terms "activate" if a lever needs to be pulled, and "set" if a register needs to be set to a certain value (values will be denoted by the variables X, Y, and Z). To execute a program the instructions need to be followed from top to bottom. I will stick to basic programs for the time being, and in a later guide describe more advanced functions.
Multiplication Program:
Activate CLEAR lever
Set MQ Register to X
Set Accumulator Register to 0
Set Memory Register to Y
Activate M lever
Result: Accumulator will show the outcome of X times Y.
Addition Program:
Activate CLEAR lever
Set MQ Register to 1
Set Accumulator Register to X
Set Memory Register to Y
Activate M lever
Result: Accumulator will show the outcome of X plus Y. Since the MQ Register is set to 1, the contents of the Memory Register are only added once to the contents of the Accumulator Register.
Subtraction Program:
Activate CLEAR lever
Set MQ Register to 1
Set Accumulator Register to X
Set Memory Register to Y
Activate C lever
Activate M lever
Result: Accumulator will show the outcome of Y minus X. Note that the smaller number in the subtraction should go into the Accumulator Register, and the larger number should go in the Memory Register (i.e. Y > X). This machine can handle negative numbers, but that will be the subject of discussion in a later more comprehensive guide.
Division Program:
Activate CLEAR lever
Set MQ Register to 255
Set Accumulator Register to X
Set Memory Register to Y
Activate C lever
Activate Q lever
Result: The MQ Register will show the outcome of X divided by Y. To keep it simple make sure that X is a multiple of Y to avoid non-integer values. This machine can handle fractions, but again I will describe how in a later guide. Note that the MQ Register always has to be set to its maximum value when doing division, and it's the MQ Register, not the Accumulator Register, that will hold the answer to the division problem.
Conversion from Binary to Decimal:
After a calculation is completed and the result is in the Accumulator Register, the binary number stored there can be converted to a decimal value by activating the T lever. The conversion takes about 1 second for every 10 digits converted, so for instance if the Accumulator holds 140 then it will take about 14 seconds to convert that into decimal. The decimal display has to be reset by hand using the three switches (one switch for each digit) next to the display.
World Download:
http://www.filedropper.com/dicemanxhmworldv51_2
I strongly encourage you to download this world and try out the computer for yourself. See if you can also figure out the actual mechanism by observing the computer in action! We're well on our way to building even more complicated machines in Terraria thanks to ZeroGravitas introducing us to hoiks and hoiktronics!
ZeroGravitas' version (first ever published version of a working in-game computer):
ZeroGravitas' Guide to Hoiktronics:
http://forums.terraria.org/index.php?threads/hoiktronics-what-is-it-guide.8371/
Terraria Computer:
Computer Wiring:
How the Binary Computer Functions:
The computer consists of three registers:
1) 8-bit Memory Register (output via orange numbers bottom right of the player corridor)
2) 8-bit MQ Register (output via yellow numbers top right of the player corridor)
3) 9-bit Accumulator Register (output via yellow numbers above the player corridor)
The registers hold numbers from 0-255 for the 8-bit registers, and 0-511 for the 9-bit register. The number that's held can be determined by summing up the numbers in the registry display that are lit up. For example, let's suppose that the following numbers are lit up:
The Accumulator Register holds 16+32+256 = 304
The MQ Register holds 16+32 = 48
The Memory Register holds 8+64+128 = 200
3 levers control the mathematical operations:
1) The M lever (for multiplication, addition, and subtraction)
2) The C lever (complement for subtraction and division)
3) The Q lever (for determining quotients when dividing)
Two additional levers:
1) The 0 lever (CLEAR function - sets all registers to 0)
2) The T lever (translates the binary output in the Accumulator Register to a Decimal output using seven-segment 0-999 display)
Computer Arithmetic:
The way multiplication works is to take the information stored in the Memory Register and add it to the Accumulator Register. The number of times that the info is added is determined by the MQ Register. For instance, if the Memory Register holds 87, and the MQ register holds 5, then 87 will be added 5 times to the Accumulator Register. After the process of adding is finished, the output in the Accumulator Register will be 87x5 = 435.
Addition is essentially multiplication by 1. The content of the Memory Register is added to the Accumulator Register once. For instance, if the Accumulator Register holds 34, and the Memory Register holds 210, then 210 will be added once to 34 (so long as the MQ Register holds 1) for addition of 210+34 = 244.
Division and subtraction are more complicated, and require taking the complements of numbers. Since this is meant to be a more basic guide, I will instead give the protocols for all arithmetic operations below and let you have the fun of figuring out how everything works.
Programs:
To make the presentation of the programs more user friendly, I will use the the terms "activate" if a lever needs to be pulled, and "set" if a register needs to be set to a certain value (values will be denoted by the variables X, Y, and Z). To execute a program the instructions need to be followed from top to bottom. I will stick to basic programs for the time being, and in a later guide describe more advanced functions.
Multiplication Program:
Activate CLEAR lever
Set MQ Register to X
Set Accumulator Register to 0
Set Memory Register to Y
Activate M lever
Result: Accumulator will show the outcome of X times Y.
Addition Program:
Activate CLEAR lever
Set MQ Register to 1
Set Accumulator Register to X
Set Memory Register to Y
Activate M lever
Result: Accumulator will show the outcome of X plus Y. Since the MQ Register is set to 1, the contents of the Memory Register are only added once to the contents of the Accumulator Register.
Subtraction Program:
Activate CLEAR lever
Set MQ Register to 1
Set Accumulator Register to X
Set Memory Register to Y
Activate C lever
Activate M lever
Result: Accumulator will show the outcome of Y minus X. Note that the smaller number in the subtraction should go into the Accumulator Register, and the larger number should go in the Memory Register (i.e. Y > X). This machine can handle negative numbers, but that will be the subject of discussion in a later more comprehensive guide.
Division Program:
Activate CLEAR lever
Set MQ Register to 255
Set Accumulator Register to X
Set Memory Register to Y
Activate C lever
Activate Q lever
Result: The MQ Register will show the outcome of X divided by Y. To keep it simple make sure that X is a multiple of Y to avoid non-integer values. This machine can handle fractions, but again I will describe how in a later guide. Note that the MQ Register always has to be set to its maximum value when doing division, and it's the MQ Register, not the Accumulator Register, that will hold the answer to the division problem.
Conversion from Binary to Decimal:
After a calculation is completed and the result is in the Accumulator Register, the binary number stored there can be converted to a decimal value by activating the T lever. The conversion takes about 1 second for every 10 digits converted, so for instance if the Accumulator holds 140 then it will take about 14 seconds to convert that into decimal. The decimal display has to be reset by hand using the three switches (one switch for each digit) next to the display.
World Download:
http://www.filedropper.com/dicemanxhmworldv51_2
I strongly encourage you to download this world and try out the computer for yourself. See if you can also figure out the actual mechanism by observing the computer in action! We're well on our way to building even more complicated machines in Terraria thanks to ZeroGravitas introducing us to hoiks and hoiktronics!
ZeroGravitas' version (first ever published version of a working in-game computer):
ZeroGravitas' Guide to Hoiktronics:
http://forums.terraria.org/index.php?threads/hoiktronics-what-is-it-guide.8371/
Last edited: