philadelphia university faculty of information technology ... · faculty of information technology...

82
Philadelphia University Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1

Upload: others

Post on 07-Oct-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Philadelphia University

Faculty of Information Technology

Department of Computer Science

Computer Logic Design

Dareen Hamoudeh 1

Page 2: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

2

Introduction

Logic Circuits:

1) Combinational Logic:

Output only depends on current input.

2) Sequential Logic :

(employ memory elements + Logic Gates) Output

depends on current and previous inputs.

Dareen Hamoudeh

Page 3: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Combinational Logic

• Combinational circuit is circuit in which we combine thedifferent gates in the circuit for example encoder, decoder,multiplexer and de-multiplexer. Some of the characteristics ofcombinational circuits are:– The output of combinational circuit at any instant of time, depends only on

the levels present at input terminals.

– The combinational circuit do not use any memory. The previous state of input does not have any effect on the present state of the circuit.

– A combinational circuit can have a n number of inputs and m number of outputs.

3Dareen Hamoudeh

Page 4: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Design Procedure

1. Determine the number of inputs and outputs.

2. Derive the truth table.

3. Obtain the simplified Boolean Function (using K-map).

4. Draw the logic diagram.

4Dareen Hamoudeh

Page 5: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

ADDERS

5Dareen Hamoudeh

Page 6: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Adders

Dareen Hamoudeh 6

Page 7: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Adders

Dareen Hamoudeh 7

Page 8: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Half Adder

Dareen Hamoudeh 8

Page 9: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Half Adder

9Dareen Hamoudeh

First:

Page 10: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Half Adder

Second:

Truth Table

Third, simplified functions(using k-map):

S=x’y+xy’ C=xy

Dareen Hamoudeh 10

Page 11: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

11Dareen Hamoudeh

Half Adder

Fourth:

Page 12: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Dareen Hamoudeh 12

Half Adder

We can Combine circuits using XOR-gate

Page 13: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Full Adder

Dareen Hamoudeh 13

Page 14: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Full Adder

• Full adder is developed to overcome the drawback of Half Adder circuit.

• It can add two one-bit numbers A and B, and carry c.

• The full adder is a three input and two output combinational circuit.

Dareen Hamoudeh 14

Page 15: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Full Adder

Dareen Hamoudeh 15

Page 16: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Full Adder

Truth Table:

16Dareen Hamoudeh

Page 17: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

17

Full Adder

Dareen Hamoudeh

Simplified functions

Page 18: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

18

Full Adder

Dareen Hamoudeh

Circuits:

Page 19: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Dareen Hamoudeh 19

Full Adder

To Combine circuits using XOR-gate

Page 20: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

20

Full Adder Circuit

Half adders

Dareen Hamoudeh

Page 21: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Dareen Hamoudeh 21

4-bit Adder Circuit

• A Full adder is used to add two (1-bit) numbers.

Like 1+ 0

• If we want to sum two (4-bit) numbers: like 1110+ 1011

• We use 4 (1-bit)adders.

Page 22: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Dareen Hamoudeh 22

Example: 4-bit addition

• If we want to find A+B, where A=1011 , B=1110

1 1 0

A = 1 0 1 1

+

B = 1 1 1 0

1 1 0 0 1

carrycarrycarry

carry

To implement this We use:

Full Adder

1

Full Adder

2

Full Adder

3

Full Adder

4

Page 23: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Philadelphia University

Example: 4-bit addition– Find A+B, where A=1011 (eleven), B=1110 (fourteen).

1 1 1 0 1 1 0 1

0

1. Fill in all the inputs, including CI=0

1 1

5. Use C3 to compute CO and S3 (1 + 1 + 1 = 11)

0

2. The circuit produces C1 and S0 (1 + 0 + 0 = 01)

1

1

3. Use C1 to find C2 and S1 (1 + 1 + 0 = 10)

0

1

4. Use C2 to compute C3 and S2 (0 + 1 + 1 = 10)

