elct201: digital logic design...โ€ข an encoder is a digital circuit that performs the inverse...

Post on 13-Jul-2020

3 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

ELCT201: DIGITAL LOGIC DESIGN Prof. Dr. Eng. Tallal El-Shabrawy, tallal.el-shabrawy@guc.edu.eg

Dr. Eng. Wassim Alexan, wassim.joseph@guc.edu.eg

Lecture 6

ู‡ู€ู€ 1441ู…ุญุฑู…

Spring 2020

Following the slides of Dr. Ahmed H. Madian

COURSE OUTLINE

1. Introduction

2. Gate-Level Minimization

3. Combinational Logic

4. Synchronous Sequential Logic

5. Registers and Counters

6. Memories and Programmable Logic

2

LECTURE OUTLINE

โ€ข Combinational Logic Circuits

โ€ข Decoders

โ€ข Encoders

โ€ข Multiplexers

โ€ข Tri-state Buffers

3

DECODERS

4

โ€ข Consider a vending machine that takes 3 bits as input and releases a single product, out of the available 8 product sorts

โ€ข A Decoder is a combinational circuit that converts binary information from ๐‘› input lines to a maximum of 2๐‘› unique output lines

โ€ข If the ๐‘› โˆ’bit coded information has unused combinations, the decoder may have fewer than 2๐‘› outputs

Vending

Machine Input pad

Output

select

line

DECODERS

5

โ€ข It is required to design a combinational circuit with two inputs (๐‘Ž, ๐‘) and four outputs (๐ท0, ๐ท1, ๐ท2, ๐ท3), such that:

โ€ข ๐ท0 = 1 when ๐‘Ž = 0 and ๐‘ = 0

โ€ข ๐ท1 = 1 when ๐‘Ž = 0 and ๐‘ = 1

โ€ข ๐ท2 = 1 when ๐‘Ž = 1 and ๐‘ = 0

โ€ข ๐ท3 = 1 when ๐‘Ž = 1 and ๐‘ = 1

DECODERS

6

Solution

1. From the specifications of the circuit, determine the required number of inputs and outputs and assign a letter (symbol) to each

2 ร— 4

Decoder

๐‘Ž

๐‘ ๐ท3

๐ท1

๐ท2

๐ท0

DECODERS

7

2. Derive the truth table that defines the required relationship between the inputs and outputs

Inputs Outputs

๐‘Ž ๐‘ ๐ท0 ๐ท1 ๐ท2 ๐ท3

0 0 1 0 0 0

0 1 0 1 0 0

1 0 0 0 1 0

1 1 0 0 0 1

DECODERS

8

3. Obtain the simplified Boolean functions for each output as a function of the input variables

๐ท0 = ๐‘Žโ€ฒ๐‘โ€ฒ

๐ท1 = ๐‘Žโ€ฒ๐‘

๐ท2 = ๐‘Ž๐‘โ€ฒ

๐ท3 = ๐‘Ž๐‘

4. Sketch the logic diagram

๐ท0

๐ท1

๐ท2

๐ท3

๐‘

๐‘Ž

3ร—8 DECODER

โ€ข A 3 ร— 8 line decoder decodes 3 input bits into one of 8 possible outputs

โ€ข Each output represents one of the minterms of the 3 input variables

9

๐‘ฆ

๐‘ฅ

๐‘ง

๐ท0 = ๐‘ฅโ€ฒ๐‘ฆโ€ฒ๐‘งโ€ฒ

๐ท1 = ๐‘ฅโ€ฒ๐‘ฆโ€ฒ๐‘ง

๐ท2 = ๐‘ฅโ€ฒ๐‘ฆ๐‘งโ€ฒ

๐ท3 = ๐‘ฅโ€ฒ๐‘ฆ๐‘ง

๐ท4 = ๐‘ฅ๐‘ฆโ€ฒ๐‘งโ€ฒ

๐ท5 = ๐‘ฅ๐‘ฆโ€ฒ๐‘ง

๐ท6 = ๐‘ฅ๐‘ฆ๐‘งโ€ฒ

๐ท7 = ๐‘ฅ๐‘ฆ๐‘ง

2ร—4 DECODER

โ€ข A decoder could include an Enable input to control the circuit operation

10

๐ต

๐ธ

๐ด

๐ท0

๐ท1

๐ท2

๐ท3

โ€ข A decoder could be implemented with NAND gates and thus produces the minterms in their complemented form

IMPLEMENTING FUNCTIONS USING DECODERS

โ€ข Any combinational circuit can be constructed using decoders and OR gates (the decoder generates the minterms and the OR gate performs the summation)

โ€ข Example: Implement a full adder circuit with a decoder and two OR gates

โ€ข Full adder equations:

๐‘† ๐‘ฅ, ๐‘ฆ, ๐‘ง = ฮฃ๐‘š(1,2,4,7) and ๐ถ ๐‘ฅ, ๐‘ฆ, ๐‘ง = ฮฃ๐‘š(3,5,6,7)

โ€ข Since there are 3 inputs, we need a 3 ร— 8 decoder

