Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

Digital-Logic

.pdf
Скачиваний:
22
Добавлен:
25.02.2016
Размер:
170.28 Кб
Скачать

NAND gate implementation of the “sum-of-product” logic functions

 

F = AB + AC

NAND gates are faster than ANDs and

 

ORs in most technologies

 

 

 

 

 

A

B

C

 

 

 

 

 

X = ( X )

A B

C

 

 

 

 

F

 

 

 

 

 

A

F

 

 

 

 

 

A

A

 

 

 

 

© Emil M. Petriu

ADDING BINARY NUMBERS

Adding two bits:

Truth table

Inputs

Outputs

A

B

Carry Sum

0

0

0

0

0

1

0

1

1

0

0

1

1

1

1

0

 

 

 

 

Sum = A + B

Carry = A . B

0+

0+

1+

1+

The binary

number 10 is

0

1

0

1

 

equivalent to

__________

__________

__________

__________

 

the decimal 2

0

1

1

1 0

 

 

 

 

 

Carry

 

 

 

 

Sum

 

 

 

 

 

 

(over)

A

Sum

B

Half-Adder

 

circuit

Carry

© Emil M. Petriu

Adding multi-bit numbers:

108D +

 

 

 

0

1 1 0 1 1 0 0 +

 

A7 A6 A5 A4 A3 A2 A1 A0 +

 

 

 

90D

 

 

 

 

0

1 0 1 1 0 1 0

 

B7 B6 B5 B4 B3

B2 B1 B0

 

 

 

198D

 

 

 

 

 

 

____________________________________

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1 1

0 0 0

1 1 0

Sum

S

S

S S

4

S

S

S

S

 

 

 

 

 

 

 

 

 

 

 

 

 

7

6

5

3

2

1

0

 

 

 

 

 

 

 

0

1

1 1 1

0 0 0

Carry

 

 

 

 

 

 

 

 

 

Carry Out

A7 B7

 

A6 B6

 

A5 B5

 

 

 

 

 

 

 

 

 

 

 

 

 

A B

 

A B

 

A B

CO CI

 

CO CI

 

CO CI

 

 

 

S

 

 

S

 

 

S

 

 

 

 

 

 

 

 

 

 

 

 

 

A4 B4

A B

CO CI

S

 

A3 B3

 

A2 B2

 

A1 B1

 

A0 B0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

A B

 

A B

 

A B

 

A B

 

 

CO CI

 

CO CI

 

CO CI

 

CO CI

 

 

 

 

 

 

 

 

S

 

 

S

 

 

S

 

 

S

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Carry In = 0

S7

S6

S5

S4

S3

S2

S1

S0

© Emil M. Petriu

Full Adder

Bits of the same rank of the two numbers

Out

 

 

 

 

 

 

In

 

A B

 

Carry

 

CO CI

 

Carry

 

 

 

 

 

 

 

S

 

 

 

 

 

 

 

 

 

 

Sum

Inputs

Outputs

A

B CI

CO

S

0

0

0

0

0

0

0

1

0

1

0

1

0

0

1

0

1

1

1

0

1

0

0

0

1

1

0

1

1

0

1

1

0

1

0

1

1

1

1

1

 

 

 

 

 

A B

 

 

S

 

CI

00

01 11

10

0

0

1

0

1

1

1

0

1

0

A B

 

CO

A . B

CI

00

01 11

10

0

0

0

1

0

1

0

1

1

1

B. CI A . CI

S = A . B . CI + A . B . CI + A . B . CI + A . B . CI C = A . B + B . CI + A . CI

© Emil M. Petriu

HEX-TO-7 SEGMENT DECODER

This examples illustrates how a practical problem is analyzed in order to generate truth tables,and then how truth table-defined functions are mapped on Karnaugh maps.

B3 B2 B1 B0

_________________________