0

Woohoo! The final answer is 11001 (twenty-five).

Page 24: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Philadelphia University

A 4-bit adder

• Four full adders together make a 4-bit adder.

• There are nine total inputs:

– Two 4-bit numbers, A3 A2 A1 A0 and B3 B2 B1 B0

– An initial carry in, Ci

• The five outputs are:

– A 4-bit sum, S3 S2 S1 S0

– A carry out, Co

Page 25: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Subtractor

Dareen Hamoudeh 25

Page 26: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Subtractor

• A subtractor can be designed using the same approach as that of an adder.

• As with an adder, in the general case of calculations on multi-bit numbers, three bits are involved in performing the subtraction for each bit of the difference:– minuend (A)

– subtrahend (B)

– borrow in from the previous (less significant) bit order position (Bri).

• The outputs are the difference bit (Di) and borrow bit (Bri+1)

Dareen Hamoudeh 26

Page 27: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Subtractor

• Half Subtractor:

– combinational circuit which is used to perform subtraction of two bits

• Full Subtractor:

– a combinational circuit which is used to perform subtraction of three bits

Dareen Hamoudeh 27

Page 28: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Half Subtractor

Dareen Hamoudeh 28

Page 29: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Half Subtractor

Truth table:

Simplified functions:• From the above table one can draw the Karnaugh map for “Difference"

and “Borrow“. equations are:

Dareen Hamoudeh 29

Page 30: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Half Subtractor

• Combinational logic diagram:

Dareen Hamoudeh 30

Page 31: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Full Subtractor

Dareen Hamoudeh 31

Page 32: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Full Subtractor

Truth table:

Simplified functions:• From the table one can draw

the Karnaugh map for “Difference" and “Borrow“. equations are:

Dareen Hamoudeh 32

Page 33: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Full Subtractor

• Combinational logic diagram:

Dareen Hamoudeh 33

Page 34: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Adder / Subtractor

Dareen Hamoudeh 34

Page 35: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Binary Subtraction“review”

• Subtraction is done by using complements:

– Where:

2’s Complement of (B)= 1’s Complement of (B)+1

• To find A-B we convert the subtraction by addition:

– A-B= A + (B’+1)

35Dareen Hamoudeh

Page 36: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Adder / Subtractor

A four-bit adder/subtractor demonstration:

• While it is perfectly possible to design a custom circuit for the subtraction operation, it is much more common to re-use an existing adder and to replace a subtraction by a two-complement's addition.

• When the Sub/Add input is low (0):

– XOR-gates act as non-inverting buffers, and the carry-input to the adder is 0.

– Therefore, the adder calculates a four-bit sum plus carry-out:

(Cout,S3,S2,S1,S0) = (A3,A2,A1,A0) + (B3,B2,B1,B0)

• If the Sub/Add input is high (1):

– the XOR-gates act as inverting buffers, and the carry-input to the adder is 1.

– Therefore, the adder performs as a four-bit subtraction:

(Cout,S3,S2,S1,S0) = (A3,A2,A1,A0) - (B3,B2,B1,B0)

36Philadelphia University

Page 37: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Adder / Subtractor

• The circuit has a mode control signal M which determines ifthe circuit is to operate as an adder or a subtractor.

• Each XOR gate receives input M and one of the inputs of B,i.e., Bi. To understand the behavior of XOR gate consider itstruth table given below. If one input of XOR gate is zero thenthe output of XOR will be same as the second input. While ifone input of XOR gate is one then the output of XOR will becomplement of the second input.

• when M = 0, the output of XOR gate will be Bi ⊕ 0 = Bi. If thefull adders receive the value of B, and the input carry C0 is 0,the circuit performs A plus B.

• When M = 1, the output of XOR gate will be Bi ⊕ 1 = Bi’. If the

full adders receive the value of B’, and the input carry C0 is 1,the circuit performs A plus 1’s complement of B plus 1, whichis equal to A minus B