11

IMPLEMENTING FUNCTIONS USING DECODERS

โ€ข ๐‘† ๐‘ฅ, ๐‘ฆ, ๐‘ง = ฮฃ๐‘š(1,2,4,7) and

โ€ข ๐ถ ๐‘ฅ, ๐‘ฆ, ๐‘ง = ฮฃ๐‘š(3,5,6,7)

12

Inputs Outputs

๐‘ฅ ๐‘ฆ ๐‘ง ๐ถ ๐‘†

0 0 0 0 0

0 0 1 0 1

0 1 0 0 1

0 1 1 1 0

1 0 0 0 1

1 0 1 1 0

1 1 0 1 0

1 1 1 1 1

๐‘ฆ

๐‘ง

๐‘ฅ

๐ถ

๐‘†

DECODER EXPANSIONS

โ€ข Larger decoders can be constructed using a number of smaller ones

โ€ข For example, a 3 ร— 8 decoder can be built using a couple of 2 ร— 4 decoders and a 4 ร— 16 decoder can be built using a couple of 3 ร— 8 decoders

13

๐‘ฆ

๐‘ง

๐‘ฅ

๐‘ค

๐ท0 to ๐ท7

๐ท8 to ๐ท15

4 ร— 16 Decoder

EXERCISE

โ€ข Can you sketch a 4 ร— 16 decoder using a number of 2 ร— 4 decoders?

โ€ข I am now giving you 5 minutes to attempt it

โ€ข After these 5 minutes, the lecture will continue

14

DEDEC

15

4 ร— 16 DECODER USING 2 ร— 4 DECODERS

ENCODERS

โ€ข An encoder is a digital circuit that performs the inverse operation of a decoder

โ€ข An encoder has 2๐‘› input lines and ๐‘› output lines

โ€ข The output lines generate the binary equivalent of the input line whose value is 1

16

8ร—3 OCTAL-TO-BINARY ENCODER

17

๐‘ฅ = ๐ท4 + ๐ท5 + ๐ท6 + ๐ท7 ๐‘ฆ = ๐ท2 + ๐ท3 + ๐ท6 + ๐ท7 ๐‘ง = ๐ท1 + ๐ท3 + ๐ท5 + ๐ท7

What happens if more than one input is

active (set to HIGH) at the same time?

For example, ๐ท3 and ๐ท6?

What happens if all inputs are equal to 0?

18

What happens if more than one input is active (set to HIGH) at the same time? For example, ๐ท3 and ๐ท6?

โ€ข If ๐ท3 and ๐ท6 are active simultaneously, the output would be (111)2= (7)10, because all three outputs would be equal to 1

โ€ข But this does not reflect the actual input which should have resulted in an output of (011)2= (3)10 for ๐ท3 or (110)2= (6)10 for ๐ท6

โ€ข To overcome this problem, we use priority encoders

โ€ข If we establish a higher priority for inputs with higher subscript numbers, and if both ๐ท3 and ๐ท6 are active at the same time, the output would be (110)2 because ๐ท6 has higher priority than ๐ท3

๐‘ฅ = ๐ท4 + ๐ท5 + ๐ท6 + ๐ท7 ๐‘ฆ = ๐ท2 + ๐ท3 + ๐ท6 + ๐ท7 ๐‘ง = ๐ท1+๐ท3 + ๐ท5 + ๐ท7

8ร—3 OCTAL-TO-BINARY ENCODER

19

What happens if all inputs are equal to 0?

โ€ข The encoder output would be (000)2, but in fact this is the output when ๐ท0 is equal to 1

โ€ข This problem can be solved by providing an extra output to indicate whether at least one input is equal to 1

โ€ข ๐‘ฃ is the valid output

๐ท7๐ท6๐ท5๐ท4๐ท3๐ท2๐ท1๐ท0

๐‘ง

๐‘ฆ

๐‘ฅ

๐‘ฃ

8ร—3 OCTAL-TO-BINARY ENCODER

20

โ€ข The input ๐ท3 has the highest priority,

regardless of the values of the other inputs

โ€ข Thus, if ๐ท3 is 1, the output will indicate

that ๐ด1๐ด0 = 11, i.e. the code

๐ด1๐ด0 = 11 means that any data

appearing on line ๐ท3 will have the

highest priority and will pass through the system irrespective of other inputs

โ€ข If ๐ท2 = 1 and ๐ท3 = 0, the output

code will be ๐ด1๐ด0 = 10 and this

means that ๐ท2 has the highest priority in this case

4ร—2 PRIORITY ENCODER

Inputs Outputs

๐‘ซ๐Ÿ‘ ๐‘ซ๐Ÿ ๐‘ซ๐Ÿ ๐‘ซ๐ŸŽ ๐‘จ๐Ÿ ๐‘จ๐ŸŽ ๐•

0 0 0 0 0 0 0

0 0 0 1 0 0 1

0 0 1 X 0 1 1

0 1 X X 1 0 1

1 X X X 1 1 1

21

