code converters, multiplexers and demultiplexers

36
Code Converters, Multiplexers and Demultiplexers

Upload: john-oneil-f-quiambao

Post on 29-Nov-2014

225 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Code Converters, Multiplexers and Demultiplexers

Code Converters, Multiplexers and Demultiplexers

Page 2: Code Converters, Multiplexers and Demultiplexers

Introduction

• Information, or data, that is used by digital devices comes in many formats. The mechanisms for the conversion, transfer, and selection of data are handled by combinational logic ICs.

Page 3: Code Converters, Multiplexers and Demultiplexers

COMPARATORS

• A device used to compare the magnitude or size of two binary bit strings or words.

• The basic comparator evaluates two binary strings bit by bit and outputs a 1 if they are exactly equal.

• An XNOR gate is the easiest way to compare the equality of bits ( 0-0 or 1-1 x=1)

Page 4: Code Converters, Multiplexers and Demultiplexers

Binary comparator for comparing two 4-bit binary strings

A0

B0

A1

B1

A2

B2

A3

B3

Out = 1 if

A0 =B0

A1 = B1

A2 = B2

A3 = B3

Page 5: Code Converters, Multiplexers and Demultiplexers

Comparators

• Integrated –circuit magnitude comparators are available in both TTL and CMOS families.

• A magnitude comparator not only determines if A equals B but also if A is greater than B or A is less than B.

• The 7485 is a TTL 4-bit magnitude comparator.

Page 6: Code Converters, Multiplexers and Demultiplexers

7485 TTL comparator

Page 7: Code Converters, Multiplexers and Demultiplexers

Magnitude comparison of two 8-bit binary strings (binary words)

8-bit comparison outputs

Page 8: Code Converters, Multiplexers and Demultiplexers

DECODING

• Process of converting some codes (binary, BCD, or hex) into a singular active output representing its numeric value.

• Decoder – a device that converts a digital code such as hex or octal into a single output representing its numeric value

Page 9: Code Converters, Multiplexers and Demultiplexers

BCD decoder example

Page 10: Code Converters, Multiplexers and Demultiplexers

3-bit Binary-to-Octal DecodingTruth table for an Octal Decoder

(a) Active-HIGH outputs

Input Output

22 21 20 0 1 2 3 4 5 6 7

0 0 0 1 0 0 0 0 0 0 0

0 0 1 0 1 0 0 0 0 0 0

0 1 0 0 0 1 0 0 0 0 0

0 1 1 0 0 0 1 0 0 0 0

1 0 0 0 0 0 0 1 0 0 0

1 0 1 0 0 0 0 0 1 0 0

1 1 0 0 0 0 0 0 0 1 0

1 1 1 0 0 0 0 0 0 0 1

Page 11: Code Converters, Multiplexers and Demultiplexers

3-bit Binary-to-Octal DecodingTruth table for an Octal Decoder

(b) Active-LOW outputs

Input Output

22 21 20 0 1 2 3 4 5 6 7

0 0 0 0 1 1 1 1 1 1 1

0 0 1 1 0 1 1 1 1 1 1

0 1 0 1 1 0 1 1 1 1 1

0 1 1 1 1 1 0 1 1 1 1

1 0 0 1 1 1 1 0 1 1 1

1 0 1 1 1 1 1 1 0 1 1

1 1 0 1 1 1 1 1 1 0 1

1 1 1 1 1 1 1 1 1 1 0

Page 12: Code Converters, Multiplexers and Demultiplexers

3-bit Binary-to-Octal Decoding

Page 13: Code Converters, Multiplexers and Demultiplexers

Decoder ICs

• IC decoder chips provide basic decoding as well as several other useful functions.

• Manufacturer’s data books list several decoders and give function tables illustrating the input/output operation and special functions.

• Rather than designing decoders using combinational logic, it is much more practical to be able to use a data book to find a decoder that you need and to determine the proper pin connections and operating procedure to perform a specific decoding task.

Page 14: Code Converters, Multiplexers and Demultiplexers

Decoder ICs

• Some of popular TTL decoder ICs

Device Number Function

74138 1-of-8 octal decoder (3-line-to-8-line)

7442 1-of-10 BCD decoder (4-line-to-10-line)

74154 1-of-16 hex decoder (4-line-to-16-line)

7447 BCD-to-seven-segment decoder

Page 15: Code Converters, Multiplexers and Demultiplexers

ENCODING

• Encoder – a device that converts a weighted numeric input line to an equivalent digital code, such as hex or octal.

• Encoding – used to generate a coded output (such as BCD or binary) from a singular active numeric input line.

Page 16: Code Converters, Multiplexers and Demultiplexers

Encoders

Typical block diagrams for encoders:

a. decimal-to-BCD encoder; b. octal-to-binary encoder

Binary outputs

Page 17: Code Converters, Multiplexers and Demultiplexers

Decimal-to BCD encoder truth tableDecimal

InputBCD output

D C B A

0 0 0 0 0

1 0 0 0 1

2 0 0 1 0

3 0 0 1 1

4 0 1 0 0

5 0 1 0 1

6 0 1 1 0

7 0 1 1 1

8 1 0 0 0

9 1 0 0 1