(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

(A)

1

0

1

0

(B)

1

0

1

1

(C)

1

1

0

0

(D)

1

1

0

1

(E)

1

1

1

0

(F)

1

1

1

1

Four-bit

 

 

S1

 

 

7-segment display to allow

“machine”

 

 

 

 

 

 

 

 

 

 

the user see the natural

representation

 

 

 

 

 

 

 

S6

 

S2

 

 

representation of the

of the hex

 

S7

 

 

 

 

 

hex digits.

digits

 

 

 

 

 

 

 

 

 

 

 

 

 

 

S5

S4

S3

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Binary outputs; when

 

 

 

 

 

 

 

such a signal is = 1 then

S7

S6

S5

S4

S3

S2

S1

the corresponding segment

in the 7-segment display

 

 

 

 

 

 

 

is on (you see it), when the

 

 

 

7 SEGMENT

 

signal is = 0 then the

 

 

 

 

 

 

 

segment is off (you can’t

HEX

 

 

 

 

 

see it).

B3 B2 B1 B0

The four-bit representation

of the hex digits

“Natural” (i.e.as humans write)

 

representation of the “hex” digits.

© Emil M. Petriu

 

B3 B2 B1 B0

_________________________

(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

(A)

1

0

1

0

(B)

1

0

1

1

(C)

1

1

0

0

(D)

1

1

0

1

(E)

1

1

1

0

(F)

1

1

1

1

 

 

 

 

S1

 

 

 

 

 

 

S1

 

 

 

 

 

S1

 

 

 

 

 

S1

 

 

 

 

S1

 

 

 

S6

 

S7

 

S2

 

S6

 

S7

S2

 

S6

 

S7

S2

 

S6

 

S7

S2

S6

S7

S2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

S5

S4

 

S3

 

S5

S4

S3

 

S5

S4

S3

 

S5

S4

S3

S5

 

S4

S3

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

S1

 

 

 

 

 

S1

 

 

 

 

 

S1

 

 

 

 

 

S1

 

 

 

 

S1

 

 

 

S6

 

S7

 

S2

S6

S7

 

S2

S6

S7

 

S2

S6

S7

S2

 

S6

 

S7

S2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

S5

 

S4

S3

S5

 

S4

S3

S5

 

S4

S3

S5

 

S4

S3

 

S5

S4

S3

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

S1

 

 

 

 

 

 

S1

 

 

 

 

 

S1

 

 

 

 

 

S1

 

 

 

 

 

S1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

S6

S7

 

S2

S6

S7

 

S2

S6

S7

 

S2

S6

S7

 

S2

S6

S7

S2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

S5

S4

 

S3

 

S5

 

S4

 

S3

S5

 

S4

 

S3

S5

 

S4

 

S3

S5

S4

S3

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

S1

 

We are developing ad- hoc”binary-hex logic” expressions used just for our convenience in the problem analysis process. Each expression will enumerate only those hex digits when the specific display-segment is “on”:

S1 = 0+2 +3+5+6+7+8+9+A+C+E+F S2 = 0+1+2+3+4+7+8+9+A+D

S3 = 0+1+3+4+5+6+7+8+9+A+B+D

S6

S7

S2

 

 

 

 

 

S4 = 0+2+3+5+6+8+9+B+C+D+E

S5

 

S3

S4

S5 = 0+2+6+8+A+B+C+D+E+F

S6 = 0+4+5+6+8+9+A+B+C+E+F

S7 = 2+3+4+5+6+8+9+A+B+D+E+F

© Emil M. Petriu

Hex-to-7 segment

B3 B2 B1 B0

_________________________

(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

(A)

1

0

1

0

(B)

1

0

1

1

(C)

1

1

0

0

(D)

1

1

0

1

(E)

1

1

1

0

(F)

1

1

1

1

S1 = 0+2 +3+5+6+7+8+9+A+C+E+F S2 = 0+1+2+3+4+7+8+9+A+D

S3 = 0+1+3+4+5+6+7+8+9+A+B+D S4 = 0+2+3+5+6+8+9+B+C+D+E S5 = 0+2+6+8+A+B+C+D+E+F

S6 = 0+4+5+6+8+9+A+B+C+E+F S7 = 2+3+4+5+6+8+9+A+B+D+E+F

B3 B2

 

 

 

 

B1 B0

00

01 11

10

00

0

4

C

8

01

1

5

D

9

11

3

7

F

B

10

2

6

E

A

As we are using ad-hoc “binary-hex logic” equations, (i.e. binary S… outputs as functions of hex variables) it will useful in this case to have

hex-labeled Karnaugh map, instead of the usual 2-D (i.e. two dimensional) binary labeled K maps. This will allow for a more convenient mapping of the “binary-hex” logic equations onto the K-maps.

© Emil M. Petriu

Hex-to-7 segment

Mapping the ad-hoc “binary-hex

 

B3 B2

 

 

S1

 

 

B3 B2

 

 

S2

 

 

 

 

 

 

 

 

B1 B0

00

01 11

10

B1 B0

00

01 11

10

logic” equations onto Karnaugh maps:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

00

1

0

 

1

1

00

1

1

 

0

1

 

 

 

 

 

 

 

 

01

 

 

 

 

 

01

 

 

 

 

 

 

B3 B2

 

 

 

 

 

 

0

1

 

0

1

1

0

 

1

1

 

 

 

 

 

 

 

11

 

 

 

 

 

11

 

 

 

 

 

 

 

 

 

 

 

1

1

 

1

0

1

1

 

0

0

B1 B0

00

01 11

10

 

 

 

 

 

 

10

 

 

 

 

 

10

 

 

 

 

 

 

1

1

 

1

1

1

0

 

0

1

 

 

 

 

 

 

 

 

 

 

00

0

4

C

8

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

01

1

5

D

9

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

B3 B2

 

 

S3

 

 

B3 B2

 

 

S4

 

11

3

7

F

B

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

10

2

6

E

A

 

B1 B0

00

01 11

10

B1 B0

00

01 11

10

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

S1 = 0+2 +3+5+6+7+8+9+A+C+E+F

00

1

1

 

0

1

00

1

0

 

1

1

01

 

 

 

 

 

01

 

 

 

 

 

1

1

 

1

1

0

1

 

1

1

S2 = 0+1+2+3+4+7+8+9+A+D

 

 

 

 

11

 

 

 

 

 

11

 

 

 

 

 

 

1

1

 

0

1

1

0

 

0

1

S3 = 0+1+3+4+5+6+7+8+9+A+B+D

 

 

10

 

 

 

 

 

10

 

 

 

 

 

0

1

 

0

1

1

1

 

1

0

S4 = 0+2+3+5+6+8+9+B+C+D+E

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

© Emil M. Petriu

 

Hex-to-7 segment

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

B3 B2

 

 

S5

 

 

 

 

B3 B2

 

 

 

S6

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

B1 B0

 

00

01 11

 

10

 

B1 B0

00

01 11

10

 

 

B3 B2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

00

1

0

 

1

 

1

 

 

 

 

00

1

 

1

 

1

1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

B1 B0

00

01 11

10

 

 

01

 

 

 

 

 

 

 

 

 

 

 

01

 

 

 

 

 

 

 

 

0

0

 

1

 

0

 

 

 

 

0

 

1

 

0

1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

00

0

4

 

C

8

 

 

11

0

0

1

 

1

 

 

 

 

11

0

 

0

1

1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

01

1

5

 

D

9

 

 

10

1

1

1

 

1

 

 

 

 

10

0

 

1

1

1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

11

3

7

 

F

B

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

10

2

6

 

E

A

 

 

 

 

 

 

 

B3 B2

 

 

 

 

S7

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

B1 B0

 

00

01 11

 

10

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

S5 = 0+2+6+8+A+B+C+D+E+F

 

 

 

 

 

 

 

00

0

 

1

 

0

 

1

 

 

 

 

 

 

 

 

 

 

 

 

 

01

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0

 

1

 

1

 

1

 

 

 

 

 

 

S6 = 0+4+5+6+8+9+A+B+C+E+F

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

11

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1

 

0

 

1

 

1

 

 

 

 

 

 

 

S7 = 2+3+4+5+6+8+9+A+B+D+E+F

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

10

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1

 

1

 

1

 

1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

© Emil M. Petriu

SYSTEMS of LOGIC FUNCTIONS

2- bit Comparator

 

A1 A0

B1 B0

F1

 

F2

F3

 

 

(0)

0

0

0

0

1

 

0

0

(1)

0

0

0

1

0

 

0

1

(2)

0

0

1

0

0

 

0

1

(3)

0

0

1

1

0

 

0

1

(4)

0

1

0

0

0

 

1

0

(5)

0

1

0

1

1

 

0

0

(6)

0

1

1

0

0

 

0

1

(7)

0

1

1

1

0

 

0

1

(8)

1

0

0

0

0

 

1

0

(9)

1

0

0

1

0

 

1

0

(10)

1

0

1

0

1

 

0

0

(11)

1

0

1

1

0

 

0

1

(12)

1

1

0

0

0

 

1

0

(13)

1

1

0

1

0

 

1

0

(14)

1

1

1

0

0

 

1

0

(15)

1

1

1

1

1

 

0

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Compare two 2-bit numbers:

A=B

F1 = Σ (0,5,10,15)

A>B F2 = Σ (4,8,9,12,13,14)

A<B

F3 = Σ (1,2,3,6,7,11)

© Emil M. Petriu

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]