37Philadelphia University

Page 38: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Adder / Subtractor

Dareen Hamoudeh 38

Page 39: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Adder / Subtractor• Find A-B, where A=1111 , B=1101

– First M must be 1

– C4=1, we discard it, the result is (1111)-(1101)= 0010

Dareen Hamoudeh 39

Page 40: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Adder / Subtractor

• remember– The circuit for subtracting A - B consists of an adder with

inverters placed between each data input B and thecorresponding input of the full adder.

– The input carry Co must be equal to 1 when subtraction isperformed.

– The operation thus performed becomes A, plus the 1'scomplement of B, plus 1. this is equal to A plus the 2'scomplement of B.

– For unsigned numbers, that gives A - B if A>=b or the 2’scomplement of ( B - A) if A < B.

– For signed numbers, the result is A - B, provided that thereis no overflow.

40Philadelphia University

Page 41: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

41

4-bit adder subtractor

“Signed Numbers”

Philadelphia University

Page 42: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

42

Questions

Philadelphia University

Page 43: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Decoder

Dareen Hamoudeh 43

Page 44: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Decoder

• A decoder is a device which does the reverse operation of an encoder, undoing the encoding so that the original information can be retrieved.

• It is a combinational circuit that converts binary information from n input lines to a maximum of 2n unique output lines.

• Decoders are sometimes called mintermgenerators

Dareen Hamoudeh 44

Page 45: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Decoder

• Binary Decoders have inputs of 2-bit, 3-bit or 4-bit or 5-bitcodes depending upon the number of data input lines, and an-bit decoder has 2n output lines.

• It is called n-to-2n line decoder.

• if it receives n inputs (usually grouped as a binary or Booleannumber) it activates one and only one of its 2n outputs basedon that input with all other outputs deactivated.

• A decoders output code normally has more bits than its inputcode and practical binary decoder circuits include, 2-to-4, 3-to-8 and 4-to-16 line configurations.

• decoder circuit would be an AND gate because the output ofan AND gate is "High" (1) only when all its inputs are "High."Such output is called as "active High output".

45Philadelphia University

Page 46: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

2-to-4 Binary Decoders

Dareen Hamoudeh 46

Page 47: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

2-to-4 Binary Decoders

• Truth Table:

• Simplified Function for each output:

Dareen Hamoudeh 47

Page 48: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

2-to-4 Binary Decoders

• Combinational Logic Circuit:

Dareen Hamoudeh 48

Page 49: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Example

• If the input is 10, the output is D2

49Philadelphia University

Page 50: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

3-to-8 Binary Decoders

• In the three-to eight decodercircuit, the three inputs aredecoded into eight outputs, eachrepresenting one of the mintermsof the three input variables.

• The three inverters provide thecomplement of the inputs, andeach one of the eight AND gatesgenerates one of the minterms.

• A particular application of thisdecoder is binary - to octalconversion.

Dareen Hamoudeh 50

Page 51: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

3-to-8 Binary Decoders

• Truth Table:

Dareen Hamoudeh 51

Page 52: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

3-to-8 Binary Decoders

• Simplified functions:

Dareen Hamoudeh 52

Page 53: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

3-to-8 Binary Decoders

• Combinational

logic circuit:

Dareen Hamoudeh 53

Page 54: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Example: binary to Octal

• The input variables represent a binary number. and theoutputs represent the eight digits of a number in the octalnumber system.

• However, a three to eight line decoder can be used fordecoding any three bit code to provide eight outputs, one foreach element of the code.

• The operation of the decoder may be clarified by the truthtable.

• For each possible input combination, there are seven outputsthat are equal to 0 and only one that is equal to I.

• The output whose value is equal to 1 represents the mintermsequivalent of the binary number currently available the inputlines.

54Philadelphia University

Page 55: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Decoder Enable Input

• Enable inputs must be on for the decoder to function, otherwise its outputs assume a single "disabled" output code word.

• Decoding is necessary in applications such as data multiplexing, 7 segment display and memory address decoding.

Dareen Hamoudeh 55

Page 56: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Decoder Enable Input

• Some binary decoders have an additional input labeled"Enable" that controls the outputs from the device. Thisallows the decoders outputs to be turned "ON" or "OFF".

• An alternative way of looking at the decoder circuit is to

– inputs A, B and C as address signals. Each combination ofA, B or C defines a unique address which can access alocation having that address.

– Enable Line:

• If enable=0 , decoder is off. It means all output lines arezero

• If enable=1, decoder is on and depending on input, thecorresponding output line is 1, all other lines are 0

56Philadelphia University

Page 57: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Decoder Enable Input

Dareen Hamoudeh 57

• In this table, note that whenever EN=0, the outputs are

always 0, regardless of inputs S1 and S0

We can abbreviate the table by writing x’s in the input

columns for S1 and S0.

Page 58: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

4-to-16 Binary Decoders

• Decoders with enable inputs can be connected together to form a larger decoder circuit.

• We can connect two 3-to-8 Binary Decoders to form 4-to-16 Binary Decoders using the Enable Line as follows:

Dareen Hamoudeh 58

Page 59: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

4-to-16 Binary Decoders

• When E = 0– the top decoder is enabled and the other is disabled.– The bottom decoder outputs all 0's, and the top eight outputs

generate minterm 0000 to 0111.

• When E = 1– the enable conditions are reversed: The bottom decoder outputs

generate minterm I000 to 1111,– the outputs of the top decoder are all 0s.

• This example demonstrates the usefulness of enable inputs indecoders and other combinational logic components.

• In general, enable inputs are a convenient feature forinterconnecting two or more standard components for thepurpose of combining them into a similar function with moreinputs and outputs.

Dareen Hamoudeh 59

Page 60: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Philadelphia University

Decoder With NAND

• The Circuit operates with complemented outputs and acomplement enable input.

• The decoder is enabled when E is equal to 0 (i.e., active-lowenable). As indicated by the truth table, only one output canbe equal to 0 at any given time; all other outputs are equal to1.

• The output whose value is equal to 0 represents the mintermselected by inputs A and B.

• The circuit is disabled when E is equal to 1, regardless of thevalues of the other two inputs. When the circuit is disabled,none of the outputs are equal to 0 and none of the mintermsare selected.

Page 61: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

2-to-4 Binary Decoders with NAND

• A two-to-four decoder with an enable input constructed with NAND gates:

• Truth Table:

Dareen Hamoudeh 61

Page 62: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Philadelphia University

Decoder

• Combinational Circuit:

Page 63: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Decoder Block

• A decoder block provides abstraction:

– You can use the decoder as long as you know its truth table or equations, without knowing exactly what’s inside.

– It makes diagrams simpler by hiding the internal circuitry.

– It simplifies hardware reuse. You don’t have to keep rebuilding the decoder from scratch every time you need it.

• These blocks are like functions in programming!

Dareen Hamoudeh 63

Page 64: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Addition using DecodersDecoder-based adder

• Let’s make a circuit that adds three 1-bit inputs X, Y and Z.

• We will need two bits to represent the total; let’s call them C and S, for “carry” and “sum.” Note that C and S are two separate functions of the same inputs X, Y and Z.

• Here is a truth table and sum-of-minterms equations for C and S.

Dareen Hamoudeh 64

Page 65: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Addition using DecodersDecoder-based adder

• Here, two 3-to-8 decoders implement C and S as sums of minterms.

+5v means that the decoder

always active.

Dareen Hamoudeh 65

Page 66: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Addition using DecodersDecoder-based adder

• the two functions C and S both have the same inputs, we could use just one decoder instead of two.

Dareen Hamoudeh 66

Page 67: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Decoder Application

Dareen Hamoudeh 67

Page 68: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Decoder Application

Seven-segment display

Dareen Hamoudeh 68

Page 69: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

BCDBinary Coded Decimal (BCD):

• When dealing with decimal numbers BCD code is used.

• It is a class of binary encodings of decimal numbers where each decimal digit is represented by a fixed number of bits, usually four or eight, although other sizes (such as six bits) have been used historically. Special bit patterns are sometimes used for a sign or for other indications (e.g., error or overflow).

• BCD's main advantage is its more accurate representation and rounding of decimal quantities as well as an ease of conversion into human-readable representations.

• How are decimal numbers presented in BCD?

69Dareen Hamoudeh

Decimal Binary BCD

9 1001 1001

19 10011 (0001)(1001)

Page 70: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Seven-segment display

• A seven-segment display (SSD), or seven-segment indicator, is a form of electronic display device for displaying decimal numerals.

• Seven-segment displays are widely used in digital clocks, electronic meters, and other electronic devices for displaying numerical information.

Dareen Hamoudeh 70

Page 71: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Seven-segment display

• The seven segments are arranged as a rectangle of two vertical segments on each side with one horizontal segment on the top, middle, and bottom. Additionally, the seventh segment bisects the rectangle horizontally.

Dareen Hamoudeh 71

Page 72: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Seven-segment display

• BCD to 7-Segment Display Decoder

– A Decoder IC, is a device which converts one digital formatinto another and the most commonly used device fordoing this is the Binary Coded Decimal (BCD) to 7-SegmentDisplay Decoder. 7-segment LED (Light Emitting Diode) orLCD (Liquid Crystal) displays, provide a very convenientway of displaying information or digital data in the form ofnumbers, letters or even alpha-numerical characters andthey consist of 7 individual LED's (the segments), withinone single display package.

72Philadelphia University

Page 73: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Seven-segment display

• Diagram of a display module with a BCD to 7-Segment Decoder

Dareen Hamoudeh 73

Page 74: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Seven-segment display

• For example, if the input is 0100 the output should be 4.

Dareen Hamoudeh 74

Page 75: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Seven-segment display

• Truth Table

Dareen Hamoudeh 75

Page 76: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Seven-segment display

• Simplify each output function using k-map

– Note that :

the numbers from 10 To 15 will be

don’t care conditions.

– Let simplify the “e” function:

e= B’D’ + CD’

Dareen Hamoudeh 76

Page 77: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Seven-segment display

• We draw the logic circuit for “e” output:

Dareen Hamoudeh 77

Page 78: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Seven-segment display

• After simplifying all output minterms:

• To see larger image Please visit:http://thediagram.com/7_2/bcd_decoder.html

Dareen Hamoudeh 78

Page 79: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Seven-segment display

Dareen Hamoudeh 79

Page 80: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Dareen Hamoudeh 80

Decoder Application

Memory Address Decoder

Page 81: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Philadelphia University

Memory Address Decoder

• Memory Address Decoder.– Binary Decoders are most often used in more complex

digital systems to access a particular memory locationbased on an "address" produced by a computing device. Inmodern microprocessor systems the amount of memoryrequired can be quite high and is generally more than onesingle memory chip alone. One method of overcoming thisproblem is to connect lots of individual memory chipstogether and to read the data on a common "Data Bus". Inorder to prevent the data being "read" from each memorychip at the same time, each memory chip is selectedindividually one at time and this process is known asAddress Decoding.

Page 82: Philadelphia University Faculty of Information Technology ... · Faculty of Information Technology Department of Computer Science Computer Logic Design Dareen Hamoudeh 1. 2 Introduction

Helpful Sites

• Half adder:

– http://www.ustudy.in/node/3035

• Adder/subtractor:

– http://tams-www.informatik.uni-hamburg.de/applets/hades/webdemos/20-arithmetic/40-addsub/add-sub.html

• Decoder:

– https://filebox.ece.vt.edu/~jgtront/introcomp/decoder.swf

82Philadelphia University