Docsity

Lab manual Digital Logic Design and Programming, Slides of Digital Logic Design and Programming

Partial preview of the text

Download Lab manual Digital Logic Design and Programming and more Slides Digital Logic Design and Programming in PDF only on Docsity!

Department of Electrical

Engineering

King Fahd University of Petroleum and Minerals

Dhahran - Saudi Arabia

Laboratory Manual

EE 200 Digital Design

August 2003

University of Hafr Al Batin

PREFACE

This document has been prepared to serve as a laboratory manual for EE 200 Digital Design course for electrical engineering students. The manual consists of a set of experiments designed to allow students to build, and verify digital circuits and systems. This set of experiments cover relevant topics prescribed in the syllabus and are designed to reinforce the theoretical concepts taught in the classroom with practical experience in the lab. By the end of the course, students are expected to have a good understanding of digital logic design and implementation with SSI and MSI devices.

EE-200 DIGITAL LOGIC DESIGN INTRODUCTION

LAB GUIDELINES

PRE-LAB

Each student will do his own pre-lab. It is intended in this course to increase the student’s utilization of PC; therefore, the pre-lab write up must be typed. This same write up should be modified to be submitted as the Lab report.

Starting from Lab 3, all pre-lab must be done using LogicWorks simulation package. During the Lab, each student may be asked about the simulation results. All circuit parts with pin numbers should be included in the pre-lab so that you will be ready to start connecting the hardware in the lab. Try to investigate all possible changes on the circuit to acquire full knowledge about your design. All questions in the Lab handout should be answered based on the LogicWorks results. The pre-lab will make 35% of the total grade of the Lab experiment.

THE LAB

During the lab, the students should work as a group. The Pre-Lab results from each student in the group will compared and the circuit the produces the best results will be implemented using hardware parts. Elaborate on your conclusion about the observations about the simulated and obtained results. Punctuality of attendance to the Lab is worth 5% and the active participation on the experiment will count as 30% of the total grade.

THE LAB REPORT

Each student should have his own report. The lab reports are intended to serve two equally important purposes. First, they indicate your technical comprehension of the topics addressed in the labs, and second, they indicate your ability to present and discuss your results in a clear and concise manner. You will be graded on both aspects of your report.

The suggested format for your lab report is given below.

  1. Objectives: State clearly what you set out to achieve in this lab. If this differs from what you finally achieved, explain it in the "Conclusions" section. Please do not copy the objectives verbatim from the lab handout. Think about it, interpret it, and explain it the best you can, in your own words.
  2. Parts: List all the parts you used in the design.
  3. Design and Test Procedure: For each subsection of the lab, explain the following:

(a) Step-by-step description of what you did. Include as many details as possible, and once again, write it in your own words.

(b) All necessary calculations as well as all pin-to-pin circuit diagrams of your design. Please make sure your figures are consistent, legible and well labeled.

(c) Your testing procedure. Explain how you went about testing your design. Did you try testing critical individual blocks first?

  1. Results and Answers to Questions: For each subsection of the lab, present your results in a clear and concise manner (label graph axes, include all units of measurement). Note down all your observations, even if you were not specifically asked for them in the handout. Interpret your results and discuss the accuracy of your measurements. Additionally, answer all questions listed in the lab handout.
  2. Conclusions : In this section you should attempt to answer the questions: What did you learn from this lab? What did you do wrong (or what went wrong)? How could you have improved upon your design and test procedures? Were your results as expected or did you find something unusual. Try not to include information that you have included in previous sections. Present the significance of your results conceptually, if applicable, (e.g. The CAD tool does not capture the glitching behavior accurately.)

The Lab Report will count as 30% of the grade and is due at the beginning of the subsequent lab experiment.

the eight-pole switch, there are two single pole, double throw (SPDT) switches provided for general switching functions.

  • Potentiometers: Two potentiometers are provided on the PB-503. The resistance values chosen (1 K and 10 K ohms) may be used in common circuit applications.
  • BNC Connectors: The PB-503 may be connected to other pieces of equipment via two BNC connectors BNC J1 and BNC J2. These allow the use of shielded cable to minimize noise and interference.

Fig.1 PB-503 Panel layout.

IC PIN CONNECTIONs: The IC type 7493 is in a 14-pin dual in-line case. The base pins progress in a counter- clockwise direction as seen from the side away from the pins, as shown Fig 2. Pin 1 is located by an identifying symbol, or the location of pins 1 and 14 are identified by an index notch at the end of the case where pins 1 and 14 are located.

Fig.2 IC pin location, 14 pin dual-in-line (TO-116) case

PROCEDURE :

14 13 12 11 10 9 8

1 2 3 4 5 6 7

Index notch

Top view away from pins

