This is part of a project to construct a 4 BIT CPU from scratch. I will be starting with a simple NOR gate and building it up to a working model with ALU registers, RAM and ROM. I will be designing an op code and assembler to go with it. Progress and detail can be found on my blog here
This file contains the ALU
Computer Systems Architecture
32-bit ALU, only with AND, OR, and ADDER/SUBTRACTOR.
This is a 4 bit adder (obviously). This is a really low-grade calculator that cannot add numbers larger than 16 (in binary). If you want to check the validity of the calculator, here is a list of values for binary.
1 = 0001 , 4= 0100 , 7=0111 , 10 = 1010
2= 0010 , 5= 0101 , 8=1000 , 11= 1011
3= 0011 , 6= 0110 , 9= 1001 , 12= 1100