Digital Logic Design
Digital Logic Design
________________________________________________________________________________________________
Digital Logic Design
Federal Urdu University of Arts Science & Technology Islamabad Electrical Engineering
Name: ____________________________________________
Semester: _________________________________________
Batch: ____________________________________________
________________________________________________________________________________________________
Digital Logic Design
Federal Urdu University of Arts Science & Technology Islamabad Electrical Engineering
C
COON
NTTE
ENNT
TSS
2
To demonstrate Diode Logic AND and OR gate
3
Verification of truth table of AND, OR, NOT,NOR, NAND logic gates
4 Implementation of multivariable Boolean expression using logic gates & Verification
of Demorgans Theorem
5
Implementation of 7 segment using EXCESS-3 code, Implementation of Gray code
6 Implementation of half adder & full adder
13
RS Flip-Flop
14
JK Flip-Flop
15
Shift Register
16 Binary Counter
________________________________________________________________________________________________
Digital Logic Design
Federal Urdu University of Arts Science & Technology Islamabad Electrical Engineering
EXPERIMENT NO: 1
ETS-5000 Logic Trainer is a device which is used to study interaction of different logic and universal gates.
Section A comprises of POWER SWITCH it is top left side of trainer. The function of this switch is to use OFF
or ON the power.
Section B comprises of DC POWER. It consists of Voltage Section one port is of +5V, the other is for ground
connection and the third is of -5V.
Section C consists of PULSE GENERATOR. It can be generate a pulse of 1 second, 0.1 second and 0.01
second.
________________________________________________________________________________________________
Digital Logic Design
Federal Urdu University of Arts Science & Technology Islamabad Electrical Engineering
Section F consists of SOLDER LESS BREADBOARD OR PROTO BOARD It is consisting of so many holes.
Section G consists of DATA SWITCHES. There are Eight Data Switches in this trainer.
Section H consists of 8 BIT LED OUTPUT INDICATOR. The bulb in this section glows (Red) when there is logic 1
and (Green) when there is logic 0.
Section I consists of MODE SELECTOR. It is used to set the mode on TTL & on CMOS.
________________________________________________________________________________________________
Digital Logic Design
Federal Urdu University of Arts Science & Technology Islamabad Electrical Engineering
EXPERIMENT NO-2
APPARATUS
Bread board, Power Supply, Multimeter, Resistor 2.2K, Diode IN 4001, Connecting leads
PROCEDURE
Table-1
Input Output
A B Y
0V 0V
0V 5V
5V 0V
5V 5V
________________________________________________________________________________________________
Digital Logic Design
Federal Urdu University of Arts Science & Technology Islamabad Electrical Engineering
PROCEDURE
OBSERVATIONS OF OR GATE
Table-2
Input Output
A B Y
0V 0V
0V 5V
5V 0V
5V 5V
________________________________________________________________________________________________
Digital Logic Design
Federal Urdu University of Arts Science & Technology Islamabad Electrical Engineering
EXPERIMENT NO: 3
VERIFICATION OF TRUTH TABLE OF AND, OR, NOT, NAND AND NOR LOGIC GATES.
APPARATUS:
AND (7408), OR (7432), NOT (7404), NAND (7400), NOR (7402 ICs
+Vcc
1 14
Truth Table of AND Gates
2 13
Inputs Output
1
3 12 A B Y
4
7408
4 11 0 0
5 10 0 1
2
6 9
1 0
3
7 8
Ground 1 1
+Vcc
4
4 11
0 1
5 10
1 0
2
6 9
3 1 1
7 8
Ground
________________________________________________________________________________________________
Digital Logic Design
Federal Urdu University of Arts Science & Technology Islamabad Electrical Engineering
+Vcc
2 13 A Y
6
3
7404 12 0
2
4 11 1
5
5 10
3
6 9
4
7 8
Ground
+Vcc
4 0 0
7400
4 11
5 10 0 1
2
6 9
1 0
3
7 8
Ground 1 1
+Vcc
4 11
2 0 1
5 10
3
1 0
6 9
7 8 1 1
Ground
________________________________________________________________________________________________
Digital Logic Design
Federal Urdu University of Arts Science & Technology Islamabad Electrical Engineering
EXPERIMENT NO: 4
APPARATUS:
F2 = (a + b+ c) (a + b)
a b c
a.b'.c
a'.b.c
a+b
a+b+c'
F2 = (a+b+c) (a'+b)
a'+b To LED
Now we shall check the logic circuit by the following Truth Table.
________________________________________________________________________________________________
Digital Logic Design
Federal Urdu University of Arts Science & Technology Islamabad Electrical Engineering
TRUTH TABLE
Outputs
Inputs F1 F2
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
Comments: __________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
________________________________________________________________________________________________
Digital Logic Design
Federal Urdu University of Arts Science & Technology Islamabad Electrical Engineering
DEMORGANS THEOREM
APPARATUS:
1. (x+y+z) = x.y.z
where let F1 = (x+y+z) & F2 = x.y.z
2. (x.y.z) = x+y+z
Where let F3 = (x.y.z) F4 = x+y+z
x y z
x'
x'.y'
y' F2 = x'.y'.z'
(To LED)
z'
x
x+y
y x+y+z F1 = (x+y+z)'
(To LED)
z
x'
x'+y'
y' F4 = x'+y'+z'
(To LED)
z'
x
x.y
y F3 = (x.y.z)'
(To LED)
z
Truth Table
Inputs Outputs
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
Comments: __________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
________________________________________________________________________________________________
Digital Logic Design
Federal Urdu University of Arts Science & Technology Islamabad Electrical Engineering
EXPERIMENT NO: 5
IMPLEMENTATION OF 7 SEGMENT USING EXCESS-3 CODE, IMPLEMENTATION OF GRAY CODE
APPARATUS:
1. IC 7404(NOT)
2. 7408(AND)
3. 7432(OR)
4. 7446 / 7447 (BCD TO 7-SEGMENT DECODER)
PROCEDURE:
1. In the case of BCD to Excess-3 code conversion, the inputs A, B, C and D are given at a respective
pin and outputs W, X, Y, and Z are taken for all the 10 combinations of the input.
TABLE:
Truth table for BCD to-Excess 3 Code
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
W = AB CD + AB C D + AB C D + A BCD + A BCD
________________________________________________________________________________________________
Digital Logic Design
Federal Urdu University of Arts Science & Technology Islamabad Electrical Engineering
________________________________________________________________________________________________
Digital Logic Design
Federal Urdu University of Arts Science & Technology Islamabad Electrical Engineering
Boolean Functions
Now writing Boolean functions from above k-maps for outputs of BCD to Excess 3 code converter, we get.
Z = D
Y = CD + CD
= CD + (C+D)
X = BC + BD + BCD
= B(C + D) + BCD
= B(C+D) + B(C+D)
W = A + BC +BD
= A + B(C + D)
IMPLEMENTATION
A 7-Segment LED Display is composed of seven segments, Figure 1. Each segment is a LED. They are combined to produce
standardized representations of the decimal Arabic numbers.
An Integrated Circuit (IC) chip, BCD to 7-Segment Decoder (7446/7447), is used to convert the four binary Inputs A to D to seven
Outputs, which drive the 7-Segment LED Display. BCD means Binary Coded Decimal. Table 1 shows the relation between the binary
Inputs, Decoder Outputs and decimal numbers 0 to 9. Figure 2 is the diagram of a display module with a BCD to 7-Segment Decoder
and a 7 Segment-LED Display.
________________________________________________________________________________________________
Digital Logic Design
Federal Urdu University of Arts Science & Technology Islamabad Electrical Engineering
0 0 0 0
0 0 0 1
0 0 1 0
0 0 1 1
0 1 0 0
0 1 0 1
0 1 1 0
0 1 1 1
1 0 0 0
1 0 0 1
________________________________________________________________________________________________
Digital Logic Design
Federal Urdu University of Arts Science & Technology Islamabad Electrical Engineering
IC 7486, etc
PROCEDURE: -
________________________________________________________________________________________________
Digital Logic Design
Federal Urdu University of Arts Science & Technology Islamabad Electrical Engineering
IMPLEMENTATION
B0
B0 G0
G0 B1
B1 G1
G1 B2
B2 G2
G2 B3
B3 G3
G3
Table:
Truth table for Gray Code
________________________________________________________________________________________________
Digital Logic Design
Federal Urdu University of Arts Science & Technology Islamabad Electrical Engineering
EXPERIMENT NO: 6
IMPLEMENTATION OF HALF ADDER & FULL ADDER
APPARATUS:
7486, 7432, 7408, 7404 ICs, logic kit and connecting leads.
HALF ADDER:
Half Adder is combinational logic circuit that generates the sum of two binary numbers (each having 1 bit
length). The logic circuit has two inputs and two outputs i.e. Sum & Carry abbreviated as SHA & CHA
respectively.
First of all, we shall construct Truth Table of Half Adder
Truth Table
Inputs Outputs
SHA = xy+xy CHA = x y
x y Actual Observed Actual Observed
0 0
0 1
1 0
1 1
Now we shall check this logic circuit by the Truth Table of Half Adder.
Lab Exercise:
1. Students are required to write outputs of Full adder using Basic logic gates..
________________________________________________________________________________________________
Digital Logic Design
Federal Urdu University of Arts Science & Technology Islamabad Electrical Engineering
Truth Table
Inputs Outputs
x y z SFA CFA
Actual Observed Actual Observed
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
Now we write Boolean expression for Sum and Carry of Full Adder.
1) Sum = xyz+xyz+xyz+xyz
CFA = (x y) z + xy
________________________________________________________________________________________________
Digital Logic Design
Federal Urdu University of Arts Science & Technology Islamabad Electrical Engineering
Implementation
x y z
HA1 HA2
SFA = (x + y) + z
To LED
CFA = (x + y) z + xy
To LED
We shall check this logic circuit by the Truth Table of Full Adder
________________________________________________________________________________________________
Digital Logic Design
Federal Urdu University of Arts Science & Technology Islamabad Electrical Engineering
EXPERIMENT NO: 7
APPARATUS:
7432, 7408, 7404 ICs logic kit and connecting leads
DECODER:
n 2n.
n = No. of input lines.
2n = No. of outputs of a Decoder.
Decoder is a circuit that convert binary information from n-input lines to max of 2n output
lines e.g. if we have 2 inputs i.e. x,y then there will be 4 output of a Decoder and size of
Decoder will be 2X4.
d0
output lines
x
2X4 d1
y DECODER d2
d3
0 0 1 1 0 0 0
0 1 1 0 1 0 0
1 0 1 0 0 1 0
1 1 1 0 0 0 1
Boolean Functions for 2 x 4 Decoder
do = E x y
d1 = E xy
d2 = E x y
d3 = E x y
________________________________________________________________________________________________
Digital Logic Design
Federal Urdu University of Arts Science & Technology Islamabad Electrical Engineering
IMPLEMENTATION
x y
x' y'
d0 = x' y'
(To LED)
d1 = x' y
(To LED)
d2 = x y'
(To LED)
d3 = x y
(To LED)
E
Now we check this logic circuit by using Truth Tables of 2X4 Decoder as drawn above.
________________________________________________________________________________________________
Digital Logic Design
Federal Urdu University of Arts Science & Technology Islamabad Electrical Engineering
EXPERIMENT NO: 8
ENCODER:
Encoders work in exactly the opposite way as decoders, taking 2n inputs, and having n outputs. When a bit comes in on an
input wire, the encoder outputs the physical address of that wire. It takes 2n inputs and gives out n outputs; the enable pin should be
kept 1 for enabling the circuit.
n 2n .
n = No. of output lines.
2n = No. of input of a Decoder.
x = d0 d1 d2 d3 + d0 d1 d2 d3
y = d0 d1 d2 d3 + d0 d1 d2 d3
________________________________________________________________________________________________
Digital Logic Design
Federal Urdu University of Arts Science & Technology Islamabad Electrical Engineering
Implementation
Now we check this logic circuit by using Truth Tables of 4 to 2 Encoder as drawn above.
________________________________________________________________________________________________
Digital Logic Design
Federal Urdu University of Arts Science & Technology Islamabad Electrical Engineering
EXPERIMENT NO: 9
APPARATUS:
7432, 7408, 7404 logic kit and connecting wires
MULTIPLEXER
Multiplexer, simply called MUX, is a data selector and is capable of selecting one of
many input lines (usually 2n) and display its input status on the only output line available.
A MUX has
1) Select lines
2) Data input lines
3) Output line.
BLOCK DIAGRAM OF 2X1 MUX
I0
data i/p lines 2X1 MUX Y
I1 output
select line
Y = I1 s + I0 s
________________________________________________________________________________________________
Digital Logic Design
Federal Urdu University of Arts Science & Technology Islamabad Electrical Engineering
I1 s I0
I1 s
I1 s + I0 s' = Y
To LED
s'
I0 s'
I0
I1 4X1 MUX Y
data i/p lines
I2 output
I3
S1 S0
select lines
Y = I0 S1 S0 + I1 S1 S0 + I2 S1 S0 + I3 S1 S0
________________________________________________________________________________________________
Digital Logic Design
Federal Urdu University of Arts Science & Technology Islamabad Electrical Engineering
S1 S0
I0
I0
I1 I1
Y
To LED
I2 I2
I3 I3
We check this logic circuit by Function Table of 4X1 MUX as drawn above.
________________________________________________________________________________________________
Digital Logic Design
Federal Urdu University of Arts Science & Technology Islamabad Electrical Engineering
EXPERIMENT NO: 10
APPARATUS:
MUX :
2n 1.
n = No. of select lines.
2n = No. of inputs of MUX
if n = 3, size of MUX is 8x1 i.e.
I0
I1
I2
Data input lines
I3 8X1 MUX
I4 Y
output
I5
I6
I7
x y z
select lines
FUNCTION TABLE
Select lines Output
x y z Y
0 0 0 Io
0 0 1 I1
0 1 0 I2
0 1 1 I3
1 0 0 I4
1 0 1 I5
1 1 0 I6
1 1 1 I7
________________________________________________________________________________________________
Digital Logic Design
Federal Urdu University of Arts Science & Technology Islamabad Electrical Engineering
1 16
I3 VCC
2 I2 15
Data i/p
I4
lines
Data i/p
3 14
I1 I5
lines
74LS151
4 13
I0 I6
12
o/p lines
5
Y I7
6 11
x
Data select
W
lines
7 10
E y
8
GND z 9
PROCEDURE:
First of all we check / implement Carry of Full Adder (having 3 inputs) using 8X1 MUX, for
this take: I0 = 0, I1 = 0, I2 = 0, I3 = 1, I4 = 0, I5 = 1, I6 = 1, I7 = 1, from Carry column of Truth
table of Full Adder and then select x,y,z from Function table of 8X1 MUX and then observe
outputs at Y Pin of 74151 IC, that should be equal to Carry of Full Adder for combination of
x,y,z at select lines, which is inserted through data switches, this step is repeated for all
x,y,z combinations, at select lines to observe Carry of Full Adder.
Then we check/implement Sum of Full Adder for 3 input variables, using 8X1 MUX for this,
we take: I0 = 0, I1 = 1, I2 = 1, I3 = 0, I4 = 1, I5 = 0, I6 = 0, I7 = 1, from Sum column of Truth
Table of Full Adder, as data inputs to 8X1 MUX, and then for each combination of x,y,z at
select lines from Function table,. We see output at Y Pin of 74151 IC, which should be
equal to value of Sum of Full Adder for x,y,z combination at select lines, which is inserted
through data switches, this step is repeated for all x,y,z combinations, at select lines to
observe Sum of Full Adder.
________________________________________________________________________________________________
Digital Logic Design
Federal Urdu University of Arts Science & Technology Islamabad Electrical Engineering
0 0 0 0 0
0 0 1 1 0
0 1 0 1 0
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
0 0 0 0 0 I0
0 0 1 1 0 I1
0 1 0 1 0 I2
0 1 1 0 1 I3
1 0 0 1 0 I4
1 0 1 0 1 I5
1 1 0 0 1 I6
1 1 1 1 1 I7
________________________________________________________________________________________________
Digital Logic Design
Federal Urdu University of Arts Science & Technology Islamabad Electrical Engineering
EXPERIMENT NO: 11
DESIGNING AND IMPLEMENTING DE-MULTIPLEXER
A DEMUX is a digital switch with a single input (source) and a multiple outputs (destinations).the select lines
determine which output the input is connected to.
Select lines
Output
S1 S0
0 0 Do
0 1 D1
1 0 D2
1 1 D3
.
THE BOOLEAN FUNCTION FOR 1X4 DE- MUX IS
D0 = A S1 S0
D1 = A S1 S0
D2 = A S1 S0
D3 = A S1 S0
________________________________________________________________________________________________
Digital Logic Design
Federal Urdu University of Arts Science & Technology Islamabad Electrical Engineering
________________________________________________________________________________________________
Digital Logic Design
Federal Urdu University of Arts Science & Technology Islamabad Electrical Engineering
EXPERIMENT NO :12
APPARATUS:
7486, 7432, 7408, 7404 logic kit and connecting wires.
ONE BIT MAGNITUDE COMPARATOR
One Bit Magnitude Comparator is combination logic circuit which is used to compare two input binary
numbers (each having one bit length) to check weather two inputs are equal or one less than other or greater
then.
x' y'
xy
E=(x y+x' y')
(To LED)
x' y'
G=x y'
(To LED)
L = x' y
(To LED)
________________________________________________________________________________________________
Digital Logic Design
Federal Urdu University of Arts Science & Technology Islamabad Electrical Engineering
To check this logic circuit, we shall use the above Truth Table
Truth Table
Inputs Outputs
A B
A1 A0 B1 B0 E
A=B G
A>B L
A<B
0 0 0 0 1 0 0
0 0 0 1 0 0 1
0 0 1 0 0 0 1
0 0 1 1 0 0 1
0 1 0 0 0 1 0
0 1 0 1 1 0 0
0 1 1 0 0 0 1
0 1 1 1 0 0 1
1 0 0 0 0 1 0
1 0 0 1 0 1 0
1 0 1 0 1 0 0
1 0 1 1 0 0 1
1 1 0 0 0 1 0
1 1 0 1 0 1 0
1 1 1 0 0 1 0
1 1 1 1 1 0 0
Now we simplify outputs of 2 Bit Magnitude Comparator by k-map technique.
k-map of E.
E B1B0
A1 A0 00 01 11 10
00 1
01 1
11 1
10 1
________________________________________________________________________________________________
Digital Logic Design
Federal Urdu University of Arts Science & Technology Islamabad Electrical Engineering
k-map of G
G B1B0
A1A0 00 01 11 10
00
01 1
11 1 1 1
10 1 1
k-map of L.
L B1B0
A1 A0 00 01 11 10
00 1 1 1
01 1 1
11
10 1
BOOLEAN FUNCTIONS
Now writing Boolean functions from above k-maps for outputs of two Bit Magnitude Comparator, we get.
E = A1 A0 B1 B0+ A1 A0 B1 B0 + A1 A0 B1 B0+ A1 A0 B1 B0
E = A1 B1(A0 B0+ A0 B0) + A1 B1(A0 B0+ A0 B0)
E = (A0 B0+ A0 B0) (A1 B1+ A1 B1)
G = A1B1 + A1 A0 B1 B0 + A1 A0 B1 B0
G = A1B1 + A0 B0 (A1B1 + A1 B1)
________________________________________________________________________________________________
Digital Logic Design
Federal Urdu University of Arts Science & Technology Islamabad Electrical Engineering
IMPLEMENTATION
A1 A0 B1 B0
We check this circuit by Truth Table of 2 Bit Magnitude Comparator as written before.
________________________________________________________________________________________________
Digital Logic Design
Federal Urdu University of Arts Science & Technology Islamabad Electrical Engineering
EXPERIMENT NO: 13
RS FLIP-FLOP
THEORY
________________________________________________________________________________________________
Digital Logic Design
Federal Urdu University of Arts Science & Technology Islamabad Electrical Engineering
PROCEDURE
________________________________________________________________________________________________
Digital Logic Design
Federal Urdu University of Arts Science & Technology Islamabad Electrical Engineering
Table-1
INPUT OUTPUT
R S Q Q
0 0
0 1
1 0
1 1
Remark:
________________________________________________________________________________________________
Digital Logic Design
Federal Urdu University of Arts Science & Technology Islamabad Electrical Engineering
EXPERIMENT NO: 14
JK FLIP-FLOP
THEORY
________________________________________________________________________________________________
Digital Logic Design
Federal Urdu University of Arts Science & Technology Islamabad Electrical Engineering
ACT OF JK FLIP-FLOP
DEMERIT OF JK FLIP-FLOP
________________________________________________________________________________________________
Digital Logic Design
Federal Urdu University of Arts Science & Technology Islamabad Electrical Engineering
PROCEDURE
Table-2
INPUT OUTPUT
J K CLK Q Q
0 0
0 1
1 0
1 1
________________________________________________________________________________________________
Digital Logic Design
Federal Urdu University of Arts Science & Technology Islamabad Electrical Engineering
EXPERIMENT NO: 15
SHIFT REGISTER
________________________________________________________________________________________________
Digital Logic Design
Federal Urdu University of Arts Science & Technology Islamabad Electrical Engineering
________________________________________________________________________________________________
Digital Logic Design
Federal Urdu University of Arts Science & Technology Islamabad Electrical Engineering
________________________________________________________________________________________________
Digital Logic Design
Federal Urdu University of Arts Science & Technology Islamabad Electrical Engineering
________________________________________________________________________________________________
Digital Logic Design
Federal Urdu University of Arts Science & Technology Islamabad Electrical Engineering
EXPERIMENT NO: 16
BINARY COUNTER
THEORY
BINARY RIPPLE COUNTER
________________________________________________________________________________________________
Digital Logic Design
Federal Urdu University of Arts Science & Technology Islamabad Electrical Engineering
________________________________________________________________________________________________
Digital Logic Design
Federal Urdu University of Arts Science & Technology Islamabad Electrical Engineering
________________________________________________________________________________________________
Digital Logic Design
Federal Urdu University of Arts Science & Technology Islamabad Electrical Engineering
PROCEDURE:
________________________________________________________________________________________________
Digital Logic Design
Federal Urdu University of Arts Science & Technology Islamabad Electrical Engineering
________________________________________________________________________________________________
Digital Logic Design
Federal Urdu University of Arts Science & Technology Islamabad Electrical Engineering
________________________________________________________________________________________________
Digital Logic Design
Federal Urdu University of Arts Science & Technology Islamabad Electrical Engineering
USEFUL ICs
THEORY:
IC Family Summary: Various families of logic ICs exist on the market however the families, mainly used in digital electronics lab are
the TTL and the high speed CMOS families.
Nomenclature of digital ICs:
MM74XXXNNRP
MM - Manufacturer
74/54 - Temperature range
XXX - Technology type
NNN - Logic Function
R - Revision
RP - Package Type
Manufacturer - MM
SN - Texas Instrument, Motorola
DM - National Semiconductor
Temperature Range 74 or 54
74 - Standard (commercial) 0 to 70C
54 - Military -55 to 125C
Technology Type XXX
LS Low power schottky
ALS Advanced low power schottky
Fv -- Fast TTL
HC -- high speed CMOS
C -- Low speed CMOS
Vcc It is supply voltage which operate any instrument without damaged. Vcc terminal is always Red.
Ground It is zero potential point, GND terminal is always black.
7400(NAND) 7402(NOR)
________________________________________________________________________________________________
Digital Logic Design
Federal Urdu University of Arts Science & Technology Islamabad Electrical Engineering
7410(3-I/P NAND)
7432(OR)
________________________________________________________________________________________________
Digital Logic Design
Federal Urdu University of Arts Science & Technology Islamabad Electrical Engineering
7476
7486(EX-OR)
7485
________________________________________________________________________________________________
Digital Logic Design