EGH166: Hands on Labs

Lab 7: Digital Electronics

 

 

Introduction

Background

Digital electronics have found their way into absolutely everything. Many simple coffee makers are controlled by digital computers. A compact disc player attributes its quality to digital recording and play back. Digital clocks far outperform typical analog clocks in reliability and cost.

 

There is not a field in engineering, or even a kitchen that has not been affected by digital electronics. Computers are controlling the world of the future and understanding the basic methodology of computers is essential to putting them to use.

Purpose

The purpose of this lab is to expose the students to operation of the fundamental components of integrated circuits

Basic Principles

In this lab write-up will cover the following basic principles:

1.      Digital Vs/ Analog,

2.      Number systems,

3.      Binary numbers,

4.      Building blocks of digital electronics,

5.      Primary gates,

6.      Advantages of digital logic,

7.      LEDs, And

8.      Power MOSFETs

Lab Experience

In the lab experience you will experiment with:

1.      Basic Logic Gates, and

2.      Build digital circuits using Transistors.


Fundamental Electric Units

Digital Vs Analog

A digital signal is one based on a finite and discrete set of symbols. An analog signal may take on infinite values. Think of digital information as the natural number system and analog signals comprise the entire

real number system. There are clearly more real numbers than natural numbers over a given range, but is the precision of an infinite amount of values necessary to accurately convey information?

 

Analog information is by no means extinct, but it is certainly declining in use. Television broadcast, AM/FM radios, cassettes and telephones all carry analog information. Sound is heard through the vibrations of air molecules, these vibrations are easily converted into electrical signals, which can be transmitted to a load speaker, a cassette recorder, a phone line or an FM broadcast. Since audio signals are inherently analog it is efficient to transmit them in the same form.

 

Digital information is carried on wires, just as analog information however only one digital signal can be present on a piece of wire at any given time. A phone line consists of two wires, ground (a base voltage reference) and signal. The signal wire carries the voice information of both parties simultaneously (unlike digital lines), one person can speak while still hearing and understanding the other party. Digital signals typically consist of two and only two fundamental units: on and off (or high and low or 1 and 0). Signals using only 2 symbols are termed binary or base 2.

Number System

The number system familiar to all is base 10 (also called

decimal), after ten discrete symbols have been used a new digit must be created, the ten symbols are: 0123456789. In binary numbers there are only two symbols: 01. Some other number systems are octal: 01234567 or hexadecimal: 0123456789ABCDEF. It is possible to represent the same value in any number system.

 

Pretend there were only 3 symbols available for use (0,1 and 2) this would be base three. Counting from zero to ten would appear as follows:

 

0 1 2 10 11 12 20 21 22 100 101

 

Notice that any number can be converted to base 10 as follows:

 

Number = lowest digit X 1 + (ones place)

 

next digit X 3 + (threes place)

 

next digit X 9 + ... (nines place)

 

For example, 211023 (21102 base 3) would be:

 

 

= 162+27+9+0+2 = 200

 

represent an instruction, or command and two bytes of data to perform that instruction on. Think of a computer

as a machine that can perform only a small set of functions such as add, replace data with new numbers, and compare values to determine greater than, less than or

equal. A computer program puts many very simple instructions together to perform one meaningful instruction such as multiplying two decimal numbers

every 0.000000025 seconds) takes a few bits that represent an instruction, or command and two bytes of data to perform that instruction on. Think of a computer

as a machine that can perform only a small set of functions such as add, replace data with new numbers, and compare values to determine greater than, less than or

equal. A computer program puts many very simple instructions together to perform one meaningful instruction such as multiplying two decimal numbers.

Binary Numbers

Binary numbers use digits with values of 1,2,4,8,16,32,64,128... An 8-bit number could have a maximum value of 255, this would be a '1' in each of the eight digits

(128+64+32+16+8+4+2+1=255).

 

To count from 0 to ten base two would be as follows:

 

0 1 10 11 100 101 110 111 1000 1001 1010

 

Binary numbers are easily represented in electrical systems using voltage levels to represent a 1 or zero. Most computers use 5 volts to represent a binary 1 (high) and 0 volts (low) to represent a binary 0. Consider 8 ordered wires, each having a voltage level of either 5 volts or 0 volts, this cable can represent the numbers 0 to 255 at any time. This is the manner in which information is passed around in a computer.

 

Older computers are termed 8-bit machines, they work with information carried in bytes (one byte is eight bits). A computer can take (manipulate) millions of bytes every second. The way that a computer accomplishes tasks is with its microprocessor. The microprocessor, on every clock cycle (for a 40MHz computer this is every 0.000000025 seconds) takes a few bits that

represent an instruction, or command and two bytes of data to perform that instruction on. Think of a computer as a machine that can perform only a small set of functions such as add, replace data with new numbers, and compare values to determine greater than, less than or equal. A computer program puts many very simple instructions together to perform one meaningful instruction such as multiplying two decimal numbers.

Building Blocks of Digital Electronics

All computers are built upon the most basic element of digital electronics: the transistor. A transistor can be thought of as a valve, when it is open (or gated) electricity can flow, when it is closed, no electricity can flow.

 

 

