43
EASWARI ENGINEERING COLLEGE ELECTRONICS AND COMMUNICATION ENGINEERING DEPARTMENT LABORATORY MANUAL ACADEMIC YEAR: 2010-2011 SUBJECT : CS 2207 DIGITAL ELECTRONICS LAB DEPARTMENT : CSE (III SEM)

Lab Manual Exp 1t05

Embed Size (px)

Citation preview

Page 1: Lab Manual Exp 1t05

EASWARI ENGINEERING COLLEGE

ELECTRONICS AND COMMUNICATION ENGINEERING DEPARTMENT

LABORATORY MANUAL

ACADEMIC YEAR: 2010-2011

SUBJECT : CS 2207 DIGITAL ELECTRONICS LAB

DEPARTMENT : CSE (III SEM)

Prepared By Reviewed By Approved By

1. Mrs.Jeswin Veancy Mr.B.Sridhar HoD/ECE2. Mrs.D.Vydeki

Page 2: Lab Manual Exp 1t05

University Syllabus

CS 2207 DIGITAL ELECTRONICS LAB 0 0 3 2

1. Design and implementation of Adder and Subtractor using logic gates.

2. Design and implementation of code converters using logic gates

(i) BCD to excess-3 code and vice versa

(ii) Binary to gray and vice-versa

3. Design and implementation of 4 bit binary Adder/ subtractor and BCD adder using IC 7483

4. Design and implementation of 2 bit Magnitude Comparator using logic gates 8 Bit Magnitude Comparator using IC 7485

5. Design and implementation of 16 bit odd/even parity checker generator using IC74180.

6. Design and implementation of Multiplexer and De-multiplexer using logic gates and study of IC74150 and IC 74154

7. Design and implementation of encoder and decoder using logic gates and study of IC7445 and IC74147

8. Construction and verification of 4 bit ripple counter and Mod-10 / Mod-12 Ripple counters

9. Design and implementation of 3-bit synchronous up/down counter

10. Implementation of SISO, SIPO, PISO and PIPO shift registers using Flip- flops

11. Design of experiments 1, 6, 8 and 10 using Verilog Hardware Description Language

Page 3: Lab Manual Exp 1t05

INDEX

S. No. Date Name of the Experiment Marks Sign

Page 4: Lab Manual Exp 1t05

INDEX

S. No. Date Name of the Experiment Marks Sign

Page 5: Lab Manual Exp 1t05

Exp.No: 1Date:

STUDY OF LOGIC GATES

AIM:To study the working of the logic gates and verify their truth tables.

COMPONENTS REQUIRED:S.No. Apparatus Specifications Quantity

1. IC Trainer kit -- 1 no2. Logic gate IC’s IC 7404, IC 7408, IC 7432 1no each3. Logic gate IC’s IC 7402, IC 7400, IC 7486 1no each4. connecting wires -- 1 set

THEORY:Positive Logic: In Positive Logic, +5 V is associated with Binary 1 while GND is

associated with Binary 0.

Negative Logic: In Negative Logic, +5 V is associated with Binary 0 while GND is

associated with Binary 1.

Gates: Electronic circuits whose terminal characteristics correspond to various Boolean

operations area called as Gates.

AND gate: It has one output and two or more inputs. The output will equal 0 for all

combinations of input values except when all inputs equal 1.

OR gate: It has one output and two or more inputs. If all inputs are caused to equal 0, the

output will also equal 0. The presence of a 1 bit at one or more inputs leads to an output

of 1.

NOT gate: It produces the INVERT operation. This logic element has one input and one

output. The output level is always opposite to the input level.

Universal gates: Universal gates are the ones which can be used for implementing any

Boolean function using gates like AND, OR and NOT, or any combination of these basic

gates; NAND and NOR gates are universal gates. But there are some rules that need to be

followed when implementing NAND or NOR based gates.

NOR gate: It is simply an OR gate followed by a NOT gate.

NAND gate: It is simply AND gate followed by a NOT gate.

Page 6: Lab Manual Exp 1t05

EX-OR gate: It is expanded as Exclusive-OR gate. It has one output and two or more

inputs. It produces an output of 1 if the inputs are of different logic levels and an output 0

if inputs are of the same logic level.

LOGIC GATES :

AND GATE NAND GATE

TRUTH TABLE TRUTHTABLE

OR GATE NOR GATE

TRUTH TABLE TRUTH TABLE

A B Y=A.B0011

0101

