0% found this document useful (0 votes)
14 views20 pages

Lab 3 DLD

The document outlines Lab No. 3 for the EE-221 Digital Logic Design course, focusing on the design of practical circuits. It includes tasks such as creating truth tables and implementing circuits for an aircraft landing gear indicator, a three-way switch for lighting, and a speed warning device. Each task requires hardware implementation and coding in Verilog, along with performance analysis and safety considerations.
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 views20 pages

Lab 3 DLD

The document outlines Lab No. 3 for the EE-221 Digital Logic Design course, focusing on the design of practical circuits. It includes tasks such as creating truth tables and implementing circuits for an aircraft landing gear indicator, a three-way switch for lighting, and a speed warning device. Each task requires hardware implementation and coding in Verilog, along with performance analysis and safety considerations.
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/ 20

Department of Electrical Engineering

Faculty Member: MS RAFIA AHMAD Dated: 04-FEB-2025

Semester: 2ND Section: BSDS-02-A


Group No.:

EE-221: Digital Logic Design

Lab No # 3: Design of Simple Practical Circuits

PLO4/CLO4 PLO4/CLO4 PLO5/CLO5 PLO8/CLO6 PLO9/CLO7

Name Reg. No Viva / Lab Analysis of Modern Tool Ethics and Individual Total
Performance data in Lab Usage Safety and Team marks
Report Work Obtained

5 Marks 5 Marks 5 Marks 5 Marks 5 Marks 25 Marks

Anas Norani 501231

Hanan Majeed 519166

Mujtaba Umar 510196

Shehryar 520299

EE-221: Digital Logic Design Page 1


Lab No 3 : Digital Design of Simple Practical Circuits
Prelab:

1. Design the practical circuits given in Task 1 and Task 2 by giving the truth table of the problems and
then giving the circuit (logic diagram) for the designs. Implement in hardware, Proteus, and Verilog.

2. Provide only Truth Table of Task 3.

Lab Tasks:

Task No 1 (4)

As part of an aircraft’s functional monitoring system, a circuit is required to indicate the status of the
landing gear prior to landing. A green LED (Light Emitting Diode) display turns on if all three gears are
properly extended when the “gear down” switch has been activated in preparation for landing. A red LED
display turns on if any of the gear fails to extent properly prior to landing. When landing gear is extended, its
sensor produces a HIGH voltage. When a landing gear is retracted its sensor produces a LOW voltage. Write
the truth table for the aircraft landing system. Implement with basic logic gates.

5V

Red LED

Left Wing gear sensor


Nose gear sensor
Right Wing gear sensor
Green LED

0V

Logic Circuit

EE-221: Digital Logic Design Page 2


Truth Table

Input 1 Input 2 Input 3 Green light Red light

0 0 0 0 1

0 0 1 0 1

0 1 0 0 1

0 1 1 0 1

1 0 0 0 1

1 0 1 0 1

1 1 0 0 1

1 1 1 1 0

Proteus SS

EE-221: Digital Logic Design Page 3


EE-221: Digital Logic Design Page 4
Output:

EE-221: Digital Logic Design Page 5


Verilog Code (Code Text, SS, Output Waveform)

Text Screen Shot

module lab_3(out1,out2,in1,in2,in3);

input in1,in2,in3;

output out1,out2;

wire and_1;

and a1(and_1,in1,in2);

and a2(out1,and_1,in3);

not n1(out2,out1);

endmodule

module testing101;

reg IN1,IN2,IN3;

wire OUT1,OUT2;

lab_3 test(OUT1,OUT2,IN1,IN2,IN3);

initial

begin

#100 IN1=1'b0;IN2=1'b0;IN3=1'b0;

#100 IN1=1'b0;IN2=1'b0;IN3=1'b1;

#100 IN1=1'b0;IN2=1'b1;IN3=1'b0;

#100 IN1=1'b0;IN2=1'b1;IN3=1'b1;

#100 IN1=1'b1;IN2=1'b0;IN3=1'b0;

#100 IN1=1'b1;IN2=1'b0;IN3=1'b1;

#100 IN1=1'b1;IN2=1'b1;IN3=1'b0;

#100 IN1=1'b1;IN2=1'b1;IN3=1'b1;