THE PB-

  1. Connect the PB-503 line cord into the AC power supply and turn on the power switch.
  2. Connect the LOGIC INDICATORS (lamp monitor) (1, 2, …,8) to +5 volts. The lamps monitors should light when connected +5 volts and this “ON” lamp condition will represent a “l” logic level in your experiments.
  3. Now connect the lamp monitors to ground. They should all be off at this time. This “OFF”: lamp condition will represent a “0” logic level in your experiments.
  4. Connect one side of a resistor (20 ohms, to 100 K) to ground and the other side to DIP switch S1-1 and switch the 5 V/GND switch to 5 volts position (These steps are already done for you). Connect S1-1 to LED-1. Now, when the S1-1 is pushed up to the closed position LED-1 will light, and when the S1-1 is brought back to the open position the LED will be off. Repeat these steps for S1-2 through S1- and observe the resultant condition of the lamp monitors.

Switch position lamp logic level

CLOSED ON 1

OPEN OFF 0

The switches can, thus, be used to supply logic level inputs to experimental circuits.

  1. PULSER BUTTONS. Connect one side of a resistor (20 ohms, to 100 K) to + volts and the other side to PB1-1, the NC point. Then connect PB1-1 (the other lead of NC point) to LED-1. The LED should light when PB1 is pressed and extinguish when PB1 is released. Next, move the connections from PB1-1 to PB1-2, the NO point. Now the LED should be lit when PB1 is not pressed and go off when PB1 is pressed. Repeat these steps for PB2. These buttons will be used to enter momentary pulses of “O” and “1” logic levels.
  2. Single Pole, Double Throw (SPDT) switches. Connect one side of a resistor ( ohms, to 100 K) to +5 volts and the other side to lead 1 of S2. Then connect lead 2 to LED-1 and Lead 3 to LED-2. When the switch is brought to the up position then LED-1 and LED-2 will be ON and when the switch is brought down, the two LED’s will be off. Repeat these steps on S3. These switches are provided for general switching functions.
  3. CLOCK output. Connect the FUNCTION GENERATOR output TTL to LED-
    1. Set the function generator to “times 1” position and move the frequency control all the way to the top. Set the frequency selector to Hz. LED-1 should flash on and off, alternately at about 1 cycle per second. Move the function generator to “times 10” position (setting the frequency to 10 Hz). The lamp monitors should flash on and off at a faster rate, too high to count. Higher frequency settings “times 100” should cause the lamps to appear to be on continuously, at about half-normal brilliance
  4. Connect the FUNCTION GENERATOR output TTL to an oscilloscope. You should observe a square wave having fairly steep sides and a peak-to-peak

EE 200 DIGITAL LOGIC DESIGN EXPERIMENT #

BINARY AND DECIMAL NUMBERS

OBJECTIVE :

  • To demonstrate the count sequence of binary number and the binary-coded decimal (BCD) representation.

APPARATUS :

  • IC type 7493 4-bit ripple counter

BINARY COUNT

  1. Turn off the power switch.
  2. Connect the IC type 7493 as shown in Fig. 3 Pin 14 is connected to PB1.
  3. Turn the power on and observe the four indicator lamps. The 4-bit number in the out is incremented by one for every pulse generated by pushing the pulser button PB
  4. Disconnect the input of the counter at pin 14 from PB1 and connect it to the FUNCTION GENERATOR (lead TTL).
  5. Set frequency selector to “time 1” (1 Hz). This will provide an automatic binary count.

THE BCD COUNT

  1. Turn off the power switch.
  2. Connect the IC type 7493 as shown in Fig.4 Pin 14 is connected to PB1.
  3. Turn the power on and observe the four indicator lamps. The 4-bit number in the lambs is incremented by one for every pulse generated by pushing the pulser button PB1 following the sequence 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, ….
  4. Disconnect the input of the counter at pin 14 from PB1 and connect it to TTL. Set frequency selector to “time 1” (1 Hz). This will provide an automatic binary count.

QA

QB

QC QD

9

8

11

10

14

1

2

(^3) R (^2)

R (^1)

A

B

12

Push button Pulser or clock

5 V

IC# 7493

QA

QB

QC QD

9

8

11

10

14

1

2

(^3) R (^2)

R (^1)

A

B

12

Push button Pulser or clock

5 V

IC# 7493

Fig.3 Binary Counter (^) Fig.4 BCD counter

Truth Table Representation of the output logic levels of a logic circuit for every possible combination of levels of the inputs. This is best done by means of a systematic tabulation.

a. Two input AND gate (^) b. Two input OR gate c. Inverter

d. Two input NAND gate e. Two input NOR gate f. Two input XOR gate

Fig.1 Symbols for digital logic gates

Part 1: Logic Functions

I. AND, OR, NAND, and NOR gates.

  1. Use one gate for each IC 7400 (NAND), 7402 (NOR), 7408 (AND), 7432 (OR), 7486 (XOR). Each has input pins, 1 and 2, and output pin 3.
  2. Connect pin 1 to switch S1-1, pin 2 to switch S1-2, and pin 3 to LED- for every gate as shown in Fig 2 as an example for the NAND gate.