MAKING CONNECTIONS

Control Control

Multiplexer Demultiplexer

โ€ข Direct point-to-point connections between gates are made up of wires

โ€ข Routing one of many inputs to a single output is carried out using a multiplexer

โ€ข Routing a single input to one of many outputs is carried out using a demultiplexer

22

MULTIPLEXERS

โ€ข A multiplexer is used to connect 2๐‘› points

to a single point

โ€ข The control signal pattern forms the binary

index of the input to be connected to the

output

๐‘ฐ๐Ÿ ๐‘ฐ๐ŸŽ ๐‘จ ๐’

0 0 0 0

0 0 1 0

0 1 0 1

0 1 1 0

1 0 0 0

1 0 1 1

1 1 0 1

1 1 1 1

๐‘จ ๐’

0 ๐ผ๐ŸŽ

1 ๐ผ๐Ÿ

Functional

form

Logical

form

2ร—1 MUX ๐ผ๐Ÿ

๐ผ๐ŸŽ

๐ด

๐‘

๐‘ = ๐ดโ€ฒ๐ผ0 + ๐ด๐ผ1

23

MULTIPLEXERS

8ร—1 MUX

4ร—1 MUX

2ร—1 MUX ๐ผ๐Ÿ

๐ผ๐ŸŽ

๐ด

๐‘

๐ผ๐ŸŽ

๐ผ๐Ÿ

๐ผ๐Ÿ

๐ผ๐Ÿ‘

๐‘ ๐‘

๐ผ๐ŸŽ

๐ผ๐Ÿ

๐ผ๐Ÿ

๐ผ๐Ÿ‘

๐ผ๐Ÿ’

๐ผ๐Ÿ“

๐ผ๐Ÿ”

๐ผ๐Ÿ•

๐ด ๐ต

๐ด ๐ต ๐ถ

24

2ร—1 LINE MULTIPLEXER

๐‘† ๐‘†

๐‘ ๐‘

๐ผ๐ŸŽ

๐ผ๐Ÿ

๐ผ๐ŸŽ

๐ผ๐Ÿ

4ร—1 LINE MULTIPLEXER

๐‘

๐ผ๐ŸŽ

๐ผ๐Ÿ

๐ผ๐Ÿ

๐ผ๐Ÿ‘

๐‘†0

๐‘†1

๐‘บ๐ŸŽ ๐‘บ๐Ÿ ๐’

0 0 ๐ผ๐ŸŽ

0 1 ๐ผ๐Ÿ

1 0 ๐ผ๐Ÿ

1 1 ๐ผ๐Ÿ‘

25

Functional

form

Can you sketch the logic

diagram of an 8ร—1

multiplexer?

8ร—1 LINE MULTIPLEXER

โ€ข I am now giving you 5 minutes to attempt sketching the logic diagram of an 8ร—1 line multiplexer

โ€ข After these 5 minutes, the lecture will continue

26

8ร—1 LINE MULTIPLEXER

27

28

MULTIPLEXERS AS GENERAL-PURPOSE LOGIC

โ€ข A 2๐‘›โˆ’1: 1 multiplexer can implement any function of

๐‘› variables

โ€ข Steps:

1. The Boolean function is listed in a truth table

2. The first ๐‘› โˆ’ 1 variables in the table are applied

to the selection inputs of the MUX

3. For each combination of the selection variables,

evaluate the output as a function of the last

variable

4. The values are then applied to the data inputs in

the proper order

29

MULTIPLEXERS AS GENERAL-PURPOSE LOGIC: EXAMPLE I

๐น ๐‘ฅ, ๐‘ฆ, ๐‘ง = ฮฃ(1,2,6,7)

๐น

๐‘ฆ

๐‘ฅ

๐‘ง

๐‘งโ€ฒ

0

1

๐น

๐ถ

๐ด

๐ท

0

1

๐ต

30

MULTIPLEXERS AS GENERAL-PURPOSE LOGIC: EXAMPLE II

๐น ๐ด, ๐ต, ๐ถ, ๐ท = ฮฃ(1,3,4,11,12,13,14,15)

31

THREE-STATE BUFFERS (TRI-STATE BUFFERS)

โ€ข These are digital circuits that exhibit three states

โ€ข Two of these states are logic 0 and logic 1

โ€ข The third state is a high-impedance state in which:

1. The logic behaves like an open circuit

2. The circuit has no logic significance

3. The circuit connected to the output of the three-

state gate is not affected by the inputs to the gate

32

MULTIPLEXERS USING THREE-STATE BUFFERS

๐ด

๐ต

๐‘†๐‘’๐‘™๐‘’๐‘๐‘ก

๐‘†๐‘’๐‘™๐‘’๐‘๐‘ก

๐ธ๐‘›๐‘Ž๐‘๐‘™๐‘’

๐ผ๐ŸŽ

๐ผ๐Ÿ

๐ผ๐Ÿ

๐ผ๐Ÿ‘

๐‘Œ

๐‘Œ

2 ร— 1 line MUX 4 ร— 1 line MUX

top related