Tutorials/Redstone computer

Redstone has literally no limits of what you can create. Of all the creations, computers are the main interest in Redstone Development. Computers can be from a simple 4-bit processor with a byte or two of RAM that can do commands such as adding, storing to memory, and branching, to a super-computer with an integrated octa-core 16-bit CPU that can multitask and compute within less than a second. Computers' functions are to calculate and compute within a program, therefore it is not to be confused with a calculator. The following tutorial will show you how to build your own. Please note that this does not show you how to build components. You need an understanding of them in order to put them together.

Logic Gates
The following are the main logic gates to a computer:

AND Gate: This gate will send an output if both input A and input B are true.

OR Gate: This gate will send an output if either A or B is true.

Exclusive OR Gate: The XOR gate will output true if A or B is true but not if they are both on.

NOT Gate: Inverts signal with a redstone torch.

There are also inverted versians of the above gates such as NAND, NOR, and XNOR

RAM
RAM, short for Random Access Memory, is a place where the CPU can store strings of bits only to be used at a different time. The following will tell you about ways of storing memory(ram):

RS-NOR Latch: This cell uses two switches to toggle their state. They are built by two torches with wires connected to their input faces.

D-Flip-Flop: The cell uses two switches, one is for the memory to be stored and the other is to read it. Unlike an RS-NOR latch, it needs only one form of input from its back side.

T-Flip-Flop: Uses one trigger only. Updating the wire toggles the state.

ROM
ROM short for read only memory is used to store data that can only be read and usually is used when the computer is turned on/off It can also be used to store programs in this case it is usually called program memory or program ROM.

ALU
The Arithmetic and Logic Unit is controlled by the Control Unit and is part of the CPU. It gets two inputs, a and b. it also gets what to do with it. It should be able to do things like NOT, AND, OR, XOR, NOT, addition, and subtraction.