DEMP Lab Sheet2-Logisim-final Updated
DEMP Lab Sheet2-Logisim-final Updated
Technology
Digital Electronics and Microprocessor: ESZC261
Laboratory Work Sheet -2
1. Important Instructions:
a. Experiment should be conducted on the BITS Nuvepro Cloud laboratory
only. Experiments conducted outside this laboratory platform will
not be evaluated.
b. Instructions on how to access and use the Nuvepro Cloud lab platform is
available in the document “Steps to access cloud based CS/IS virtual
lab.pdf”.
c. While using the Nuvepro Cloud, save all your work in Persistent folder
which is available on the desktop.
d. Completed worksheet should be uploaded in Taxila (e-learn) portal
only. Last date for uploading the document is 16-03-2025.
e. This laboratory activity carries 5% of weightage
f. Refrain from copying or sharing documents with others. Any
evidence of such practice will attract severe penalty.
Changed Username
Save your work in the desktop's Persistent Folder for later use.
Screen shot for 1.
Screen shot for 2.
Screen shot for 3.
Screen shot for 4.
Screen shot for 5.
Screen shot for 6.
Screen shot for 7.
Screen shot for 8.
Screen shot for 9.
Experiment 3
AIM:
INPUTS OUTPUTS
Realisation of Half Adder Using Basic Gates
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
Realisation of Half Adder using NAND gates
Realisation of Full Adder using Gates Full Adder Truth Table
INPUTS OUTPUTS
A B C Sum(S) Carry(Cin)
0 0 0 0 0
0 0 1 1 0
0 1 0 1 0
Realisation of Full Adder using NAND gates.
0 1 1 0 1
1 0 0 1 0
1 0 1 0 1
1 1 0 0 1
1 1 1 1 1
INPUTS OUTPUTS
A B Difference(D) Borrow(Br)
0 0 0 0
0 1 1 1
1 0 1 0
1 1 0 0
Half Subtractor by using NAND gates only:
A B C Difference(D) Borrow(Br)
0 0 0 0 0
0 0 1 1 1
0 1 0 1 1
0 1 1 0 1
1 0 0 1 0
Full Subtractor by using NAND gates only:
1 0 1 0 0
1 1 0 0 0
1 1 1 1 1
1. Download and install Logisim from SourceForge. Or use Nuvepro Cloud Laboratory.
2. Open Logisim and create a new project.
1. Select Components:
o Inputs: Two input pins for A and B.
o Gates: One XOR gate (Sum) and one AND gate (Carry).
o Output: Two LEDs for Sum and Carry.
2. Connect the Circuit:
o Connect A and B to XOR gate → Output goes to Sum.
o Connect A and B to AND gate → Output goes to Carry.
3. Label all inputs and outputs for clarity.
1. Select Components:
o Inputs: Three input pins for A, B, and Cin.
o Gates: Two XOR gates, two AND gates, and one OR gate.
o Output: Two LEDs for Sum and Carry-out.
2. Connect the Circuit:
o First XOR gate → (A ⊕ B).
o Second XOR gate → (A ⊕ B) ⊕ Cin (Sum).
o AND gates and OR gate for Carry-out logic.
3. Verify with the truth table by toggling inputs.
1. Select Components:
o Inputs: A and B.
o Gates: One XOR gate (Difference), one AND gate (Borrow).
o NOT gate for complementing A.
o Outputs: Two LEDs for Difference and Borrow.
2. Connect the Circuit:
o XOR gate for Difference.
o NOT gate followed by AND gate for Borrow.
Step 5: Implement Full Subtractor
1. Select Components:
o Inputs: A, B, and Borrow-in.
o Gates: Two XOR gates, two AND gates, and one OR gate.
o Outputs: Two LEDs for Difference and Borrow-out.
2. Connect the Circuit:
o XOR gates for Difference calculation.
o AND and OR gates for Borrow-out.
3. Verify with the truth table.
Conclusion
1. Half and Full Adders are used in digital arithmetic for binary addition.
2. Half and Full Subtractors perform binary subtraction.
3. Logisim provides a simple way to visualize and test logic circuits.
Post-Lab Questions
1. What is the difference between a half adder and full adder?
2. Why do we need a full subtractor instead of just a half subtractor?
3. Can you implement the same circuits using only NAND gates?
PART-B
AIM:
B3 B2 B1 B0 G3 G2 G1 G0
0 0 0 0 0 0 0 0
0 0 0 1 0 0 0 1
0 0 1 0 0 0 1 1
0 0 1 1 0 0 1 0
0 1 0 0 0 1 1 0
0 1 0 1 0 1 1 1
0 1 1 0 0 1 0 1
0 1 1 1 0 1 0 0
1 0 0 0 1 1 0 0
1 0 0 1 1 1 0 1
1 0 1 0 1 1 1 1
1 0 1 1 1 1 1 0
1 1 0 0 1 0 1 0
1 1 0 1 1 0 1 1
1 1 1 0 1 0 0 1
1 1 1 1 1 0 0 0
CIRCUIT DIAGRAM:
B3
G3
B2
G2
B1
G1
B0
Go
Binary to Gray code Conversion by using Nand Gates
Questions:
Objective
1. To design and implement Binary to Gray Code conversion using logic gates in Logisim.
2. To design and implement Gray to Binary Code conversion using logic gates in Logisim.
3. To verify the circuit output using truth tables.
Software Required
Logisim (Free and Open-source Logic Circuit Simulator)
Theory
1. Binary to Gray Code Conversion
Gray Code is a binary numeral system where two successive values differ in only one bit. It
is widely used in digital communication and error correction.
Conversion Rule
The process of converting Gray Code back to Binary is different from its encoding process.
Conversion Rule
Input Pins (4x): Representing the 4-bit Binary input (B3, B2, B1, B0).
XOR Gates (3x): Used for Gray Code conversion.
Output Pins (4x): Representing the 4-bit Gray Code output (G3, G2, G1, G0).
Input Pins (4x): Representing the 4-bit Gray Code input (G3, G2, G1, G0).
XOR Gates (3x): Used for Binary Code conversion.
Output Pins (4x): Representing the 4-bit Binary output (B3, B2, B1, B0).
Verification of Results
Post-lab Questions
1. What are the advantages of Gray Code over Binary Code in digital systems?
2. Explain why XOR gates are used in both conversions.
3. Can the circuits be extended to more than 4 bits? If yes, how?