how to make N bit ALU
ALU has two input word A, B
N bit ALU
An input
Bn input
F input
example
1 bit alu
0+1=1
2 bit ALU
01+10=11
4 bit ALU
0101+1010=1111
example -
1 bit ALU
1 bit input A
1 bit input B
1 bit output F
same for 2 bit ALU
2 bit ALU
2 bit input A
2 bit input B
2 bit output F
for 4 Bit ALU
4 bit ALU
4 bit input A
4 bit input B
4 bit output F
ALU has two input word A, B
N bit ALU
An input
Bn input
F input
example
1 bit alu
0+1=1
2 bit ALU
01+10=11
4 bit ALU
0101+1010=1111
example -
1 bit ALU
1 bit input A
1 bit input B
1 bit output F
Code:
s ALU performance
0 F= addition
1 F= A and B
2 bit ALU
2 bit input A
2 bit input B
2 bit output F
Code:
S0 S1 F
0 0 F= addition
0 1 F= subtraction
1 0 F= A and B
1 1 F= A or B
for 4 Bit ALU
4 bit ALU
4 bit input A
4 bit input B
4 bit output F
Code:
S2 S1 S0 F
0 0 0 F= addition
0 0 1 F= subtraction
0 1 0 F= shift right
0 1 1 F=shift right
1 0 0 F= A and B
1 0 1 F=A or B
1 1 0 F= A not B
1 1 1 F= A and B
Last edited: