digital logic & computer architecture practical book by yasir ahmed khan

20
QUAID-E-AWAM UNIVERSITY OF ENGINEERING SCIENCE & TECHNOLOGY NAWABSHAH DEPARTMENT OF INFORMATION TECHNOLOGY Digital Logic & Computer Architects (3 rd Term, 2 nd Year) OBJECTIVE: To Become Familiar With Basic Binary Operation. TOOL: Electronic Work Bench V 5.12 EQUIPMENT AND COMPONENTS: Logic Gates Indicator (LED) Two Switches Ground Voltage Source AND Gate: Logic Expression: A . B = Y Logic Symbol: Truth Table: Explanation: The AND gate is a logic device whose output is 1 if and only if all its inputs are 1. In other PRACTICAL # 01 INPUTS OUTPUT A B Y 0 0 0 0 1 0 1 0 0 1 1 1

Upload: yasir-khan

Post on 18-Jun-2015

1.914 views

Category:

Education


2 download

DESCRIPTION

Digital Logic & Computer Architecture Practical Book by Yasir Ahmed Khan

TRANSCRIPT

Page 1: Digital Logic & Computer Architecture Practical Book by Yasir Ahmed Khan

QUAID-E-AWAM UNIVERSITY OF ENGINEERING SCIENCE & TECHNOLOGY NAWABSHAH

DEPARTMENT OF INFORMATION TECHNOLOGY

Digital Logic & Computer Architects (3rd Term, 2nd Year)

OBJECTIVE: To Become Familiar With Basic Binary Operation.

TOOL: Electronic Work Bench V 5.12

EQUIPMENT AND COMPONENTS:

Logic Gates Indicator (LED) Two Switches Ground Voltage Source

AND Gate:

Logic Expression: A . B = Y

Logic Symbol:

Truth Table:

Explanation:

The AND gate is a logic device whose output is 1 if and only if all its inputs

are 1. In other words the output of an AND gate is 0 if any one or both its inputs are 0. It can

have two or more inputs can only one output.

It is also called an all or nothing gate, because it produces a 1 only in one case when all its

inputs are a 1. In all other cases its output is zero.

PRACTICAL # 01

INPUTS OUTPUTA B Y0 0 00 1 01 0 01 1 1

Page 2: Digital Logic & Computer Architecture Practical Book by Yasir Ahmed Khan

QUAID-E-AWAM UNIVERSITY OF ENGINEERING SCIENCE & TECHNOLOGY NAWABSHAH

DEPARTMENT OF INFORMATION TECHNOLOGY

Digital Logic & Computer Architects (3rd Term, 2nd Year)

OR Gate:

Logic Expression: A + B = Y

Logic Symbol:

Truth Table:

Explanation:

The OR gate is a logic device whose output is 1 if at least one if its input is 1.

In other words the output of an OR gate is 0 if both its inputs are 0.

It is also called any or all gate, because it produces a 1 even if one of its inputs is at 1.

It produces a 0 only when all the inputs are 0.

PRACTICAL # 01

INPUTS OUTPUTA B Y0 0 00 1 11 0 11 1 1

Page 3: Digital Logic & Computer Architecture Practical Book by Yasir Ahmed Khan

Viva Question:

Q: 1 why we use logic Gates?Ans: Logic gates are used to make logic circuits.

Q: 2 Advantages of logic gates?Ans: Logic gates are basic components of microprocessors. Without them, electronics systems couldn't run.

Q: 3 what is also called NOT gate?Ans: The NOT gate also called INVERTER.

Q: 4 Where output of AND Gate is high and low?Ans: If both inputs are high the output will be high/true/on else output of AND gate is low/false/off.

Page 4: Digital Logic & Computer Architecture Practical Book by Yasir Ahmed Khan

QUAID-E-AWAM UNIVERSITY OF ENGINEERING SCIENCE & TECHNOLOGY NAWABSHAH

DEPARTMENT OF INFORMATION TECHNOLOGY

Digital Logic & Computer Architects (3rd Term, 2nd Year)

OBJECTIVE: To implement and verify the NOR gate, NAND gate operations.

TOOL: Electronic Work Bench V 5.12

EQUIPMENT AND COMPONENTS:

Logic Gates Indicator (LED) Two Switches Ground Voltage Source

NOR Gate:

Logic Expression: ( A + B)¯ = Y

Logic Symbol:

Truth Table:

Explanation:

The NOR gate is a device whose out is 1 if and only if all inputs are at 0. In all

other cases the output is 0. The name NOR is derived from NOT-OR, because the gate

performs the same logic as OR gate followed by an inverter. It is a universal gate. It can also

be used as an inverter.

PRACTICAL # 02

INPUTS OUTPUTA B Y0 0 10 1 01 0 01 1 0

Page 5: Digital Logic & Computer Architecture Practical Book by Yasir Ahmed Khan

QUAID-E-AWAM UNIVERSITY OF ENGINEERING SCIENCE & TECHNOLOGY

NAWABSHAH

DEPARTMENT OF INFORMATION TECHNOLOGY

Digital Logic & Computer Architects (3rd Term, 2nd Year)

NAND Gate:

Logic Expression: ( A . B)¯ = Y

Logic Symbol:

Truth Table:

Explanation:

The NAND gate is a device whose output is 1 if at least one of its inputs is 0.

Thus the output is 0 when all its inputs are 1. The name NAND is derived from NOT-AND

because the gate performs the same logic as AND gate followed by an inverter. It is a

universal gate as all basic gates can be derived from it. It can also be used as an inverter.

VIVA QUESTIONSQ: 1 NOR gate is combination of?Ans: NOR gate is the combination of OR gate and NOT gate.

Q: 2 NAND gate is combination of?sAns: NAND gate is combination of AND gate and NOT gate.

Q: 3 Where output of NOR gate is high and low?Ans: If any one or both input is high the output will be low else output will high.

Q: 4 where output of NAND gate is high and low?Ans: If both input high the output will be low else output will high.

PRACTICAL # 02

INPUTS OUTPUTA B Y0 0 10 1 11 0 11 1 0

Page 6: Digital Logic & Computer Architecture Practical Book by Yasir Ahmed Khan

QUAID-E-AWAM UNIVERSITY OF ENGINEERING SCIENCE & TECHNOLOGY

NAWABSHAH

DEPARTMENT OF INFORMATION TECHNOLOGY

Digital Logic & Computer Architects (3rd Term, 2nd Year)

OBJECTIVE: To understand the operation of EX-OR & EX-NOR gates.

TOOL: Electronic Work Bench V 5.12

EQUIPMENT AND COMPONENTS:

Logic Gates Indicator (LED) Two Switches Ground Voltage Source

EX-OR Gate:

Logic Expression: F = x’y + xy’

Logic Symbol:

Truth Table:

Explanation:

If inputs are similar output of X-OR gate will be “low” (0).

If inputs are dissimilar or change than output of X-OR gate will be “High” (1).

PRACTICAL # 03

INPUTS OUTPUTX Y F0 0 00 1 11 0 11 1 0

Page 7: Digital Logic & Computer Architecture Practical Book by Yasir Ahmed Khan

EX-NOR Gate:

Logic Expression: F = x’ y ‘ . x y

Logic Symbol:

Truth Table:

Explanation:

If inputs are similar output of X-NOR gate will be “High” (1).

If inputs are dissimilar or change than output of X-OR gate will be “Low” (0).

Viva Question:

Q.01: What is operation of EX-OR gate?

ANS: If inputs are similar output of EX-OR gate will be low. If inputs are dissimilar or change than output of EX-OR gate will be high.

Q.02: What is operation of EX-NOR gate?

ANS: If inputs are similar output of EX-NOR gate will be high. If inputs are dissimilar or change than output of EX-NOR gate will be low.

INPUTS OUTPUTX Y F0 0 10 1 01 0 01 1 1

Page 8: Digital Logic & Computer Architecture Practical Book by Yasir Ahmed Khan

QUAID-E-AWAM UNIVERSITY OF ENGINEERING SCIENCE & TECHNOLOGY

NAWABSHAH

DEPARTMENT OF INFORMATION TECHNOLOGY

Digital Logic & Computer Architects (3rd Term, 2nd Year)

OBJECTIVE: To Design the circuit of the Boolean expression & verify the result through truth table.

TOOL: Electronic Work Bench V 5.12

EQUIPMENT AND COMPONENTS:

Logic Gates Indicator (LED) Two Switches Ground Voltage Source

1. F= (a.b) (b`+c)

Truth Table:

PRACTICAL # 04

S.No A B C F

0 0 0 0 0

1 0 0 1 0

2 0 1 0 0

3 0 1 1 0

4 1 0 0 0

5 1 0 1 0

6 1 1 0 0

7 1 1 1 1

Page 9: Digital Logic & Computer Architecture Practical Book by Yasir Ahmed Khan

2. F= (a`+b`) (c`+d) (d+c)

Truth Table:S:NO A B C D F

0 0 0 0 0 01 0 0 0 1 12 0 0 1 0 03 0 0 1 1 14 0 1 0 0 05 0 1 0 1 16 0 1 1 0 07 0 1 1 1 18 1 0 0 0 09 1 0 0 1 110 1 0 1 0 011 1 0 1 1 112 1 1 0 0 013 1 1 0 1 014 1 1 1 0 015 1 1 1 1 0

Page 10: Digital Logic & Computer Architecture Practical Book by Yasir Ahmed Khan

3. F= {(x`+y) `+(x+y) `+(y+z`)}

Truth Table:

S:NO X Y Z F

0 0 0 0 1

1 0 0 1 1

2 0 1 0 0

3 0 1 1 1

4 1 0 0 0

5 1 0 1 0

6 1 1 0 1

7 1 1 1 1

