DLD Lab 3
DLD Lab 3
DLD Lab 3
Semester:2nd SectionBSCS13E
Mehreen 46255
7
Ans-Ur-Rehman 47391
4
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
Lab Tasks:
Task No 1
5V
Logic Circuit
Left wine gear Nose gear Right wine gear Green Light Red Light
1 1 1 1 0
1 1 0 0 1
1 0 1 0 1
1 0 0 0 1
0 1 1 0 1
0 1 0 0 1
0 0 1 0 1
0 0 0 0 1
Proteus Simulation:
Practical Circuits:
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:
S1 S2 S3 output
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 Simulation:
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.
Speed limit:
Speed limit of the car is such that where it is 00 it says 45 MPH, 01 says 55 MPH and 10 says 65
MPH, and 11 says nothing.
Speed of Vehicle:
Speed of the vehicle is such that 00 is when its less than 45 MPH, 01 is when its in between 46
and 55 MPH, 10 is when its in between 56 and 65 and 11 is when its greater than 65 MPH.
f:
It indicates whether the car is going above speed limit or not 1 for yes and 0 for no.
g:
It indicates that the car is driving at “dangerous speed” 1 for yes and 0 for no.
00 00 0 0
00 01 1 0
00 10 1 1
00 11 1 1
01 00 0 0
01 01 0 0
01 10 1 0
01 11 1 1
10 00 0 0
10 01 0 0
10 10 0 0
10 11 1 1
11 00 - -
11 01 - -
11 10 - -
11 11 - -