Sunteți pe pagina 1din 27

Announcements

Laboratories and Tutorials will be held at the following times:


Monday (15h00 17h00) Tuesday (15h00 17h00)

Venue Change: Laboratory 1 will be held in the White Lab Tutorials will be handed out during the tut session and must be completed and handed in by your next lecture (Thursday Lectures) It is a DP requirement to attend at least 50% of all labs and tutorials

Digital Electronics EEE3017W R. Verrinder (2008)

Textbooks
There is no set textbook for this course, however, these books maybe useful for certain sections of work:
Logic and Computer Fundamentals (Mano & Kine) The Art of Electronics (Horowitz & Hill)

Digital Electronics EEE3017W R. Verrinder (2008)

Digital Circuits
There are two main classes of digital circuits:
Combinational Circuits Sequential Circuits

Digital Electronics EEE3017W R. Verrinder (2008)

Combinational Circuits
Have no memory Output only depends on the inputs To reverse engineer the circuit:
Cycle through all the inputs and note the outputs for each input

INPUT

OUTPUT

Digital Electronics EEE3017W R. Verrinder (2008)

Sequential Circuits
Have memory Output is a function of inputs and the state of the circuit Cannot just use inputs and outputs to determine the circuits construction
INPUT OUTPUT

Digital Electronics EEE3017W R. Verrinder (2008)

Off the Shelf Digital Chips


Some digital functions are so useful that they have dedicated chips This include:

Digital Electronics EEE3017W R. Verrinder (2008)

Multiplexers Decoders Adders Flip-flops Counters etc.

Multiplexers
Are selector devices Take multiple inputs and output one signal based on the value of the select signals Have:
n inputs 1 output log2n selection lines Examples: 74HC157; 74HC153; 74HC356
Digital Electronics EEE3017W R. Verrinder (2008)

Sel1 0 0 1 1

Sel2 0 1 0 1

Output In0 In1 In2 In3


7

Multiplexers cont.

Digital Electronics EEE3017W R. Verrinder (2008)

Encoder
In3 In2 In1 In0 Out1 Out0

Converts a signal into a specific code Used for:


Encrypting data Data compression Translating one code to another

0 0 1

0 1 0

1 0 0

0 0 0

0 1 1

1 0 1

Digital Electronics EEE3017W R. Verrinder (2008)

Decoders
Does the reverse of an encoder Different types of decoder:
n-to-2n decoder 7 segment display decoder BCD decoder

In1 In0 Out3 Out2 Out1 Out0

n-to-2n decoders convert binary information from n encoded bits to 2n unique outputs Examples:74HC137; 74HC42; 74HC139
Digital Electronics EEE3017W R. Verrinder (2008)

0 0 1 1

0 1 0 1

0 0 0 1

0 0 1 0

0 1 0 0

1 0 0 0

10

Addition Circuits Half Adder


Adds 2 bits together

A +B Sum
Sum: Carry: Problem!
Digital Electronics EEE3017W R. Verrinder (2008)

0 1 1 0 0 Carry 1 1
AB A.B

11

Problem!
Adds two bits together but cant handle an input carry bit This is why it is called a half adder

Solution FULL ADDER

Digital Electronics EEE3017W R. Verrinder (2008)

12

Addition Circuits Full Adder


Has 3 inputs:
Input A Input B Carry In

2 outputs
Sum Carry Out

Made by combining 2 half adders and an OR gate

Digital Electronics EEE3017W R. Verrinder (2008)

13

Multi-bit Wide Adder


To make multi-bit wide adders:
Cascade a number of full adders The carry out bits are fed into the carry in bits etc.

Problems with this approach:


Cascading circuits leads to poor overall circuit performance Chips not infinitely fast
Digital Electronics EEE3017W R. Verrinder (2008)

14

RS Flip-flops
Have memory

Made by cross-coupling
two:
NAND gates NOR gates

Pull S LOW and Q goes HIGH and stays HIGH until R pulled LOW

Digital Electronics EEE3017W R. Verrinder (2008)

15

D-type Flip-Flops
Have following inputs:
D Clock (CLK) S R

Have following outputs


Q Q D CLK Next State of Q

On clock edge, the value on D is transferred to Q and stays there R and S are used to put device into known state
Digital Electronics EEE3017W R. Verrinder (2008)

X 0 1

0 h h

No Change 0 1

16

JK Flip-flops
Operation similar to Dtype except has two inputs J and K When J is HIGH, flip-flop is SET When K is HIGH, flip-flop is RESET If both J and K are high, output simply TOGGLES

Next State of Q

No change

0
1

1
0

0
1

1
Digital Electronics EEE3017W R. Verrinder (2008)

Toggle
17

Counters
Go through a set sequence of states when pulses are applied to the input Different types:
Ripple counters Synchronous counters Johnson counters Decade counters. Up-down counters Ring counters

Digital Electronics EEE3017W R. Verrinder (2008)

18

Ripple Counter
Made using flip-flops which can complement their outputs 2nd flip-flop only toggles when first flip-flop has changed state Outputs do not all change at the same time

Digital Electronics EEE3017W R. Verrinder (2008)

19

Shift Registers
0 1 1 0 0 1 101

Data is put in load input For every clock pulse, data is shifted 1 bit to the right Used to implement:
Parallel to serial conversion Used often in microprocessors Serial to parallel conversion
Digital Electronics EEE3017W R. Verrinder (2008)

20

Design of Sequential Circuits using D-type Flip-flops


D-type flip-flops used to hold systems current state Use combinational logic to make system move from state to state
D inputs Flip flops hold CURRENT state Q Outputs Combinational logic calculates OUTPUTS for each state System Outputs

System Inputs

Combinational circuit calculates NEXT state

Digital Electronics EEE3017W R. Verrinder (2008)

21

How to Design the Combinational Circuit


Draw a present state next state diagram Show:
Inputs Present States Next States
Input 0 0 0 Present 1 (Q1) 0 0 1 Present 0 (Q0) 0 1 0 Next 1 (D1) Next 0 (D0)

Enter values in next state column given inputs and current state Simplify using standard logic reduction tools
Digital Electronics EEE3017W R. Verrinder (2008)

0
1 1 1 1

1
0 0 1 1

1
0 1 0 1
22

Example 1
1. Design a counter that counts in the following sequence: 0 1 2 repeat The counter must not be a ripple type

Digital Electronics EEE3017W R. Verrinder (2008)

23

Example 1 - Solution
Firstly there are no external inputs Use two D-type flip flops as This gives us 4 possible states. This is fine as we just use dont care conditions for the unwanted state To create the combinational logic use a Present state Next State Diagram
Digital Electronics EEE3017W R. Verrinder (2008)

24

Example 1 Solution cont.


Present (Q1) (Q0) Next (D1) (D0)

Count Sequence: 0-1-2-repeat 1 0 0 X

0 0 1 1

0 1 0 1

0 1 0 X

D1 = Q0 Need to use a Karnaugh Map to find D0

Digital Electronics EEE3017W R. Verrinder (2008)

25

Example 1 Solution cont.


Q1 Q0
0 0 1

1 X

D0 Q 0 Q1
Digital Electronics EEE3017W R. Verrinder (2008)

(Q 0 Q1 )
26

Example 1 Solution cont.

Digital Electronics EEE3017W R. Verrinder (2008)

27

S-ar putea să vă placă și