0% found this document useful (0 votes)
14 views

DEMP Lab Sheet2-Logisim-final Updated

This document outlines the laboratory work for Digital Electronics and Microprocessor, focusing on experiments involving half and full adders, subtractors, and binary to Gray code conversions using logic gates in Logisim. It includes important instructions for conducting experiments on the BITS Nuvepro Cloud laboratory, submission guidelines, and detailed steps for implementing circuits. Additionally, it provides truth tables, circuit diagrams, and post-lab questions to reinforce learning outcomes.

Uploaded by

HARSH Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

DEMP Lab Sheet2-Logisim-final Updated

This document outlines the laboratory work for Digital Electronics and Microprocessor, focusing on experiments involving half and full adders, subtractors, and binary to Gray code conversions using logic gates in Logisim. It includes important instructions for conducting experiments on the BITS Nuvepro Cloud laboratory, submission guidelines, and detailed steps for implementing circuits. Additionally, it provides truth tables, circuit diagrams, and post-lab questions to reinforce learning outcomes.

Uploaded by

HARSH Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

Department of Computer Science and Information

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.

g. Any queries related to LAB Activities should be sent to


<[email protected] > and [email protected]
h. Attach the screenshot of the output in line with the question or at the end
of the document mentioning proper question number.

<<Follow the Submission guidelines and change your name from


“labuser” to your BITS ID as shown below>>

Change your login name in Nuvepro Lab from “labuser” to BITS ID


(For Example: 202419tw080).
 You need to follow the below procedure to change the name on Every
login as the username is not Persistent

Change the UserName


“labuser”

 Goto Applications-Select System option-Click on User and Group as


follows
 On Users Settings, Click on Change command box

 Enter the BITS ID (202419tw080) in Full Name Textbox as shown in below


picture and click on “OK” button and then click on “Close” button.
 To make sure your change in user name “Logout” from current user and Click on
Reconnect.

 All the snapshots should show Student ID as follows

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:

 To Realize Half and Full adder by using


I. X-OR and Basic Gates

II. Nand Gate only Truth Table

INPUTS OUTPUTS
Realisation of Half Adder Using Basic Gates

A B Sum (s) Carry(c)

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

1. Half Subtractor by using basic gates:

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:

Full Subtractor by using basic gates:


INPUTS OUTPUTS

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

Truth Table for full Subtractor


Step-by-Step Implementation in Logisim
Step 1: Open Logisim

1. Download and install Logisim from SourceForge. Or use Nuvepro Cloud Laboratory.
2. Open Logisim and create a new project.

Step 2: Implement Half Adder

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.

Step 3: Implement Full Adder

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.

Step 4: Implement Half Subtractor

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.

Step 6: Testing the Circuits


1. Toggle input switches between 0 and 1.
2. Check LED outputs for correctness.
3. Compare 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:

 To Convert Binary to Gray Code and Gray to Binary Code Conversion.


Truth Table for Binary to Gray Code Conversion:

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:

Binary to Gray code Conversion by using Basic Gates

B3
G3
B2

G2
B1
G1
B0
Go
Binary to Gray code Conversion by using Nand Gates

Questions:

 Define Binary Code


 Define Gray Code
 What are Reflected Codes? Give an example for reflected code
 What is self Complementary Code? Give an for Self Complementary code
 Explain binary logic?
 Represent the following Decimal number 8620 in Gray Code
Experiment 4 (Combination Circuits)

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 MSB (Most Significant Bit) remains the same.


 The next bits are obtained by XORing the previous binary bit with the current bit.

2. Gray Code to Binary Conversion

The process of converting Gray Code back to Binary is different from its encoding process.

Conversion Rule

 The MSB (Most Significant Bit) remains the same.


 The next binary bit is obtained by XORing the previous binary bit with the corresponding
gray bit.

Truth Table for Gray to Binary Code (4-bit example)


Step-by-Step Implementation in Logisim

Step 1: Open Logisim

1. Open Logisim software.


2. Create a new project by selecting File → New.

Implementation of Binary to Gray Code Converter


Step 2: Select Components

 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).

Step 3: Connect the Circuit

1. Connect B3 directly to G3.


2. Connect an XOR gate between B3 and B2, and its output to G2.
3. Connect an XOR gate between B2 and B1, and its output to G1.
4. Connect an XOR gate between B1 and B0, and its output to G0.
5. Label the inputs and outputs for clarity.
Step 4: Run Simulation

1. Click Simulate → Tick Enable.


2. Toggle the binary inputs and observe the Gray Code outputs.

Implementation of Gray to Binary Code Converter


Step 5: Select Components

 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).

Step 6: Connect the Circuit

1. Connect G3 directly to B3.


2. Connect an XOR gate between B3 and G2, and its output to B2.
3. Connect an XOR gate between B2 and G1, and its output to B1.
4. Connect an XOR gate between B1 and G0, and its output to B0.
5. Label the inputs and outputs.

Step 7: Run Simulation

1. Click Simulate → Tick Enable.


2. Toggle the gray code inputs and observe the Binary outputs.

Verification of Results

1. Create a truth table for both conversions.


2. Ensure that the circuit outputs match the expected 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?

You might also like