A B Y=A.B0011

0101

A B Y=A+B0011

0101

A B Y=A+B

0011

0101

IC 7408

IC 7432

IC 7400

IC 7402

Page 7: Lab Manual Exp 1t05

NOT GATE EX – OR GATE

TRUTH TABLE TRUTH TABLE

EX-NOR GATE:

TRUTH TABLE

PROCEDURE:1. Place the IC on the IC trainer kit and give the supply and ground connections.2. Apply the inputs to the logic gates through the input switches.3. Observe the output of the gates in the LED indicators.4. Verify the truth table of each logic gate.

RESULT:Thus the working of the logic gates was studied and their truth tables were

verified.

A Y=A00

A B0011

0101

A B

0011

0101

IC 7404 IC 7486

Page 8: Lab Manual Exp 1t05

Exp.No: 3Date:

IMPLEMENTATION OF BOOLEAN FUNCTIONS

AIM:To implement and verify the given Boolean function using logic gates.

COMPONENTS REQUIRED:

S.No. Apparatus Specifications Quantity1. IC Trainer kit -- 1 2. Logic gate IC’s IC 7404, IC 7432 1 3. Logic gate IC’s IC 7408 24. Connecting wires -- Few

Given function is:

F=

TRUTH TABLE:

Page 9: Lab Manual Exp 1t05

LOGIC DIAGRAM OF GIVEN BOOLEAN FUNCTION:

K MAP SIMPLIFICATION:

LOGIC DIAGRAM OF SIMPLIFIED BOOLEAN FUNCTION:

Page 10: Lab Manual Exp 1t05

Procedure: 1. Draw the truth table for the given Boolean function.

2. Determine the simplified expression for the output variable using K-Map.

3. Decide the corresponding logic gates to be used to implement the Boolean func-

tion simplified using K-Map.

4. Draw the logic diagram according to simplified Boolean function.

5. Construct the logic circuit using the above gates.

6. Verify the truth table.

Result:

Thus, the given Boolean function is implemented and verified using logic gates.

Viva Questions

1) What is K-map?

2) What is the use of K-Map

3) What are the limitations of K-Map

4) Give the other name for K-Map

5) What is a prime implicant

6) What are don’t care terms

7) What is meant by an incompletely specified function

8) Distinguish between incompletely specified function and completely specified function

9) Explain the general procedure that could be adopted in reducing Boolean expres-sion

10) List the two types of standard forms in Boolean algebra

11) Give the two canonical forms of Boolean function

12) What is a min term and max term

13) What are hybrid functions

Page 11: Lab Manual Exp 1t05

Exp.No: 4

Date:

DESIGN AND IMPLEMENTATION OF ADDERS AND SUBTRACTOR

AIM:

a. To design a half adder / subtractor and verify the function

b. To design a full adder / subtractor and verify the function.

c. Realize a full adder using two half adders and logic gates.

APPARATUS REQUIRED:

S.NO COMPONENTS RANGE/TYPE QUANTITY

1

2

3

4

5

IC 7408

IC 7486

IC 7404

IC TRAINER KIT

CONECTING WIRES

AND

EX-OR

NOT

-

-

1

1

1

1

FEW

THEORY:

HALF ADDER: Half adder is a circuit, which can add two numbers and produce two

outputs, sum and carry. From the truth table it is clear that sum represent the logic output

of an EX-OR gate and carry, that of an AND gate. Thus a half adder can be built using

two gates.

FULL ADDER:When the carry is generated by the addition of two bits, this has to be

added to next bit sum. Half adders do not allow this. There are only two inputs present. A

full adder can be used for this purpose. Here three inputs are given, addend augends and

the previous carry.

SUBTRACTORS:The subtraction of two binary numbers is done by either taking two’s

complement of subtrahend and adding the numbers or by direct method where bit-

subtraction is carried out to form a difference bit and if necessary, a borrow-bit just as in

adders, there are half and full subtractor.

HALF SUBTRACTORS:The two inputs, minuend and subtrahend are given to get two

outputs, difference and borrow. It is found that D is the same as S output of Half adder

and B resemble C of half adder except that input A is complemented.

Page 12: Lab Manual Exp 1t05

FULL SUBTRACTORS:This performs subtraction between two bits, taking into

account that one may have been borrowed by a lower significant stage. Three inputs

minuend, subtrahend and previous borrow to get two outputs borrow and difference.

HALF ADDER:

TRUTH TABLE:

INPUT OUTPUT

