7th Assignment: 4bit Computer (Binary)

Digital computers can only represent two states, on and off or zero and one, there are only two numbers available.
To represent the outputs and inputs we use a truth table. Here you can see the 4 possible values of the inputs A and B, and the four possible outputs represented by Sum and Carry.

4 bit 1.PNG

Logic Gates
Here are the three basic types of logic gates which are the simplest gates to make from transistors. You can make all other types of gates by combining these three.

4bit 2

An AND gate outputs one only when both its inputs are one. An OR gate outputs one when either input is one. Finally a NOT gate (or inverter as it is sometimes called) outputs the opposite of its input, so if the input is one the output is zero and vice-versa.

4bit 3

Building logic gates from transistors
First up is the NOT gate. Here if the input is 1 it causes the electricity to flow from the collector to the emitter (top to bottom). Since the electricity will always follow the path of least resistance the output will be zero. If the input is zero, the transistor prevents the flow from collector to emitter, so the electricity flows out of the output causing it to be one.

4bit 4

Next up is the AND gate. This requires two transistors, the inputs are on the bases and only if both inputs are one can the electricity flow to the output, making it a one also.

4bit 5

The OR gate is similar but has two possible paths for the electricity, so if one base or the other is one, electricity flows to the output.

4bit 6

Building a full-adder
Once you have these basic building blocks you can combine them together using the logic diagram for a full adder, which gives us this circuit diagram:

CIRCUIT

Using all this information and the photo above I have built this computer: