• No results found

Lecture5-Logic-CombinatinalLogic-abu-arqoub-2009.pdf

N/A
N/A
Protected

Academic year: 2020

Share "Lecture5-Logic-CombinatinalLogic-abu-arqoub-2009.pdf"

Copied!
33
0
0

Loading.... (view fulltext now)

Full text

(1)

Chapter 4

(2)

Introduction

Combinational

.

N Combinational 

.

M

Logic Circuit

.

.

Input 

Variables

.

.

Output 

(3)

Design Procedure

g

1. The problem is stated.

2 Th b f il bl i i bl & i d

2. The number of available input variables & required 

output variables are determined.

3 The input & output variables are assigned letter 3. The input & output variables are assigned letter 

symbols.

4. The truth table that defines the required relationships 

between the inputs & outputs is derived.

5. The simplified Boolean function for each output is 

obtained obtained.

(4)

Example

Example

Design

 

a

 

system

 

with

 

three

 

switches

 

and

 

two

 

lamps,

p

 

where

The

 

first

 

lamp

 

on

 

only

 

if

 

any

 

two

 

sequence

 

switches are on.

switches

 

are

 

on.

The

 

second

 

lamp

 

on

 

only

 

if

 

the

 

first

 

and

 

the

 

last

 

switches on

switches

 

on.

(5)

Example

Example

N b f i t Î 3

– Number of inputs Î 3

– Number of outputs Î 2

– Let the three inputs be a, b, & c.Let the three inputs be a, b, & c.

– Let the two outputs be L1, & L2. Truth Table:

(6)

Example

Example

Boolean

 

Function

 

for

 

the

 

outputs:

(7)

Adders

Add f t t

Adders are of two types:

• Half Adder (HF).

• Full Adder (FA)

• Full Adder (FA).

Half Adder: is the addition of two bits.

Design a combinational logic circuit to perform the addition 

(8)

Adders

Number of inputs Î 2 (2 bits to be added)

N b f Î 2 ( h & f bi )

Number of outputs Î 2 (the sum & carry of two bits)

• Let two input bits be X Y & the sum (S) & the carry (C)

• Let two input bits be X, Y & the sum (S) & the carry (C).

• Truth Table:

C S

Y X

0 0

0 0

0 1

1

0 1 1 0

0

0 1

0 1

1 0

(9)

Adders

Combinational

X

S

Combinational 

Logic Circuit For HA

Y

S

C

B l F ti f th t t

Boolean Function for the outputs:

S = X’Y + XY’ = X

Y

S = X Y + XY  = X     Y

C = XY

1

C = XY

(10)

Adders

S = X     Y = (X    Y)’ 

(XY X’Y’)’

= (XY + X’Y’)’ 

(11)

Full Adder

It’s the arithmetic sum of three input bits (the sum of two 

significant bits & the carry from the previous lower significant bits & the carry from the previous lower 

significant position).

b l l f h

Design a combinational logic circuit to perform the 

addition of 3 bits (sum of 2 bits & the carry).

Number of Inputs Î 3 (2 bits & carry) Number of outputs Î 2 (sum & carry)

Let the inputs be X, Y, Cin Let the outputs be S C

X

Y +

Cin

Let the outputs be S, Cout

(12)

Full Adder

Truth Table:

Cout S Cin Y X 0 0 0 0

0 0 0 0 0

0 0 1 1 0 0 0 1 0 1 0 1 0 1 1 0 0 1 0 0 1 1 0 1 0 1 1 0 0 1 1 1 1 1 1

1 1 1 1 1

(13)

Full Adder

Boolean functions for the outputs:

No Simplification

(14)

Full Adder

C YC XC XY

Cout = YCin + XCin + XY

S = XY’C ’ + X’YC ’ + XYC + X’Y’C S = XY Cin + X YCin  + XYCin + X Y Cin

= Cin’ (XY’ + X’Y) + Cin (XY + X’Y’) = C Ciin’ (X (X

     Y) + CY) + Ciin (X(X     

Y)’Y)

= Cin’ Z + Cin Z’ = Cin         Z  = Cin         (X     Y)

(15)

Full Adder

Cout = XY’Cin + X’YCin + XYCin‘ + XYCin C (XY’ X’Y) XY (C ‘ C ) = Cin (XY’ + X’Y) + XY (Cin‘+ Cin)

(16)

Subtractors

Problem: Using a combinational logic circuit, Design 

1 H lf S b (HS)

1. a Half Subtractor (HS) 2. a Full Subtractor (FS)

1. Half Subtractor:

b

Inputs Î X, Y

X

-Y Inputs Î X, Y

Outputs Î D, B(Borrow)

(17)

Subtractors

T h T bl

Truth Table:

D B Y X 0 0 0 0 1 1 1 0 1 0 0 1

B = X’Y

1 0 0 1 0 0 1 1

B   X Y

D = X’Y + XY’ = X      

(18)

Subtractors

2. Full Subtractor:

Inputs Î X, Y, Bp (Bp is the previous borrow)

Outputs Î Bn D (Bn is the next borrow)

Outputs Î Bn, D   (Bn is the next borrow)

Truth Table: X Y Bp Bn D

Truth Table: 0 0 0 0 0

1 1 1 0 0 1 1 0 1 0

Bn Bp

1 1 0 1 0 0 1 1 1 0 1 0 0 0 1

(19)

Subtractors

D = X’Y’Bp + X’YBp’ + XY’Bp’ + XYBp

(20)

Code Conversion

Ex: Design a combinational logic circuit to perform a 

conversion from the BCD to the Excess 3 code conversion from the BCD to the Excess‐3 code.

Inputs Î 4 (A, B, C, D)

Inputs Î 4 (A, B, C, D)

(21)

Code Conversion

Code Conversion

Truth Table:

Output Excess‐3 Inputp  BCD p

Z Y X W D C B A 1 1 0 0 0 0 0 0 0 0 1 0 1 0 0 0 1 0 1 0 0 1 0 0 . . . . . . . . . . . . . . . . 0 0 1 1 1 0 0

1 0 0 1 1 1 0 0

(22)

Code Conversion

W

W = m5 + m6 + m7 + m8 + m9 X = m1 + m2 + m3 + m4 + m9 Y m + m + m + m + m Y = m0 + m3 + m4 + m7 + m8 Z = m0 + m2 + m4 + m6 + m8

(23)

Code Conversion

(24)

Code Conversion

(25)

Code Conversion

(26)

Code Conversion

W = A + BC + BD = A + B (C + D)

X = B’C + B’D + BC’D’ = B’ (C + D) + BC’D’ B’ (C + D) + B ( C + D)’

= B  (C + D) + B ( C + D)

Y = CD + C’D’ = CD + (C + D)’ Y = CD + C D  = CD + (C + D)

(27)

Analysis Procedure

y

Th l i f bi i l i i i h

The analysis of a combinational circuit is the reverse 

process of the design of a combinational logic circuit.

It starts with a given logic diagram & ends with a set of 

Boolean functions, a truth table, or a verbal explanation 

(28)

Analysis Procedure

y

(29)

Analysis

 

Procedure

R1 XY R1=XY R2=XZ R3=YZ

F1 (X, Y, Z) = R1 + R2 + R3 = XY + XZ + YZ

F2 (X, Y, Z) = F1(X,Y,Z)’= (XY + XZ + YZ)’ = (X’ + Y’) (X’ + Z’) (Y’ + Z’)

T th T bl Truth Table:

F2 = (F1)’ F1 = R1 + R2 + R3

R3 = YZ R2 = XZ

R1 = XY Z Y X 1 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 1 0 0 0 0 0 1

0 1 0 0 0 0 0 1

(30)

Analysis Procedure

y

Ex2: Given the following logic circuit, analyze it:

R1 = (XY)’ R2 = (R1 Z)’

R1  (XY)       R2    (R1 Z) F (X, Y, Z) = (R2 X)’

(31)

Analysis Procedure

y

Truth Table:

F = X’ + Y’Z Y’Z X’ Z Y X 1 0 1 0 0 0 1 1 1 1 0 0

F = (R2X)’ R2 = (R1Z)’

R1 = (XY)’

(32)

Analysis Procedure

y

Ex3: Analyze the following logic circuit:

F = (R2 + Y)’ , R2  = (R1 + Z)’ R1 = (X + Y)’ Î R2 = ((X + Y)’ + Z)’

(33)

Analysis Procedure

y

Truth Table:

F (X, Y, Z) Z Y X 1 0 0 0 1 1 0 0 0 0 1 0 0 1 1

0 1 1 0

References

Related documents