Electronics Outcome 3 Dig

51
So far we have considered what is known as Analogue electronics, we must now consider digital. Digital electronics is the basis of computer technology, and is now used in a large number of devices including PLCs etc. In its simplest form it can be considered as electrical signals which are either ON or OFF. This normally takes the form of a high voltage/signal (+5volts) and a low voltage/signal (0v). The limited signals available means we must use BINARY or BASE 2, as the number system. In binary we only require two digits 0 & 1, we can therefore express any quantity only using ON and OFF signals. Digital Electronics.

description

Application of electronic circuits (electronics) Outcome 3 Digital Nat Dip/Cert Yr 1

Transcript of Electronics Outcome 3 Dig

So far we have considered what is known asAnalogue electronics, we must now considerdigital.

Digital electronics is the basis of computertechnology, and is now used in a large number ofdevices including PLCs etc.

In its simplest form it can be considered aselectrical signals which are either ON or OFF. Thisnormally takes the form of a high voltage/signal (+5volts) and a low voltage/signal (0v).

The limited signals available means we must useBINARY or BASE 2, as the number system. Inbinary we only require two digits 0 & 1, we cantherefore express any quantity only using ON andOFF signals.

Digital Electronics.

BINARY.

When we use numbers in everyday life andScience, we commonly use BASE 10, known asthe Denary system. This is properly due to ushaving 10 fingers, if we consider a number e.g.247 in the system we use everyday then:

102 101 100

100 10 1

2 4 7

We can see in the above example that the positionof the digits, give us the multiplier for the digit, e.g.2 X 100. The columns are produced by increasingthe index of the base that is in use, we can applythe same rule to any number to give a new base.In binary we use 2 this then gives us:

27 26 25 24 23 22 21 20

128 64 32 16 8 4 2 1

We can use these to convert our base10 numberinto binary, and when we do this we find that thebinary equivalent for the quantity 24710 is:

27 26 25 24 23 22 21 20

Digital Electronics.

128 64 32 16 8 4 2 1

1 1 1 1 0 1 1 1This is made up from:

1 128 1 64 1 32 1 16 1

4 1 2 1 1 247

Questions.

1) Convert the following to binary:

a) 45 b) 345 c) 2657 d) 87

2) Convert the following to base10

a) 1101 b) 110010 c) 10101 d)1010101

Digital Electronics.

GATES.

We are going to consider a number of electronicdevices known as Gates, these are used in digitalcircuits to combine and alter signals.

The first three gates we will consider are known asAND, OR and NOT gates.

Truth table.

To allow us to analyse the gate and later toanalyse circuits we use truth tables. These tablesuse all the possible inputs (0 & 1s) and then theoutputs produced by the gate(s).

Digital Electronics.

The AND gate.

These gate will give an output of 1, only when allthe inputs to it are 1.

The 2 symbols shown are in common usehowever, we will only be using the AmericanSymbol as the BS symbol is falling into disuse.

This gate can be considered as a simple set ofswitches in series, unless all are closed (input 1)then no current will flow.

Digital Electronics.

&

INP

UT

S

INP

UT

S

OU

TP

UT

OU

TP

UT

BS SymbolAmerican Symbol

input 1 input 2ouput

supply

Let us consider the AND gate with inputs A and B:

111001010000

BAOUTPUTINPUTS

In this truth table we can see all the inputs A andB, with all of the possible combinations possible.This then produces an output of zeros and ones.

Note that for an AND gate we only get a 1 outputwhen all the inputs are 1.

Digital Electronics.

AB

OU

TP

UT

The OR gate.

This gate will give an output of 1 if any one of itsinput are 1.

When we consider this gate as a set of switchesthen they would be arranged in parallel.

If we consider the OR gate with its truth table thenwe see:

111101110000

BAOUTPUT

INPUTS

Note that for an OR gate we only get a zero whenall the inputs are zero.

Digital Electronics.

INP

UT

S

INP

UT

S

OU

TP

UT

OU

TP

UT

BS SymbolAmerican Symbol

1

OUTPUT

A

BSup

ply

AB

OU

TP

UT

The NOT gate.

This gate has only one input and will give an outputwhich is NOT the input.

This device is sometimesknown as an inverter as it inverts the input.

These three gates allow us to develop digitalcircuit, which can be used in control.

Digital Electronics.

INP

UT

INP

UT

OU

TP

UT

OU

TP

UT

BS SymbolAmerican Symbol

1

OU

TP

UT

A

0110

OUT PUTIN PUT

A

EXAMPLE.

Let us consider the following requirements:

3 inputs A, B & C.

The output required is A AND B OR NOT C.

We can develop this circuit using gates:

The above diagram was produced using croc-clips,with the inputs A, B & C, the 3 gates required AND,OR & NOT and the output.

Digital Electronics.

The truth table for the circuit:

010111111011010101111001010110111010000100001000

A OR B AND NOT CA OR BNOT CCBAOUTPUTSTAGESINPUTS

We can see from the table that only 3 sets ofinputs gives a 1 output from the circuit.

Digital Electronics.

Exercise 1.

Let us consider a circuit with 4 inputs; A, B, C & D.

The output is provided by A AND B OR C ANDNOT D.

Use Croc-Clips to draw the circuit and produce atruth table.

Digital Electronics.

0000100000100000

A AND B OR C ANDNOT D

C ANDNOT D

NOT DA ANDB

DCBAOUTPUTSTAGESINPUTS

Digital Electronics.

Investigation 13.

Using croc-clips produce a circuit which will givetwo outputs RED & GREEN.

The inputs to the circuit to control the lights are A,B, C & D.

These inputs are combined using a number ofgates to give:

RED ON when A AND B OR C AND NOT D

GREEN ON when A AND NOT B OR NOT C ANDD

Prove that your circuit works by constructing thetruth table.

Digital Electronics.

Boolean Algebra.

To allow us to write expressions easier and to helpus try to reduce them to their simplest form we canuse Boolean Algebra.

With Boolean algebra we can replace the wordsAND, OR & NOT with symbols, and use somebasic rules similar to normal algebra to reduce thenumber of gates required in a circuit.

AND Gate = A.B

OR Gate = A B

NOT Gate = A

If we consider the example used earlier todescribe the gates used to provide an output then:

1) Output is A AND B OR NOT C

This can be rewritten as: output A.B C

2) Output is A AND B OR C AND NOT D

This can be rewritten as: output A.B C.D3) Try these yourself:

a) A AND B OR C AND NOT D

b) A AND NOT B OR NOT C AND D

Digital Electronics.

To help us to reduce circuits to their simplest formwe can use a set of simple rules:

AND GATE OR GATE

A.A A A A A

A.1 A A 1 1

A.0 0 A 0 A

A.A 0 A A 1

From these we can develop some rules forcombinations of gates:

ORA B C A B C

A.B A.C A.B C

ANDA.B.C A.B.C

A B.A C A B.C

Also, Mr. Boolean's mate Mr. DeMorgan came upwith some rules known as DeMorgan’s Laws:

A.B A B A B A.B

Digital Electronics.

We can apply these rules to a Booleanexpressions, this will hopefully reduce the numberof gates required. The less gates we use then thesimpler, cheaper and more robust our completedcircuit will be.

Example.

Let us consider the following Boolean expressions:

Y A A.B where, Y outputWe can simplify this expression using the rulesshown earlier:

Y A A.B A A.1

Y A.1 A.B A iscommon

Y A.1 B 1 B 1

Y A.1 A.1 A

Y A

Digital Electronics.

We can check this answer by producing the truthtables and comparing the output columns.

11111110010001000000

AA+A.B

A.BBA

Note that both the outputs are the same and thestate of B does not have any affect on the finialoutput. If we use A only then we have removed oneinput, an AND & a OR gate.

Digital Electronics.

Exercise 2.

Simplify the following expressions:

1) A B B.C Y

2) A B.C A.C Y

3) A.B A Y

Digital Electronics.

4) A.B A.C Y

5) A.B A Y

Digital Electronics.

Exercise 3.

1) Construct the Boolean expressions for thefollowing circuits.

2) Construct the circuits using croc-clips.

3) Check you truth tables with the circuit output.

a)

Digital Electronics.

Y

AB

C

b)

Digital Electronics.

YA

BC

Exercise 4.

1) Design circuits to give the following Booleanexpressions.

2) Workout the truth table for each expression.

3) Construct the circuits and check the truth tables.

a) Y A.BC

b) Y A.B C

Digital Electronics.

Multi-Outputs.

We have considered circuits which give only oneoutput which can have the value 1 or 0. We canalso design circuits which have a number ofinterconnected outputs. A simple example of this isa set of traffic lights where three (3) lights arecontrolled.

E.G.

RED ON A.B A.C

GREEN ON A.B A.B

AMBER ON A.C

We can construct the circuit to match the Booleanexpressions(NOTE theycould besimplified).

Tryconstructingthis circuitusingcroc-clips.

Digital Electronics.

Karnaugh Maps.

We have used Boolean algebra for thesimplification of our digital circuit, however, anothermethod is to use Karnaugh maps.

This method uses a grid system to map out all thepossible inputs and output that can occur within acircuit, we can then group common terms.

Let us consider a simple 2 input example:

output A.B A.B

The above table shows all the possible values forthe inputs to the circuit A, NOT A, B & NOT B.

We can complete the table by putting a 1 where inputs are ANDed together, e.g. A and B.

We can now look for where two 1s appear next toeach other, in this example this is in the B column.

Digital Electronics.

NOT AA

NOT BBINPUTS

01NOT A01A

NOT BBINPUTS

This then allows us to simplify the expression as Bis common.

output B

Let us consider a more complex problem with 3inputs,

Output A.B.C A.B.C A.B.C

The table mustcontain all the

possible combinations for the inputs:

Note that onlyone term changes per step.

We can now complete as before, by adding a 1into the box which contains the term.

We can now examine the mapped expression,and see where 1s appear next to each other. In

Digital Electronics.

CC

A.BA.BA.BA.BINPUTS

0001C

0011CA.BA.BA.BA.BINPUTS

this expression two pairs exist note that both sharea 1.

I.e. A.B.C & A.B.C and A.B.C & A.B.CWe take the part of the expression that appears inboth cells, therefore,

output A.C A.BWe can check this answer by using truth table.

Truth tables.

Original Expression.

Output A.B.C A.B.C A.B.C

11001111001011101010100000010000110000001000001000000000

CBAOUTPUTA.B.CA.B.CA.B.CINPUTS

Simplified Expression.

Output A.B A.C

Digital Electronics.

111111101011110101000001000110000010000100000000

CBAOUTPUT A.C A.BINPUTS

We can see that the two outputs are the same.

Digital Electronics.

Exercise 5.

Simplify the following expressions using Karnaughmaps, check your answers using truth tables.

1) output A.B.C A.B.C A.B.C

111011101001110010100000CBA

OUTPUTA.B.CA.B.CA.B.CINPUTS

Digital Electronics.

CC

A.BA.BA.BA.BINPUTS

2) output A.B.C A.B.C A.B.C

Digital Electronics.

INPUTS

3) output A.B.C.D A.B.C.D A.B.C.D

Note do his question in the same manor as theexpressions with 3 inputs.

Digital Electronics.

C.DC.DC.DC.D

A.BA.BA.BA.BINPUTS

4) Y ABCD ABCD ABCD ABCD

Digital Electronics.

INPUTS

Integrated Circuits, 74 Series.

We have considered logic gates as simplesymbols, using computer simulation to show howthey react to inputs. In real circuits we can eitherconstruct the gate using components such astransistors or use ICs.

The 7400 series IC family are a group of chipswhich contain gates and other logic circuitcomponents (such as shift registers etc.). TheseICs can be used to construct more complexcircuits without the need for us to get involved inthe construction of each individual gate.

We will consider only a small number of theavailable ICs, the others are listed in data bookswhere their pin connections and power

requirements arelisted.

Example.

The 7408 is a TTL,Quad, 2-input ANDgate device.

We can see from the above diagram theconnections to each of the gates, note that the IC

Digital Electronics.

1 2 3 4 5 6 7

891011121314Vcc

Gnd

must be powered, in this case via pins 7 (GND, i.e.0 volts) and 14 (Vcc, +9 volts).

Each IC contains one type of gate, therefore if yourequire more then one type of gate for your circuitthen you will require more then one IC.

Digital Electronics.

Using one type of gate.

Due to Integrated Circuits (ICs) beingmanufactured with only one type of gate, we havedeveloped methods of converting gates intodifferent types. This mean we can constructcomplex circuits using only one type of gate.

This allows us to convert say a number of OR &AND gates into a common gate, the mostcommonly used gates are NOR and NAND.

To help us in this conversion we can useDeMorgan’s Laws and some trial & error.

Let us consider DeMorgan’s Laws:

and A.B AB A B A.B

This relationship can be proven by producing thetruth tables for the circuits:

Complete the table below

11011000

Q2Q1NOT BNOTABA

Digital Electronics.

AB Q

A

BQ

1

2

Digital Electronics.

Exercise 6.

1) a) Convert the circuit below to NOR only:

b) Convert the circuit below to NAND only:

Digital Electronics.

AB Q

Q=A.B

YOU HAVE NOW REACHED AN ASSESSMENTPOINT

YOU SHOULD CHECK YOUR WORK ISCOMPLETE

AND THEN ATTEMPT ASS3 U7

Digital Electronics.

Sequential Logic.

We have so far considered combinational logiccircuits. These have been circuit whose output atanytime relies on the input at that time.

In sequential logic circuits outputs are not onlydependent on the inputs at that moment in time butalso on the previous state of the inputs/output.

The simplest device that we can consider is theBISTABLE, this device can be used as a simple 1bit memory.