Fig.2 Two input NAND gate

  1. Using logic switches S1-1 and S-2, apply the logic levels 0 and 1 to gate inputs (pin 1, pin 2), in the sequence shown in table 1. Record the output logic levels (see lamp LED-1) in table 1. Repeat the recordings for each gate.

Remember: Lamp ON = Logic 1, (High) Lamp OFF = Logic 0 (Low)

LED-

S1-

S1-

1 2

3

Table 1 Pin 1 Pin 2 Pin 3

  1. Use an inverter gate from IC 7404 whose input pin is pin 1 and whose output pin is pin 2.

S1-1 (^1 2) LED -

Fig.3 Inverter gate

  1. Using logic switches S1-1, apply the logic levels 0 and 1 in the sequence shown in table 2. Record the output logic levels in table 2

Table 2. Pin 1 Pin 2 0 1

Part-2: Response of Logic Gates:

Connect the circuits of figures 4 and 5 and write the corresponding truth tables 3 and 4, respectively.

A B

E

C

D

A

B C

D

Fig. 4 Fig. 5

Part 4: Review Questions:

  1. Write a truth table for each circuit. Derive Boolean expressions for all outputs.

Y

X

X X

X X

Y

X

X X

Y

Y

Y

Y

X X

  1. A burglar alarm for a car has a normally low switch on each of four doors. If any door is opened the output of that switch goes HIGH. The alarm is set off with an active-LOW output signal. What type of gate will provide this logic? Support your answer with an explanation.

EE 200 DIGITAL LOGIC CIRCUIT DESIGN EXPERIMENT

INTRODUCTION TO LOGICWORKS (Handouts will be given to students)

VI. Position the OR gate near the center of the circuit window and click the mouse button. VII. Press the spacebar to return to point mode. VIII. Move again to the Parts Palette and type on the Filter “switch” or part of the word switch e.g. “sw”. IX. Select Binary switch and connect it to an input of the OR gate in the design window. (If you want to move the binary switch around, press the shift key while moving it). X. Move again to the Parts Palette and select ground to be connected to the other input of the OR gate. XI. Using the same method get a Binary Probe and connect it to the output of the OR gate XII. Click on the binary switch to change it between 0 and 1 and notice how the rule A+0 = A is satisfied.

In the lab connect the circuit as shown in the figure using the switch S1- 1 and LED-1 to verify the rule.

1 0

(^1 ) 2

Vo

Fig.1 Verifying Rule 1

b. Connect the circuit of Fig.2 Using LogicWorks. Which rule does this circuit illustrate?

3

1

2

0

0

(^1) Vo

Fig. In the lab connect the circuit as shown in the figure using the switch S1- 1 and LED-1 to verify the rule.

c. Design a circuit that illustrates rule 10. Use clock generator of the PB- 503 for A and one of the logic switches of S1 for B. Copy the circuit from LogicWorks and paste it in your lab report. d. Rule 6 illustrates that A+A’ could be replaced with a wire to Vcc. What does rule 8 illustrate? e. Rule 11 states that A+A’B = A+B. Using LogicWorks design a circuit that illustrates each of these expressions.

A+A’B A+B

Prove that these two circuits perform equivalent logic. (Connect two circuits and show that their outputs are the same).

Procedure 2: Demorgan’s Theorem

Proof of equation (1)

Using LogicWorks construct the two circuits given in Figs.3 and 4 corresponding to the functions A’. B’and (A+B)’ respectively.

Show that for all combinations of A and B, the two circuits give identical results.

3

1

2

A

B B'

A'.B' 4 5

6

8

13

12

11

A'

10

9

A

B

(^21)

3 (A+B)'

0

1

0

1

0

1

0

1

0 1

Fig.3 Fig.

Proof of equation (2)

Using LogicWorks construct two circuits given in Figs. 5 and 6, corresponding to the functions A’+B’ and (A.B)’ A.B, respectively.

Show that, for all combinations of A and B, the two circuits give identical results.

In the lab connect these circuits and verify their operations.

3

1

2

A

B B'

4

5

6

A'

1

2 3

A'+B' (^1) (A.B)' 2

3

A

B

0

1

0

1

1 1

0

1

0

1

Fig. 5 Fig. 6

II. Design of a Digital Circuit

Consider the following problem:

Four chairs A, B, C, and D are placed in a row. Each chair may be occupied (“l”) or empty (“0”). A Boolean function F is “l” if and only if there are two or more adjacent chairs that are empty.

  1. Give the truth table defining the Boolean function F
  2. Express F as a minterm expansion (standard sum of product)
  3. Express F as a maxterm expansion (standard product of sum