Page 11: Digital Logic & Computer Architecture Practical Book by Yasir Ahmed Khan

4. F= [(a+b+c) `] [(d`e)]

Truth Table:

S:NO A B C D E F0 0 0 0 0 0 01 0 0 0 0 1 02 0 0 0 1 0 03 0 0 0 1 1 04 0 0 1 0 0 05 0 0 1 0 1 16 0 0 1 1 0 07 0 0 1 1 1 08 0 1 0 0 0 09 0 1 0 0 1 110 0 1 0 1 0 011 0 1 0 1 1 012 0 1 1 0 0 013 0 1 1 0 1 114 0 1 1 1 0 015 0 1 1 1 1 0

Page 12: Digital Logic & Computer Architecture Practical Book by Yasir Ahmed Khan

QUAID-E-AWAM UNIVERSITY OF ENGINEERING SCIENCE & TECHNOLOGY

NAWABSHAH

DEPARTMENT OF INFORMATION TECHNOLOGY

Digital Logic & Computer Architects (3rd Term, 2nd Year)

OBJECTIVE: To observe the operation of logic converter.

TOOL: Electronic Work Bench V 5.12

EQUIPMENT AND COMPONENTS:

Logic Gates Indicator (LED) Two Switches Ground Voltage Source

THEORY:

The logic converter is able to perform several transformations of a circuit representation. It has no real-world counterpart. It can be attached to a circuit to derive the truth table or Boolean expression the circuit embodies, or used to produce a circuit from a truth table or

Boolean expression.

PROCEDURE:

1. First we open the electronic workbench.2. Get an OR gate. 3. Two NOT gates and tow AND gates from logic gates and one converter. 4. Connect inputs to left side of converter and output to the right side of the

converter.

PRACTICAL # 05

Page 13: Digital Logic & Computer Architecture Practical Book by Yasir Ahmed Khan

TO CONSTRUCT A TRUTH TABLE:

1. Click the number of input channels you want, from a to H, across the top of the logic converter. The display area below the terminals fills up with the necessary combinations of ones and zeros to fulfill the input conditions. The values in the output column on the right are initially set to 0.2. Edit the output column to specify the desired output for each input condition. To change an output value, select it and type a new value: 1, 0 or x. (An x indicates that either 1 or 0 is acceptable.)

To convert a truth table to a Boolean expression, click the Truth Table to Boolean Expression button.The Boolean expression will be displayed at the bottom of the logic converter.To convert a truth table to a simplified Boolean expression, or to simplify an existing Boolean expression, click the Simplify button which is shown in the figure.

RESULT:

The result is observed by the logic converters.

Page 14: Digital Logic & Computer Architecture Practical Book by Yasir Ahmed Khan

QUAID-E-AWAM UNIVERSITY OF ENGINEERING SCIENCE & TECHNOLOGY

NAWABSHAH

DEPARTMENT OF INFORMATION TECHNOLOGY

Digital Logic & Computer Architects (3rd Term, 2nd Year)

OBJECTIVE: Task 1: Design full adder circuit.

Task 2: Design a BCD to Excess-3 code converter.

TOOL: Electronic Work Bench V 5.12

EQUIPMENT AND COMPONENTS:

Logic Gates Indicator (LED) Two Switches Ground Voltage Source

THEORY:

FULL ADDER: A full adder is a combinational circuit that performs an arithmetic sum of three input bits and produces two outputs.

PRACTICAL # 06

Page 15: Digital Logic & Computer Architecture Practical Book by Yasir Ahmed Khan

BCD TO EX-3: The BCD to Ex-3 code uses four bit to represent a decimal digits there must be four input Variable.

QUAID-E-AWAM UNIVERSITY OF ENGINEERING SCIENCE & TECHNOLOGY

NAWABSHAH

Page 16: Digital Logic & Computer Architecture Practical Book by Yasir Ahmed Khan

DEPARTMENT OF INFORMATION TECHNOLOGY

Digital Logic & Computer Architects (3rd Term, 2nd Year)

OBJECTIVE: Design a combinational circuit the multiply two numbers of two bit each TOOL: Electronic Work Bench V 5.12

EQUIPMENT AND COMPONENTS:

Logic Gates Indicator (LED) Two Switches Ground Voltage Source

TRUTH TABLE:

a1 a0 b1 b0 w x y z

PRACTICAL # 07

Page 17: Digital Logic & Computer Architecture Practical Book by Yasir Ahmed Khan

0 0 0 0 0 0 0 00 0 0 1 0 0 0 00 0 1 0 0 0 0 00 0 1 1 0 0 0 00 1 0 0 0 0 0 00 1 0 1 0 0 0 10 1 1 0 0 0 1 00 1 1 1 0 0 1 11 0 0 0 0 0 0 01 0 0 1 0 0 1 01 0 1 0 0 1 0 01 0 1 1 0 1 1 01 1 0 0 0 0 0 01 1 0 1 0 0 1 11 1 1 0 0 1 1 01 1 1 1 1 0 0 1