Page 18: Code Converters, Multiplexers and Demultiplexers

Basic decimal-to-BCD encoder

Page 19: Code Converters, Multiplexers and Demultiplexers

CODE CONVERTERS

• Code converter – a device that converts one type of binary representation to another, such as BCD to binary or binary to Gray code.

• BCD is very important for visual display communication between a computer and human beings. But BCD is very difficult to deal with arithmetically.

• Algorithms, or procedures, have been developed for the conversion of BCD to binary by computer programs (software) so that the computer will be able to perform all arithmetic operations in binary.

• Another way to convert BCD to binary, the hardware approach, is with MSI ICs. Additional circuitry is involved, but it is much faster to convert using hardware than software. (74184)

Page 20: Code Converters, Multiplexers and Demultiplexers

BCD-to-Binary Conversion

• If you are going to convert BCD to binary using software program statements, you would first have to develop a procedure, or algorithm, for the conversion.

Page 21: Code Converters, Multiplexers and Demultiplexers

BCD-to-Seven-Segment Converters

• Calculators and other devices with numeric displays use another form of code conversion involving BCD-to-seven-segment conversion.

• The term seven segment comes from the fact that these displays utilize seven different illuminating segments to make up each of the 10 possible numeric digit.

• A code converter must be employed to convert the 4-bit BCD into a 7-bit code to drive each digit.

• A commonly used BCD-to-seven-segment converter is the 7447 IC.

Page 22: Code Converters, Multiplexers and Demultiplexers

Gray Code

• Gray code – a binary coding system used primarily in rotating machinery to indicate shaft position. Each successive binary string within the code changes by only 1 bit.

• It is used primarily for indicating the angular position of a shaft on rotating machinery, such as automated lathes and drill presses.

• This code is like binary in that it can have as many bits as necessary, and the more bits, the more possible combinations of output codes (number of combinations = 2N).

• A 4-bit Gray code, for example, has 24 = 16 different representations, giving a resolution of 1 out of 16 possible angular positions at 22.5° each (360/16 = 22.5).

Page 23: Code Converters, Multiplexers and Demultiplexers

Four-Bit Gray Code

Page 24: Code Converters, Multiplexers and Demultiplexers

Gray Code Conversions

• The determination of the Gray code equivalents and the conversions between Gray code and binary code are done very simply with XOR gates.

Binary-to-Gray code converter Gray code-to-Binary converter

Page 25: Code Converters, Multiplexers and Demultiplexers

MULTIPLEXERS

• Multiplexer – a device or circuit capable of selecting one of several data input lines for output to a single line; sometimes referred to as data selector.

• It is capable of funneling several data lines into a single line for transmission to another point.

• The multiplexer has two or more digital input signals connected to its input.

• Control signal are also input to tell which data-input line to select fro transmission (data selection).

Page 26: Code Converters, Multiplexers and Demultiplexers

Functional diagram of a 4-line multiplexer

Page 27: Code Converters, Multiplexers and Demultiplexers

Logic diagram for a 4-line multiplexer

Page 28: Code Converters, Multiplexers and Demultiplexers

TTL and CMOS Multiplexers

Function Device Logic Family

Quad two-input 74157 TTL

74HC157 H-CMOS

4019 CMOS

Dual eight-input 74153 TTL

74HC153 H-CMOS

4539 CMOS

Eight-input 74151 TTL

74HC151 H-CMOS

4512 CMOS

Sixteen-input 74150 TTL

Page 29: Code Converters, Multiplexers and Demultiplexers

Providing Logic Functions with a Multiplexer

• Multiplexers have many other uses besides functioning as data selectors. Another important role of a multiplexer is for implementing combinational logic circuits.

• One multiplexer can take the place of several Small-Scale Integration (SS) logic gates.

Page 30: Code Converters, Multiplexers and Demultiplexers

Providing Combinational Logic Functions with a Multiplexer

Page 31: Code Converters, Multiplexers and Demultiplexers

DEMULTIPLEXERS

• Demultiplexer – a device or circuit capable of routing a single data-input line to one of several data-output lines; sometimes referred to as data distributor.

• It is the opposite procedure from multiplexing. It takes a single input data value and routes it to one of several outputs.

Page 32: Code Converters, Multiplexers and Demultiplexers

Functional diagram of a 4-line demultiplexer

Page 33: Code Converters, Multiplexers and Demultiplexers

The 74139 dual 4-line demultiplexer

Page 34: Code Converters, Multiplexers and Demultiplexers

Connections to route an input data signal to the 2a output of a 74139

Page 35: Code Converters, Multiplexers and Demultiplexers

Analog Multiplexer/Demultiplexer

• Several MUX/DEMUX are available in the CMOS family.

• The 4051, 4052, and 4053 are combination multiplexer and demultiplexer CMOS ICs.

• They can function in either configuration because their inputs and outputs are bidirectional, meaning that the flow can go in either direction.

• Also, they are analog, meaning that they can input and output levels other than just 1 and 0. The I/O levels can be any analog voltage between the positive and negative supply levels.

Page 36: Code Converters, Multiplexers and Demultiplexers

The 4051 CMOS analog

multiplexer/demultiplexer