A B SUM CARRY

0

0

1

1

0

1

0

1

Page 13: Lab Manual Exp 1t05

Logic Diagram Of Half Adder

HALF SUBTRACTOR:

TRUTH TABLE:

Logic Diagram Of Half Subtractor

INPUT OUTPUT

A B DIFFERENCE BORROW

0

0

1

1

0

1

0

1

Page 14: Lab Manual Exp 1t05

FULL ADDER:

TRUTH TABLE

INPUT OUTPUT

A B Cin SUM CARRY

0

0

0

0

1

1

1

1

0

0

1

1

0

0

1

1

0

1

0

1

0

1

0

1

Page 15: Lab Manual Exp 1t05

Logic Diagram Of Full Adder

FULL SUBTRACTOR:

TRUTH TABLE:INPUT OUTPUT

A B Cin DIFF BORROW

0

0

0

0

1

1

1

1

0

0

1

1

0

0

1

1

0

1

0

1

0

1

0

1

Page 16: Lab Manual Exp 1t05

Logic Diagram of Full Subtractor

PROCEDURE:

1. Draw the truth table of the respective adder/subtractor.

2. Determine the simplified expression for the output variable using K-Map.

3. Decide the corresponding logic gates to be used to implement the above expres-

sion.

4. Draw the logic diagram according to output expression.

5. Construct the adder/Subtractor circuit using the above gates.

6. Verify the truth table.

RESULT:

Thus the full/half adder and subtractor circuits were designed and constructed and the truth tables were verified.

Viva Questions1) Define half adder and full adder

2) Design half adder using only NAND gates

3) Design half adder using only NOR gates

4) Design half adder using only EX-OR and AND gates

5) Design full adder using only NOR gates

6) Distinguish between Half adder and full adder

Page 17: Lab Manual Exp 1t05

Exp.No: 5Date:

DESIGN AND IMPLEMENTATION OF CODE CONVERTERS USING

LOGIC GATES

AIM:

To design and implement the code converters using logic gates.

1. BCD to EXCESS-3 code

2. EXCESS-3 to BCD code

3. BINARY to GRAY code

4. GRAY to BINARY code

APPARATUS REQUIRED:

S.NO COMPONENTS RANGE/TYPE QUANTITY

1 IC 7486 EX-OR 2

2 IC 7408 AND 2

3 IC 7432 OR 1

4 IC 74266 EX-NOR 1

5 IC 7404 NOT 1

6 IC TRAINER KIT - 1

7 CONNECTING WIRES - FEW

THEORY:

BCD TO EXCESS-3 CODE CONVERTER:

EXCESS-3 code is a modified form of BCD NUMBER. The EXCESS-3 code can be

derived from a natural a BCD code by adding three to each coded number. BCD is a

numeric code in which each digit of a decimal number is represented by a separate group

of bits. The most common BCD code is 8421BCD, in which each decimal digit is

represented by a four bit binary number. For eg.decimal-12 can be represented in BCD as

0001 0010. Now adding three to each digit we get EXCESS-3 code as 0100 0101.

Page 18: Lab Manual Exp 1t05

EXCESS-3 TO BCD CODE CONVERTER:

EXCESS-3 code is a modified form of BCD number. In EXCESS-3 code we get 9’s

complement of a number by just complementing each bit. Due to this EXCESS-3 code is

called self-complementing code. The BCD code can be derived from EXCESS-3 code by

subtracting three to each coded number. For eg.0100 0101(12 in decimal) EXCESS-3

Code is converted to BCD as 0001 0010 by subtracting 3 to each digit.

BINARY TO GRAY CODE CONVERTER:

The GRAY code is often used in digital systems because it has the advantage that only

one bit in the numerical representation changes between successive numbers. The binary

to gray code conversions performed by ex-ploring the present input with previous

successive bit. Gray code is a unit distance code. In this the two consecutive numbers

differ in only one bit position. In gray code the possibility of errors are reduced.

GRAY TO BINARY CODE CONVERTER:

In gray to binary code conversion, the MSB of binary number is same as

the MSB of gray code number. The next binary digit is obtained by performing an ex-or

operation between the previous binary bit obtained and the next gray code bit.

Page 19: Lab Manual Exp 1t05

BCD TO EXCESS – 3 CODE CONVERSIONS

TRUTH TABLE

K-map Simplification

BCD (Input) EXCESS–3 (Output)

A B C D W X Y Z

0 0 0 0 0 0 1 1