For the circuit shown, if no current were supplied at the base then the 'gate' would remain closed and no current would flow from 5 volts to ground through the transistor. Since no current could flow through the transistor, no current would be flowing through the resistor and so the output voltage would be equal to 5 volts (binary 1). If current was supplied at the base then the transistor would 'open' and current could flow from 5 volts down to ground through the transistor. This would connect the output line directly to ground

(through the transistor) and make the output voltage equal to zero (binary 0).

 

This electrically controlled switch is the basic building block of all digital electronics. Simple digital electronic components carry out the

functions of Boolean algebra. Boolean algebra is the manipulation of logical statements to determine truth or false.

Example

Turn on the hydraulic pump if and only if the system is enabled, the operator is pressing both palm buttons, the emergency stop button is not pressed and

the proximity sensor does not sense probable interference with any moving parts. The pump will also turn on if an override switch is on (unless the

emergency stop is made).

 

This safety circuit could be realized with relay logic, but a more energy efficient and portable method would be to use digital electronics.

 

 

The circuit shown above will control the hydraulic pump as described. In the state shown the E-Stop is not made, both palm buttons are made and the proximity sensor does not sense anything. In this state the hydraulic pump is turned on. The 1 at the output shows this. The building blocks for this circuit are AND, OR and NOT gates. When a signal, or set of signals enter these gates the output is set according to the logical truth of the signals.

Primary Gates

An AND gate takes in multiple pieces of information and passes on the value true only if all of its inputs were true. The statement Donald Trump is rich AND he is a male is true, however the statement Ohio State University is huge AND worms have sharp fangs is false. An OR gate will act just as expected, it will set its output as true (binary 1) if either of its inputs are true. The statement ice cream is sweet OR gymnasts have no balance is true because at least one of the statements was true. A NOT gate simply inverts the truth of a statement.

Hydraulic Pump Circuit

Another state of the hydraulic pump circuit is as follows:

 

Notice the logical value of each of the branches. Only one of the palm switches is made so 1 AND 0 = 0. The output of the 3 input AND gate is 0 because 1 AND 0 AND 1 = 0. The or gate shows a 1 as an output because 0 OR 1 = 1. The final control signal is a zero because 1 AND 0 = 0. Notice also how the NOT gate changed the E-Stop signal of 1 to a 0.

 

There are several other types of gates such as NOR, NAND and XOR but all of these and any other gate can be broken down to simple AND, OR, NOT logic.

 

Advantages of Digital Logic

Digital electronic devices are much more popular than traditional analog devices because of the added versatility. Digital devices can

easily interface with computers which not only simplifies data manipulation, but also storage and analysis of data. When selected correctly digital devices offer the same precision as an analog counterpart typically with greater reliability and almost always a smaller package

LEDs

An LED is a polar device that has a preferred orientation (unlike a resistor). An LED will illuminate when current flows through it in the proper direction. The Cathode of the LED is the negative side (the side that should be connected to the lower voltage level- ground in our case), the Anode should be connected to the output signal we wish to represent. When the control signal is at 5 volts (logic 1) current will flow through the LED and it will illuminate. When the signal is a logic 0, no current will flow and the LED will not illuminate. One caution with the LEDs is that they can withstand only a limited amount of current, for this reason a resistor must be put in series with the LED, a value of 270? is recommended.

 

Power MOSFETs

A power MOSFET (metal oxide semiconductor field effect transistor) is a device which is used to switch on and off high current, higher DC

voltage level loads using simple 5 volt, low current digital signals. It is very simply an electrically controlled switch. When a logic 1 is at its input, current can flow through the device. When a logic zero is at its input, no current can flow.

 

LAB EXPERIENCE

Logic Gates

Inputs and Outputs

 

1.      The inputs will be controlled by using switches. The condition of the output can be determined using light emitting diodes (LEDs). The output of the switches can be either 0 or 5 volts to represent logic 0 or 1.Wire up a 1kohm pull up resistor to make the output signal 5 volts when the switch is open. (See figure #1).

 

Simple Logic Circuits

 

2.      Use a transistor to implement a NOT logic gate and apply the output to an LED. Use switches to control the inputs and current limiting resistors for the LEDs in the output. Use always +5 volts unless otherwise specified. (See figure #2)

3.      Use a NAND logic gate (4011) to implement a NOT logic gate. Use also switches and LEDs for the inputs and outputs respectively. Use a voltmeter to inspect the voltages of the circuit. Is it what you would expect?. (See figure #3)

4.      Check the truth tables of the given NOR and NAND logic gates. (See figures #4a and #4.b.)

 

Digital Controller

Control of DC Motors

 

5.      Use a power MOSFET as a switch to control a 5 V DC motor. The circuit diagram is given in figure #5. Use the data sheet to verify the pin outs of the power MOSFET.

6.      How could a 5-volt logic circuit control a 12-volt motor? Explain why.

 

 

LAB REPORT

 

Format

  Lab reports must be done in Teams.

  Follow given lab report format.

  Maximum 4-5 pages (including figures and tables)