52
FUNCTIONS OF COMBINATIONAL LOGIC

Functions of Combinational Logic · •An encoder is a combinational logic ckt that essentially performs a “reverse” decoder function. •An encoder accepts an active level on

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Functions of Combinational Logic · •An encoder is a combinational logic ckt that essentially performs a “reverse” decoder function. •An encoder accepts an active level on

FUNCTIONS OF

COMBINATIONAL LOGIC

Page 2: Functions of Combinational Logic · •An encoder is a combinational logic ckt that essentially performs a “reverse” decoder function. •An encoder accepts an active level on

Agenda

•Adders

•Comparators

•Decoders

•Encoders

•Multiplexers

•Demultiplexers

Page 3: Functions of Combinational Logic · •An encoder is a combinational logic ckt that essentially performs a “reverse” decoder function. •An encoder accepts an active level on

Adders

Page 4: Functions of Combinational Logic · •An encoder is a combinational logic ckt that essentially performs a “reverse” decoder function. •An encoder accepts an active level on

Basic Adders

•Adders are important in

•computers

•other types of digital systems in

which numerical data are processed

•We must know about adders.

Page 5: Functions of Combinational Logic · •An encoder is a combinational logic ckt that essentially performs a “reverse” decoder function. •An encoder accepts an active level on

The Half-Adder

• Basic rule for binary addition.

• The operations are performed by a logic

called a half-adder.

Page 6: Functions of Combinational Logic · •An encoder is a combinational logic ckt that essentially performs a “reverse” decoder function. •An encoder accepts an active level on

The Half-Adder

• The half-adder accepts two

binary digits on its inputs and

produces two binary digits on its

outputs, a sum bit and a carry bit.

Page 7: Functions of Combinational Logic · •An encoder is a combinational logic ckt that essentially performs a “reverse” decoder function. •An encoder accepts an active level on

The Full-Adder • The full-adder accepts two

input bits and an input carry

and generates a sum output

and an output carry.

Page 8: Functions of Combinational Logic · •An encoder is a combinational logic ckt that essentially performs a “reverse” decoder function. •An encoder accepts an active level on

Full-Adder Logic

Page 9: Functions of Combinational Logic · •An encoder is a combinational logic ckt that essentially performs a “reverse” decoder function. •An encoder accepts an active level on

The Full-Adder

Page 10: Functions of Combinational Logic · •An encoder is a combinational logic ckt that essentially performs a “reverse” decoder function. •An encoder accepts an active level on

Parallel Binary Adders • Two or more full adders are connected to form

parallel binary adders.

• To add two binary numbers, a full-adder is required

for each bit in the numbers.

• So, for 2-bit numbers, two adders are needed.

Page 11: Functions of Combinational Logic · •An encoder is a combinational logic ckt that essentially performs a “reverse” decoder function. •An encoder accepts an active level on

Parallel Binary Adders • The carry output of each adder is

connected to the carry input of the next

higher-order adder.

Page 12: Functions of Combinational Logic · •An encoder is a combinational logic ckt that essentially performs a “reverse” decoder function. •An encoder accepts an active level on

Four-Bit Parallel Adders • A group of 4 bits is called a nibble. A

basic 4-bit parallel adder is implemented

with four full-adder stages as shown.

Page 13: Functions of Combinational Logic · •An encoder is a combinational logic ckt that essentially performs a “reverse” decoder function. •An encoder accepts an active level on

Four-Bit Parallel Adders

The carry output of each adder

is connected to the carry input

of the next higher-order adder

as indicated. These are called

internal carries.

Page 14: Functions of Combinational Logic · •An encoder is a combinational logic ckt that essentially performs a “reverse” decoder function. •An encoder accepts an active level on

Ripple Carry Adders • Ripple carry adder

Page 15: Functions of Combinational Logic · •An encoder is a combinational logic ckt that essentially performs a “reverse” decoder function. •An encoder accepts an active level on

Look-Ahead Carry Adders

Page 16: Functions of Combinational Logic · •An encoder is a combinational logic ckt that essentially performs a “reverse” decoder function. •An encoder accepts an active level on

Look-Ahead Carry Adders

• Carry generation occurs

when an output carry is

produced (generated)

internally by the full-adder.

• A carry is generated only

when both input bits are

1s.

• The generated carry, Cg,

is expressed as the AND

function of the two input

bits, A and B.

Cg=AB

Page 17: Functions of Combinational Logic · •An encoder is a combinational logic ckt that essentially performs a “reverse” decoder function. •An encoder accepts an active level on

Look-Ahead Carry Adders • Carry propagation occurs when the input carry is rippled to become the output carry.

• An input carry may be propagated by the full-adder when either or both of the input bits are 1s.