0 0 0 1 0 1 0 0

0 0 1 0 0 1 0 1

0 0 1 1 0 1 1 0

0 1 0 0 0 1 1 1

0 1 0 1 1 0 0 0

0 1 1 0 1 0 0 1

0 1 1 1 1 0 1 0

1 0 0 0 1 0 1 1

1 0 0 1 1 1 0 0

Page 20: Lab Manual Exp 1t05

Logic Diagram of BCD to Excess-3 Converter:

Page 21: Lab Manual Exp 1t05

EXCESS-3 TO BCD CODE CONVERTER:

TRUTH TABLE

K-Map Simplification:

K-map for D: K-map for C:

EXCESS–3 (Input) BCD (Output)

W X Y Z A B C D

0 0 1 1 0 0 0 0

0 1 0 0 0 0 0 1

0 1 0 1 0 0 1 0

0 1 1 0 0 0 1 1

0 1 1 1 0 1 0 0

1 0 0 0 0 1 0 1

1 0 0 1 0 1 1 0

1 0 1 0 0 1 1 1

1 0 1 1 1 0 0 0

1 1 0 0 1 0 0 1

Page 22: Lab Manual Exp 1t05

K-map for B: K-map for A:

Logic Diagram of Excess-3 to BCD Converter:

Page 23: Lab Manual Exp 1t05

BINARY TO GRAY

TRUTH TABLE

INPUTS(Binary Code) OUTPUTS (Gray Code)

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 0

0 0 1 1 0 0 1 1

0 1 0 0 0 1 0 0

0 1 0 1 0 1 0 1

0 1 1 0 0 1 1 0

0 1 1 1 0 1 1 1

1 0 0 0 1 1 0 0

1 0 0 1 1 1 0 1

1 0 1 0 1 1 1 0

1 0 1 1 1 1 1 1

1 1 0 0 1 0 0 0

1 1 0 1 1 0 0 1

1 1 1 0 1 0 1 0

1 1 1 1 1 0 1 1

Page 24: Lab Manual Exp 1t05

K-Map Simplification

Logic Diagram of Binary to Gray Converter

Page 25: Lab Manual Exp 1t05

GRAY TO BINARY

Truth Table

INPUT(Gray Code) OUTPUT (Binary Code)

G3 G2 G1 G0 B3 B2 B1 B0

0 0 0 0 0 0 0 0

0 0 0 1 0 0 0 1

0 0 1 1 0 0 1 0

0 0 1 0 0 0 1 1

0 1 1 0 0 1 0 0

0 1 1 1 0 1 0 1

0 1 0 1 0 1 1 0

0 1 0 0 0 1 1 1

1 1 0 0 1 0 0 0

1 1 0 1 1 0 0 1

1 1 1 1 1 0 1 0

1 1 1 0 1 0 1 1

1 0 1 0 1 1 0 0

1 0 1 1 1 1 0 1

1 0 0 1 1 1 1 0

1 0 0 0 1 1 1 1

Page 26: Lab Manual Exp 1t05

K-MAP SIMPLIFICATION

K-Map for B0 K-Map for B1

K-Map for B2 K-Map for B3

Logic Diagram of Gray To Binary Converter

PROCEDURE:

G1G0

G1G0

G1G0 G1G0

Page 27: Lab Manual Exp 1t05

1. Draw the truth table of the respective converter.

2. Determine the simplified expression for the output variable using K-Map.

3. Decide the corresponding logic gates to be used to implement the above expres-

sion.

4. Draw the logic diagram according to output expression.

5. Construct the converter circuit using the above gates.

6. Verify the truth table.

RESULT:

Thus the code converters were designed and implemented using logic gates and its

truth tables were verified.

Page 28: Lab Manual Exp 1t05

Viva Questions

1) What is code converter?

2) What is a weighted code? Give example.

3) What is a non-weighted code? Give example

4) What is the difference between binary code and BCD code?

5) Distinguish between weighted code and non-weighted code

6) Explain the uses of Excess-3 code

7) Show that Excess-3 code is self complementing

8) What is gray code

9) What are the advantages of gray code

10) What are error-detecting codes? Give example

11) What are error-correcting codes? Give example

12) Error correctable codes are Error detectable. True or False

13) Error detectable codes are Error correctable. True or False

14) What is an alpha numeric code?

15) Why ASCII code has seven bits?

16) What is Hollerith code?

17) What is Sequential code?

18) What is reflective code?