end

endmodule

EE-221: Digital Logic Design Page 6


Hardware Implementation

EE-221: Digital Logic Design Page 7


EE-221: Digital Logic Design Page 8
EE-221: Digital Logic Design Page 9
EE-221: Digital Logic Design Page 10
Task No 2 (4)

Design a three-way switch for lighting a bulb. Suppose the Switch A is installed at the entrance of the room,
switch B is installed to the bedside table, Switch C is installed outside the room. Now three way switching
can facilitate the switching ON/OFF from any location. The mechanism is such that if a single switch is on
the bulb should be ON. Now if the second switch is turned on the bulb if switched on earlier is switched off.
If two switches are already on and third switch is turned on then it should switch on the bulb. Implement with
basic gates.

Truth Table

Switch 1 Switch 2 Switch 3 bulb

0 0 0 0

0 0 1 1

0 1 0 1

0 1 1 0

1 0 0 1

1 0 1 0

1 1 0 0

1 1 1 1

Proteus SS

EE-221: Digital Logic Design Page 11


EE-221: Digital Logic Design Page 12
EE-221: Digital Logic Design Page 13
Output WaveForm:

EE-221: Digital Logic Design Page 14


Verilog Code (Code Text, SS, Output Waveform)

Text Screen Shot


module task2(out, in1, in2, in3);

input in1, in2, in3;

output out;

wire xor1;

xor x1(xor1, in1, in2);

xor x2(out, xor1, in3);

endmodule

module testing_mine;

reg IN1, IN2, IN3;

wire OUT;

task2 test(OUT, IN1, IN2, IN3);

initial

begin

#100 IN1 = 1'b0; IN2 = 1'b0;


IN3 = 1'b0;

#100 IN1 = 1'b0; IN2 = 1'b0;


IN3 = 1'b1;

#100 IN1 = 1'b0; IN2 = 1'b1;


IN3 = 1'b0;

#100 IN1 = 1'b0; IN2 = 1'b1;


IN3 = 1'b1;

#100 IN1 = 1'b1; IN2 = 1'b0;


IN3 = 1'b0;

#100 IN1 = 1'b1; IN2 = 1'b0;


IN3 = 1'b1;

#100 IN1 = 1'b1; IN2 = 1'b1;


IN3 = 1'b0;

#100 IN1 = 1'b1; IN2 = 1'b1;


IN3 = 1'b1;

end

endmodule

EE-221: Digital Logic Design Page 15


Hardware Implementation

EE-221: Digital Logic Design Page 16


EE-221: Digital Logic Design Page 17
EE-221: Digital Logic Design Page 18
EE-221: Digital Logic Design Page 19
Task No 3 (2)

The system is a speed warning device. It receives, on two lines, an indication of the speed limit on the
highway. There are three possible values 45, 55, or 65 MPH. It receives from the automobile, on two other
lines, an indication of speed of the vehicle. There are four possible values under 45, between 46 and 55,
between 56 and 65, and over 65 MPH. It produces two outputs. The first f, indicates whether the car is going
above the speed limit. The second g, indicates that the car is driving at “dangerous speed” – defined as either
over 65 MPH or more than 10 MPH above the speed limit. Show how each of the inputs and outputs are coded
(in terms of binary values) and complete the truth table for the system.

Truth Table

S1 S0 V1 V0 Speed Limit Vehicle Speed f (Speeding) g (Dangerous Speed)


0 0 0 0 45 MPH Under 45 0 0
0 0 0 1 45 MPH 46-55 1 0
0 0 1 0 45 MPH 56-65 1 1
0 0 1 1 45 MPH Over 65 1 1
0 1 0 0 55 MPH Under 45 0 0
0 1 0 1 55 MPH 46-55 0 0
0 1 1 0 55 MPH 56-65 1 0
0 1 1 1 55 MPH Over 65 1 1
1 0 0 0 65 MPH Under 45 0 0
1 0 0 1 65 MPH 46-55 0 0
1 0 1 0 65 MPH 56-65 0 0
1 0 1 1 65 MPH Over 65 1 1

<45 00

45-55 01

55-65 10

65+ 11

EE-221: Digital Logic Design Page 20

You might also like