• The propagated carry, Cp, is expressed as the OR function of the two input bits.

Cp=A+B

Page 18: Functions of Combinational Logic · •An encoder is a combinational logic ckt that essentially performs a “reverse” decoder function. •An encoder accepts an active level on

Confuse? Check this out…

Page 19: Functions of Combinational Logic · •An encoder is a combinational logic ckt that essentially performs a “reverse” decoder function. •An encoder accepts an active level on

Look-Ahead Carry Adders • The output carry (Cout) of a full-adder can be expressed in

terms of both:

• the generated carry (Cg), and

• the propagated carry (Cp).

• The relationship of the carries is expressed as:

Cout = Cg + Cp Cin

Page 20: Functions of Combinational Logic · •An encoder is a combinational logic ckt that essentially performs a “reverse” decoder function. •An encoder accepts an active level on

Look-Ahead Carry Adders

Page 21: Functions of Combinational Logic · •An encoder is a combinational logic ckt that essentially performs a “reverse” decoder function. •An encoder accepts an active level on

Look-Ahead Carry Adders

Page 22: Functions of Combinational Logic · •An encoder is a combinational logic ckt that essentially performs a “reverse” decoder function. •An encoder accepts an active level on

Look-Ahead Carry Adders

Page 23: Functions of Combinational Logic · •An encoder is a combinational logic ckt that essentially performs a “reverse” decoder function. •An encoder accepts an active level on

Comparators

Page 24: Functions of Combinational Logic · •An encoder is a combinational logic ckt that essentially performs a “reverse” decoder function. •An encoder accepts an active level on

Comparators

•To compare the magnitude of two

binary quantities to determine the

relationship of those quantities.

• The simplest form a comparator

determines whether two numbers are

equal.

Page 25: Functions of Combinational Logic · •An encoder is a combinational logic ckt that essentially performs a “reverse” decoder function. •An encoder accepts an active level on

• XOR gate can be used as a 2-bit comparator.

• To compare binary numbers containing two bits each:

Equality

Page 26: Functions of Combinational Logic · •An encoder is a combinational logic ckt that essentially performs a “reverse” decoder function. •An encoder accepts an active level on

Inequality • Many IC comparators provide additional

outputs that indicate which of the two

binary numbers being compared is the

larger.

Page 27: Functions of Combinational Logic · •An encoder is a combinational logic ckt that essentially performs a “reverse” decoder function. •An encoder accepts an active level on

Inequality

• To determine an inequality

of binary numbers A and B,

you first examine the

highest-order bit in each

number:

• If A3=1 and B3=0 number A is

greater than number B

• If A3=0 and B3=1 number A is

less than number B

• If A3=B3 you must examine

the next lower bit position for

an equality

Page 28: Functions of Combinational Logic · •An encoder is a combinational logic ckt that essentially performs a “reverse” decoder function. •An encoder accepts an active level on

Decoders

Page 29: Functions of Combinational Logic · •An encoder is a combinational logic ckt that essentially performs a “reverse” decoder function. •An encoder accepts an active level on

Decoders • A decoder detects the presence of a

specified combination of bits (code) on

its inputs and indicates the presence of

that code by a specified output level.

• In its general form, a decoder has n input

lines to handle n bits and forms one to 2n

output lines to indicate the presence of one

or more n-bit combinations.

Page 30: Functions of Combinational Logic · •An encoder is a combinational logic ckt that essentially performs a “reverse” decoder function. •An encoder accepts an active level on

The Basic Binary Decoder • Suppose we need to determine when a

binary 1001 occurs on the inputs of a digital.

Page 31: Functions of Combinational Logic · •An encoder is a combinational logic ckt that essentially performs a “reverse” decoder function. •An encoder accepts an active level on

The 4-Bit Decoder • In order to decode all possible combinations of four bits, 16 decoding gates are required (24=16).

• This type of decoder is commonly called either: • A 4-line-to-16-line decoder, or

• A 1-of-16 decoder

• Decoding functions and truth table for a 4-line-to-16-line decoder with active-LOW outputs see the next slide.

Page 32: Functions of Combinational Logic · •An encoder is a combinational logic ckt that essentially performs a “reverse” decoder function. •An encoder accepts an active level on

The 4-Bit Decoder

Page 33: Functions of Combinational Logic · •An encoder is a combinational logic ckt that essentially performs a “reverse” decoder function. •An encoder accepts an active level on

The 4-Bit Decoder

74HC154: 1-of-16 decoder

Page 34: Functions of Combinational Logic · •An encoder is a combinational logic ckt that essentially performs a “reverse” decoder function. •An encoder accepts an active level on

The BCD-to-Decimal Decoder

• The BCD-to-decimal converts each BCD code into one of ten possible decimal digit indications.

