Vous êtes sur la page 1sur 6

Objective:

To build a simple Arithmetic Logic Unit (ALU) to perform following arithmetic operations
using selection line as follows:

Instruction input Instruction


0 0 Add A & B
0 1 Subtract B from A
1 0 Multiply A by 2
1 1 Divide A by 2

Circuit Diagram:

Electronic Components Used:

• 2 Full adder circuits (IC 74283)


• 4 Not Gates
• 2 Octal flip-flop circuit (IC 74273)
• 5 4*1 Multiplexers

Procedure:

As given the inputs should be 4-bit so there are four inputs for A as A1, A2, A3 and A4, and
four inputs for B as B1, B2, B3 and B4. A4 and B4 are MSB and A1 and B1 are LSB. The eight
inputs were common for the ALU.

Addition:
To perform addition OR gates can be used but Full adder circuit was used. The carry in was
grounded because there is no input carry and than all the eight inputs were connected to adder
circuits inputs as A1 to A1, B1 to B1 and so on.
And than the 5 outputs were connected to the 5 multiplexers, as SUM1, SUM2, SUM3, SUM4
and carry output to MUX1, MUX2, MUX3, MUX4 and MUX5 input D0 respectively.

Subtraction:
For subtraction also the Full Adder circuit was used. 2’s Complement was taken for B and added
it to A and a VCC input was given at carry in of the circuit because A + Bˉ = A-B-1, so to cancel
effect of -1 VCC (High) was used.
And than the 4 outputs were connected to the 4 multiplexers, as SUM1, SUM2, SUM3 and
SUM4 output to MUX1, MUX2, MUX3 and MUX4 input D1 respectively

Multiplication:
For multiplication a eight bit flip-flop circuit(IC 74273) was used. As given we have to multiply
the input A by 2. So the binary multiplication by 2 can be performed by shifting the bits of
number to be divided to left.

0 1 0 0

1 0 0 0

For multiplication the input A1, A2, A3 and A4 were joined to inputs D2, D3, D4 and D5 of the
octal flip—flop respectively and the input D1 of octal flip-flop was ground because it has to be
zero all the time. The 4 outputs were connected to the 4 multiplexers, as Q1, Q2, Q3, Q4 and Q5
to MUX1, MUX2, MUX3, MUX4 and MUX5 at input D2 respectively.

Division:
For division a octal flip-flop circuit(IC 74273) was used. As given we have to divide A by 2. So
the binary division by 2 can be performed by shifting the bits of number to be divided to right.

1 0 0 0

0 1 0 0

So for division the input A2, A3 and A4 was joined with input D1, D2 and D3 of the octal flip—
flop respectively and the input D4 of octal flip-flop was ground because it has to be zero all the
time. The 4 outputs were connected to the 4 multiplexers, as Q1, Q2, Q3 and Q4 to MUX1,
MUX2, MUX3 and MUX4 at input D3 respectively.

Selection Lines:
The selection lines of multiplexer S0 and S1 are used to select the output through the
multiplexer. So the S0 selection of 5 multiplexers are commonly joint to a single S0 input and
same S1 input of 5 multiplexer is joint with single S1 input to give the input to all the
multiplexer to give the answer at output AN1, AN2, AN3, AN4 and carry as follows:
Instruction input Instruction
S1 S0
0 0 Add A & B
0 1 Subtract B from A
1 0 Multiply A by 2
1 1 Divide A by 2

Block Diagram:
Results:
These are results the results obtained from different out puts:

Selection
Input A Input B Result Operation
Lines
A1 A2 A3 A4 B1 B2 B3 B4 S0 S1 An1 An2 An3 An4 Carry Arithmetic Result
0 0 0 1 0 0 1 0 0 0 0 0 1 1 0 8+4 12
0 0 0 1 0 0 1 0 1 0 0 0 1 0 0 8-4 4
0 0 0 1 0 0 1 0 0 1 0 0 0 0 1 8*2 16
0 0 0 1 0 0 1 0 1 1 0 0 1 0 0 8 / 2 4

Vector Wave Form:

Inputs:
The following inputs were made to the circuit:

A4 A3 A2 A1
A= =8
1 0 0 0

B4 B3 B2 B1
B= =4
0 1 0 0

Outputs:

Addition:

A4 A3 A2 A1
A= =8
1 0 0 0

+
B4 B3 B2 B1
B= =4
0 1 0 0

Answer Carry AN4 AN3 AN2 AN1


= 12
= 0 1 1 0 0
Subtraction:

A4 A3 A2 A1
A= =8
1 0 0 0
-
B4 B3 B2 B1
B= =4
0 1 0 0

Answer Carry AN4 AN3 AN2 AN1


=4
= 0 0 1 0 0

Multiplication:

A4 A3 A2 A1
A= =8
1 0 0 0

=2
0 0 1 0

Answer Carry AN4 AN3 AN2 AN1


= 16
= 1 0 0 0 0
Division:

A4 A3 A2 A1
A= =8
1 0 0 0

=2
0 0 1 0

Answer Carry AN4 AN3 AN2 AN1


=4
= 0 0 1 0 0

Conclusion:
As it can be seen from the previous pages of this report that the design I have used
has been successful in performing its functions of addition subtraction
multiplication and division.

Vous aimerez peut-être aussi