truth table for ALU

Status
Not open for further replies.

Parth86

Member
how to make N bit ALU

for 4 Bit ALU
4 bit ALU
4 bit input A
4 bit input B
0 0 0 F= A and B
0 0 1 F= A or B
0 1 0 F= A Nand B
0 1 1 F= A nor B
1 0 0 F= A Xor B
1 0 1 F=A X nor B
1 1 0 F= A addition B
1 1 1 F= A subtraction B [/CODE]

Code:
S2  S1  S0             A     B     F
0     0    0           0     0      0         AND
                       0     1      0
                       1     0      0
                       1     1      1

0     0    1           0     0      0        or
                       0     1      1
                       1     0      1
                       1     1      1



0     1    0            0     0      1          NAND
                        0     1      1
                        1     0      1
                        1     1      0


0     1    1            0     0      1        NOR
                        0    1     0
                        1    0      0
                        1     1      0

1     0    0            0     0      0          Xor
                         0    1     1
                          1    0      1
                          1     1      0

1     0    1            0     0      1          X nor
                          0    1     0
                          1    0      0
                          1     1      1

1     1    0           0     0      0          addition
                        0    1     1
                        1    0      1
                        1     1      0

1     1    1            0     0      0        subtraction
                        0    1     1
                        1    0      1
                        1     1      0
 
Last edited by a moderator:
ALU perform following function

AND logic
OR logic
NAND logic
NOR logic
X or logic
X nor logic
addition
subtraction

I am not going to design for specific purpose
don't mind I made some simple specification for 4 bit processor

specification for 4 bit processor

1)4 bit ALU
2)3:8 decoder
3) 4 bit A register ( data register )
4) 4 bit B register (data register )
5) 4 bit Instruction register
6)4 bit address register
 
Why not just download the datasheet of 74LS181 and study it. It has the logic diagram of the internal design and you can just get the idea there and make your own 8-function ALU.

For me I would just buy the chip. It is still available at Element 14 and costs about US$7.00 + postage.

If you want to design your own 4 bit TTL CPU, there is one here at **broken link removed**

Allen
 

Attachments

  • 181.pdf
    126.3 KB · Views: 231
  • fourbit_sch.pdf
    35.9 KB · Views: 174
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…