[ 2CEIT507 –COMPUTER ARCHITECTURE & ORGANIZATION ]
Practical: 6
AIM- Design and testing of 4-bit Arithmetic Logic Unit.
Department of Computer Engineering
2CEIT507-Computer Architecture &Organization Practical-6
Aim: Design and testing of 4-bit Arithmetic Logic Unit.
Theory:
ALU or Arithmetic Logical Unit is a digital circuit to do arithmetic operations like addition,
subtraction,division, multiplication and logical oparations like and, or, xor, nand, nor etc.
A simple block diagram of a 4 bit ALU for operations and,or,xor and Add is shown here :
The 4-bit ALU block is combined using 4 1-bit ALU block
Design Issues :
The circuit functionality of a 1 bit ALU is shown here, depending upon the control signal
S1 and
S0 the circuit operates as follows: for Control signal S1 = 0 , S0 = 0, the output is A And
B, for
Control signal S1 = 0 , S0 = 1, the output is A Or B, for Control signal S1 = 1 , S0 = 0, the
output is A Xor B, for Control signal S1 = 1 , S0 = 1, the output is A Add B.
Design of ALU:
To see the step by step process to perform the experiment in simulator follow tutorial 4-bit
Slice
ALU Tutorial or follow the steps below.
Procedure to perform the experiment:
Design of 4 bit ALU
1. Start the simulator as directed.This simulator supports 5-valued logic.
2. To design the circuit we need 4 1-bit ALU, 11 Bit switch (to give input,which will toggle
its value with a double click), 5 Bit displays (for seeing output), wires.
Enrollment No: Page No :19
Name :
2CEIT507-Computer Architecture &Organization Practical-6
3. The pin configuration of a component is shown whenever the mouse is hovered on any
canned component of the palette. Pin numbering starts from 1 and from the bottom left
corner (indicating with the circle) and increases anticlockwise.
4. For 1-bit ALU input A0 is in pin-9,B0 is in pin-10, C0 is in pin-11 (this is input carry), for
selection of operation, S0 is in pin-12, S1 is in pin-13, output F is in pin-8 and output carry
is pin-7
5. Click on the 1-bit ALU component (in the Other Component drawer in the pallet) and then
click on the position of the editor window where you want to add the component (no drag
and drop, simple click will serve the purpose), likewise add 3 more 1-bit ALU (from the
Other Component
6. To connect any two components select the Connection menu of Palette, and then click on
the Source terminal and click on the target terminal. According to the circuit diagram
connect all the
7. components. Connect the Bit switches with the inputs and Bit displays component with the
outputs. After the connection is over click the selection tool in the pallete.
Circuit diagram of 4 bit ALU:
Screenshot of Design of 4 bit ALU:
Enrollment No: Page No :20
Name :
2CEIT507-Computer Architecture &Organization Practical-6
Components :
To build any 4 bit ALU, we need :
1. AND gate, OR gate, XOR gate
2. Full Adder,
3. 4-to-1 UX<
4. Wires to connect.
In case of counters the number of flip-flops depends on the number of different states in the
counter.
Objective:
Objective of 4 bit arithmetic logic unit (with AND, OR, XOR, ADD operation):
1. Understanding behaviour of arithmetic logic unit from working module and the module
designed by the student as part of the experiment
2. Designing an arithmetic logic unit for given parameter
Recommended learning activities for the experiment: Leaning activities are designed in two
stages, a basic stage and an advanced stage. Accomplishment of each stage can be self-evaluated
through the given set of quiz questions consisting of multiple type and subjective type questions.
In the basic stage, it is recommended to perform the experiment firstly, on the given encapsulated
working module, secondly, on the module designed by the student, having gone through the theory,
objective and procuder. By performing the experiment on the working module, students can only
observe the input-output behavior. Where as, performing experiments on the designed module,
students can do circuit analysis, error analysis in addition with the input-output behavior. It is
recommended to perform the experiments following the given guideline to check behavior and test
plans along with their own circuit analysis. Then students are recommended to move on to the
advanced stage. The advanced stage includes the accomplishment of the given assignments which
will provide deeper understanding of the topic with innovative circuit design experience. At any
time, students can mature their knowledge base by further reading the references provided for the
experiment.
color configuration of wire for 5 valued logic supported by the simulator:
• if value is UNKNOWN, wire color= maroon
• if value is TRUE, wire color= blue
• if value is FALSE, wire color= black
• if value is HI IMPEDENCE, wire color= green
• if value is INVALID, wire color= orange
likewise the 16 bit arithmetic logic unit can be designed and tested
• by cascading 4 bit ALUs only the carry will propagate to the next level for ADD operation
Test plan :
1. Set inputs 0101 and 0011 and check output for all possible select input combinations.
Set any two 16-bit number and check output for all possible select input combinations. Use
Display units for checking output. Try to use minimum number of components to build. The
Enrollment No: Page No :21
Name :
2CEIT507-Computer Architecture &Organization Practical-6
pin configuration of the canned components are shown when mouse hovered over a
component.
Output:
Enrollment No: Page No :22
Name :