Bistable.

The circuit has two stable states that is it will hold,that is two different outputs (Logic 0 & 1). It willremain in one state until it is triggered, and thenremain in the second state until triggered again.

It is symbolized by:

Digital Electronics.

A

B

Q

QOUTPUTSINPUTS

Note that the two outputs Q & NOT Q, will alwaysgive opposite logic values, i.e. If Q = 1, then NOTQ = 0.

Digital Electronics.

The basic Bistable device has limitations andtherefore the more commonly used component isthe RS BISTABLE. This device uses the inputsSET (S) and RESET (R) and the outputs Q andNOT Q.

RS

Bistable.

The device isSET when Q =1 & RESET when Q = 0

Exercise 7.

Using Croc-clips complete the truth table for asimple RS Bistable device.

Digital Electronics.

S

R

Q

QINP

UT

S

OU

TP

UT

S

Digital Electronics.

1111101001

001100

0000NOT QQRS

Clocking a Logic Circuit.

We have considered a number of logic circuits allof which have operated when we put our inputs onto the logic gates. Sometimes we do not want thissituation we may have a number of circuits whichwe wish to sequence with each other. To allow usto do this we can CLOCK the logic circuit, that is toapply an input which will allow the circuit to onlyoperate when we want it to. E.G.

In this circuit we see that the circuit will not changeits output until the clock pulse is applied.

This clock pulse maybe produced in a number ofways including timing circuits such as the 555timer, or a simple switch.

Digital Electronics.

S

R

Q

Q

CLO

CK

The J-K Flip-flop.

The problems with indeterminate output of the R-Sdevice can be eliminated by using the J-K Flip-flopdevice.

The symbol used for this device shows a clockinput CK, as well as the J, K, R & S inputs..

Exercise 8.

Using croc-clips complete the truth table for thisdevice note the use of Q and NOT Q, which is thenext state as described earlier.

Digital Electronics.

Q

Q

S

R

J

K

CK

1111101001010000

NOT QQKJ

Also investigate the clock input, and the R & Sinputs.

Digital Electronics.

Further Sequential logic circuits.

We will consider a number of simple circuits usingsequential logic components.

Exercise 9)

1) Binary Counter.

Construct the above circuit using 2 x 4027 (JK FlipFlop ICs).

Using your circuit complete the following table:

Digital Electronics.

J

CK

K

S

R

Q

Q

J

CK

K

S

R

Q

Q

J

CK

K

S

R

Q

Q

J

CK

K

S

R

Q

Q

J

CK

K

S

R

Q

Q

R

1

0

1110987654321

D (8)C (4)B (2)A (1)Pulse

Digital Electronics.

Construct the circuit using croc-clips:

Notice that this simulation of the circuit, does notrequire the components to have power suppliesetc. This is due to it being a simulation where thecomponents used are in isolation from each other.We must be careful when using this type of simplecomputer si as it is not always a truerepresentation of the circuitry required.

Other computer simulation packages such asPROTEUS and SIMULINK, will allow you tosimulate these circuits more accurately. Howeverthey are more complex to use and require a lotlonger to learn. You will be required to use them inND/NCert Yr.2 Electrical, where you will be given awhole unit of ECAD (Electrical Comp AidedDesign).

Use your simulation to check your truth table forthe circuit using 4027 ICs.

Digital Electronics.

Exercise 10.

2) Shift Register.

The above circuit is constructed using two 4027s(JK flip-flops) and a 4049 (hex buffer). This secondIC is used to provide the NOT gate between the Jand the K inputs of the first gate.

The outputs aresimple LED's and theclock input can beprovided by afunction generatorset on square waveat a low frequency.

Digital Electronics.

J

CK

K

S

R

Q

Q

J

CK

K

S

R

Q

Q

J

CK

K

S

R

Q

Q

J

CK

K

S

R

Q

Q

J

CK

K

S

R

Q

Q

9v

1

0

0v

Clock input

DataL

ED

1

LE

D 2

LE

D 3

LE

D 4

876543210

LED 4LED 3LED 2LED 1Pulse

Use your circuit to complete the truth table.

Digital Electronics.

Construct the shift register using croc-clips:

The circuit should operate by moving the data inputalong the chain with each clock pulse. That is tosay that if the data input is a 1 then as the clockpulses the 1 value will move along the circuit, andvisa versa.

Use your croc-clip circuit to check the values yougot for the constructed circuit.

Digital Electronics.

YOU HAVE NOW REACHED AN ASSESSMENTPOINT

YOU SHOULD CHECK YOUR WORK ISCOMPLETE

AND THEN ATTEMPT ASS 4 U7

Digital Electronics.