functions of com bi national logic

68
Functions of combinational Logic By Makeleni Siyanda

Upload: samyong20

Post on 22-Nov-2014

38 views

Category:

Documents


1 download

DESCRIPTION

Functions of Combinational Logic

TRANSCRIPT

Page 1: Functions of Com Bi National Logic

Functions of combinational Logic

By Makeleni Siyanda

Page 2: Functions of Com Bi National Logic

“Who is wise? He that learns from everyone.

Who is powerful? He that governs his passion.

Who is rich? He that is content.Who is that? Nobody.”By- Benjamin Franklin

Page 3: Functions of Com Bi National Logic

Section Objectives Distinguish between half-adder and full-adders. Use full-adders to implement multibit parallel binary

adders. Explain the differences between ripple carry and look-

ahead carry parallel adders. Use the magnitude comparator to determine the

relationship between two binary numbers and use cascaded comparators to handle the comparison of larger numbers.

Implement a basic binary decoder. Use BCD-to-7-segement decoders in display systems. Apply a decimal-to-BCD priority encoder in a simple

keyboard application.

Page 4: Functions of Com Bi National Logic

Convert from BCD to binary, binary to Gray code, and Gray code to binary by using logic devices.

Apply multiplexers in data selection, multiplexed displays, logic function generation, simple communications systems.

Used decoders as demultiplexers. Explain the meaning of parity. Use parity generators and checkers to detect bit

errors in digital systems. Implement a simple data communications

system. Identify glitches, common bugs in digital systems.

Page 5: Functions of Com Bi National Logic

Basic Adders

Adders are important both in computers and any digital systems where numerical data processed.

Two common types: half adders. full adders.

Page 6: Functions of Com Bi National Logic

Half-adder

Half-adder accepts two binary digits on its inputs and produces two binary digits on its outputs, a sum bit and carry bit.

Page 7: Functions of Com Bi National Logic

Full-Adder

The full-adder accepts three inputs including an input carry and generates a sum and output carry.

Basic difference between a full-adder and a half-adder is that the full-adder accepts an input carry.

A logic symbol for full-adder is shown below.

Page 8: Functions of Com Bi National Logic
Page 9: Functions of Com Bi National Logic
Page 10: Functions of Com Bi National Logic
Page 11: Functions of Com Bi National Logic

Parallel Binary Adder

The previous full-adder take care of two single bit e.g. A and B.

To add Binary number with more than one bits, additional adder are needed.e.g. When one binary number is added to another, each column generates a sum bit and a 1 or 0 carry bit to the next column to the left, as illustrated below

Page 12: Functions of Com Bi National Logic
Page 13: Functions of Com Bi National Logic
Page 14: Functions of Com Bi National Logic

Four-Bit Parallel Adder

A basic 4-bit binary parallel adder is implemented with full-adders as shown below.

Page 15: Functions of Com Bi National Logic
Page 16: Functions of Com Bi National Logic

Examples of 4-bit parallel adders are 74LS83A and74LS283 low-power schottky TTL device. The differences between the two is the pin number.

Page 17: Functions of Com Bi National Logic

Adder Expansion

The 4-bit parallel adder can be expanded to handle the addition of two 8-bit numbers by using two 4-bit adders and connecting the carry input of the least significant adder to ground because there is no carry into least significant bit position and by connecting the carry output of least significant adder to the carry input of the most significant adder. This process is called cascading.

Page 18: Functions of Com Bi National Logic
Page 19: Functions of Com Bi National Logic

Adder-Application

An example of full-adder and parallel adders application is a simple voting system that can be used to simultaneously provide Yes or No vote.

Page 20: Functions of Com Bi National Logic
Page 21: Functions of Com Bi National Logic
Page 22: Functions of Com Bi National Logic

Comparators

The basic function of a comparator is to compare the magnitudes of two quantities to determine the relationship of those quantities. In its simplest form, a comparator circuit determines whether two numbers are equal.

The exclusive-OR gate can be used as a basic comparator because it output is 1 if the two input bits are not equal and a 0 if the input bits are equal.

Page 23: Functions of Com Bi National Logic

In order to compare binary numbers containing two bits each, an additional exclusive-OR gate is necessary. Two LSBs of two numbers are compared by gate G1, and the two MSBs are compared by gate G2, as shown in fig.6-20

In fig.6-20,the output of exclusive-OR gate is 1 when the two input are not equal and 0 when equal.

Inverter and AND gates are used to provide equality or inequality in the inputs of each gate

Page 24: Functions of Com Bi National Logic
Page 25: Functions of Com Bi National Logic
Page 26: Functions of Com Bi National Logic

Integrated Circuit Comparator In addition to the equality output,

many IC comparators provide additional output such as greater than, less than and equal to.

Page 27: Functions of Com Bi National Logic

To determine an inequality of A and B in two 4-bit binary. steps are as follows:

We 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, then we must examine the next lower bit position for an inequality.

Page 28: Functions of Com Bi National Logic

Example

Let A be 0 1 1 1 and B is 1 0 0 0. Comparing A3 and B3 indicates that A<B because A3=0 and B3=1. In this case ignore the lower bit because the A<B has been established.

Let A be 1 1 1 0 and B is 1 0 0 1. Since both the A3 and B3 are equal, then consider the lower bits A2=1 and B2=0, A>B , Ignore the next lower bits.

Case 3, lf A is 1 1 1 0 and B is 1 1 1 1.Here all the bits are equal except the LSBs A0=0 and B0=1 indicate A<B

Page 29: Functions of Com Bi National Logic

Analyze the comparator operation in Fig.6-24 for the numbers A3A2A1A0=1010 and B3B2B1B0=1001.

Page 30: Functions of Com Bi National Logic

The 7485 4-Bit Magnitude Comparator

The 7485 is an MSI comparator that is also available in the LS TTL family.

Page 31: Functions of Com Bi National Logic

To expand the comparator, the A>B, A=B, and A<B outputs of the less significant comparator are connected to the corresponding cascading inputs of the next higher comparator.

The least significant must have a HIGH on the A=B input and LOWs on the A<B and A>B inputs.

Page 32: Functions of Com Bi National Logic
Page 33: Functions of Com Bi National Logic

DECODERS

The basic function of a decoder is to detect the presence of a specified combination of bits(code) on its inputs and to indicate 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 from one to 2n

Output lines to indicate the presence of one or more n-bit combinations.

Page 34: Functions of Com Bi National Logic

Basic Binary Decoder

Suppose we need binary 1001 occurs on the inputs of a digital circuit. We can set the output signature to be 1 or 0 for the input of such numbers.

Page 35: Functions of Com Bi National Logic
Page 36: Functions of Com Bi National Logic

The 4-Bit Binary Decoder

In order to decode all possible combinations of four bits, sixteen decoding gates are required (2^4=16). This type of decoder is called a 4-line-to-16-line decoder because there are four inputs and sixteen outputs .Table 6-5 shows a general table of 4-line-to-16-line decoder.

Figure 6-31 show BIN/DEC i.e. binary input makes a corresponding to decimal output.

Page 37: Functions of Com Bi National Logic
Page 38: Functions of Com Bi National Logic
Page 39: Functions of Com Bi National Logic

A good example of 4-line-to-16-line decoder is 74154 and 74HC154 for MSI LS TTL and CMOS family respectively.

The input label 1,2,4, and 8 represent the binary weights of the input bits 2^3,2^2,2^1,2^0.

Page 40: Functions of Com Bi National Logic
Page 41: Functions of Com Bi National Logic
Page 42: Functions of Com Bi National Logic

BCD-to-Decimal Decoder

The BCD-to-decimal decoder converts each BCD code(8421 code) into one of ten possible decimal digit indications. It is referred to as a 4-line-to-10-line decoder or a 1-of-10 decoder.

The BCD codes represents only the ten decimal digits 0 through 9.

Page 43: Functions of Com Bi National Logic

To display numeric information, a device called a seven-segment display unit may be used. The device is shown below. It is made up of seven LEDs. The LED may turn on if it is activated.

To display a certain number, the appropriate segment must be activated.

The segments are labeled A, B , C , D , E , F and G. For example, to display a 0 ,segments A,B,C,D,,E

and F must be activated. Segment G must not be activated.

The table below also show the relationship between BCD and the seven-segment code

Page 44: Functions of Com Bi National Logic
Page 45: Functions of Com Bi National Logic

IC 7447 BCD-to-seven-segment code decoder, connected to a display unit.

Page 46: Functions of Com Bi National Logic

Encoders An encoder is a combinational logic circuit

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. The process of converting from familiar symbols or numbers to a coded format is called encoding.

Page 47: Functions of Com Bi National Logic

The Decimal-to-BCD Encoder This type of encoder has ten inputs-

one for each decimal digit-and four outputs corresponding to the BCD code, as shown below.

Page 48: Functions of Com Bi National Logic

Read 74147 Decimal-to-BCD Encoder The Decimal-to-BCD priority Encoder The 74148 Octal-to-Binary Encoder Note : you must write a short note

on each inside your tutorial book.

Page 49: Functions of Com Bi National Logic

Code Converters

BCD-to-Binary Conversion The binary numbers representing the

weights of the BCD bits are summed to produce the total binary number.

Let consider decimal number 87 and expressed in BCD as 1000 0111

Page 50: Functions of Com Bi National Logic

The left most represent 80 while the right 4-bits represent 7.

ten digit units digit

Weight 80 40 20 10 8 4 2 1

Bit designation B3 B2 B1 B0 A3A2A1A0

Page 51: Functions of Com Bi National Logic

Example

Page 52: Functions of Com Bi National Logic

Binary Coded Decimal(BCD) The 8421 code is a type of binary

coded decimal (BCD) code. The designation 8421 indicates the binary weights of the four bits 2^3,2^2,2^1,2^0.

Page 53: Functions of Com Bi National Logic
Page 54: Functions of Com Bi National Logic
Page 55: Functions of Com Bi National Logic
Page 56: Functions of Com Bi National Logic

The Gray Code

The Gray code is unweighted and is not an arithmetic code; that is, there are no specific weights assigned to the bit positions.

Page 57: Functions of Com Bi National Logic
Page 58: Functions of Com Bi National Logic
Page 59: Functions of Com Bi National Logic
Page 60: Functions of Com Bi National Logic

Multiplexers(Data Selector) A multiplexer(MUX) is a device that allows

digital information from several sources to be routed onto a single line for transmission over that line to a common destination. The basic multiplexer 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. Multiplexers are also known as data selector.

Page 61: Functions of Com Bi National Logic

A logic symbol for a 4-input multiplexer (MUX) is shown below. There are two data select bits and four data-input lines.

Page 62: Functions of Com Bi National Logic
Page 63: Functions of Com Bi National Logic
Page 64: Functions of Com Bi National Logic

Demultiplexers

A demultiplexer(DMUX)basically reverses the multiplexing function. It takes data from one line and distributes them to a given number of output lines. For this reason, the demultiplexer is also known as a data distributor. Decoder can also be used as demultiplexers.

Page 65: Functions of Com Bi National Logic
Page 66: Functions of Com Bi National Logic

Example

Page 67: Functions of Com Bi National Logic
Page 68: Functions of Com Bi National Logic

THANKS