• Called 4-line-to-10-line decoder or 1-of-10 decoder

Page 35: Functions of Combinational Logic · •An encoder is a combinational logic ckt that essentially performs a “reverse” decoder function. •An encoder accepts an active level on

The BCD-to-Decimal Decoder

Page 36: Functions of Combinational Logic · •An encoder is a combinational logic ckt that essentially performs a “reverse” decoder function. •An encoder accepts an active level on

The BCD-to-7-Segment Decoder

• The BCD-to-7-segment

decoder accepts the BCD

code on its inputs and

provides outputs to drive

7-segment display devices

to produce a decimal

readout.

Page 37: Functions of Combinational Logic · •An encoder is a combinational logic ckt that essentially performs a “reverse” decoder function. •An encoder accepts an active level on

The BCD-to-7-Segment Decoder (The Application)

Page 38: Functions of Combinational Logic · •An encoder is a combinational logic ckt that essentially performs a “reverse” decoder function. •An encoder accepts an active level on

Encoders

Page 39: Functions of Combinational Logic · •An encoder is a combinational logic ckt that essentially performs a “reverse” decoder function. •An encoder accepts an active level on

Encoders • An encoder is a combinational logic ckt that

essentially performs a “reverse” decoder

function.

• An encoder accepts an active level on one

of its inputs representing a digit, such as a

decimal or octal digit, and converts it to a

coded output such as BCD or binary.

• Encoders can also be devised to encode

various symbols and alphabetic characters.

Page 40: Functions of Combinational Logic · •An encoder is a combinational logic ckt that essentially performs a “reverse” decoder function. •An encoder accepts an active level on

The Decimal-to-BCD Encoder

• It has 10 inputs and 4

outputs

corresponding to the

BCD code.

• A3 = 8+9

• A2 = 4+5+6+7

• A1 = 2+3+6+7

• A0 = 1+3+5+7+9

Page 41: Functions of Combinational Logic · •An encoder is a combinational logic ckt that essentially performs a “reverse” decoder function. •An encoder accepts an active level on

The Decimal-to-BCD Encoder

NOTE: A 0-digit input is not needed because

the BCD outputs are all LOW when there are

no HIGH input.

Page 42: Functions of Combinational Logic · •An encoder is a combinational logic ckt that essentially performs a “reverse” decoder function. •An encoder accepts an active level on

The Decimal-to-BCD Encoder (The Application)

Page 43: Functions of Combinational Logic · •An encoder is a combinational logic ckt that essentially performs a “reverse” decoder function. •An encoder accepts an active level on

Code Converters

Page 44: Functions of Combinational Logic · •An encoder is a combinational logic ckt that essentially performs a “reverse” decoder function. •An encoder accepts an active level on

Code Converters • Binary-to-gray & gray-to-binary conversion

Page 45: Functions of Combinational Logic · •An encoder is a combinational logic ckt that essentially performs a “reverse” decoder function. •An encoder accepts an active level on

Multiplexers

Page 46: Functions of Combinational Logic · •An encoder is a combinational logic ckt that essentially performs a “reverse” decoder function. •An encoder accepts an active level on

Multiplexers (Data Selectors)

• A MUX is a device that allows digital information

from several sources to be routed onto a single

line for data transmission over that line to a

common destination.

• The basic MUX has several data-input lines and a

single output line.

• It also has data-select inputs, which permit digital

data on any one of the inputs to be switched to

the output line.

Page 47: Functions of Combinational Logic · •An encoder is a combinational logic ckt that essentially performs a “reverse” decoder function. •An encoder accepts an active level on

Multiplexers (Data Selectors)

Page 48: Functions of Combinational Logic · •An encoder is a combinational logic ckt that essentially performs a “reverse” decoder function. •An encoder accepts an active level on

Multiplexers (Data Selectors)

Page 49: Functions of Combinational Logic · •An encoder is a combinational logic ckt that essentially performs a “reverse” decoder function. •An encoder accepts an active level on

Multiplexers (Data Selectors)

Page 50: Functions of Combinational Logic · •An encoder is a combinational logic ckt that essentially performs a “reverse” decoder function. •An encoder accepts an active level on

Demultiplexers

Page 51: Functions of Combinational Logic · •An encoder is a combinational logic ckt that essentially performs a “reverse” decoder function. •An encoder accepts an active level on

Demultiplexers • A DEMUX basically

reverses the MUX

function.

• It takes digital

information from one line

and distributes it to a

given number of output

lines.

• It also known as data

distributor.

Page 52: Functions of Combinational Logic · •An encoder is a combinational logic ckt that essentially performs a “reverse” decoder function. •An encoder accepts an active level on

Demultiplexers