Arithmetic logic unit
Appearance

The ALU is a component in a computer that does the actal processing in a computer, it has an opcode input and inputs for A and B. Its like the brains of the computer. It can add two numbers or subtract two numbers. It can also do bitwise operations. Like XOR, NOR, AND, OR, is 0, is -, carry. It can do flags like A = B, A > B, A < B.
Example of what opcodes may look like:
Name | Opcode | Description |
---|---|---|
Add | 000 | Adds A and B |
Sub | 001 | Subtracts A and B |
AND | 010 | if A and B are true then output true else output false |
NAND | 011 | invert of AND if A and B is true then output false |
OR | 100 | either A or B |
NOR | 101 | invert of OR |
XOR | 110 | OR of A and B but if both are true then output false |