Você está na página 1de 37

Combinational Logic

Mantık Devreleri
Yard.Doç.Dr.Mutlu BOZTEPE

Half Adder
A + B = Σ and a carry ( this is math not logic)
A B Σ Carry
0 0 0 0
Σ=A⊕B
0 1 1 0
Carry = AB
1 0 1 0
This is logic not math
1 1 0 1

1
Half adder logic diagram

Full adder

Σ = (A ⊕ B) Cin + (A ⊕ B ) Cin
or
Σ = (A ⊕ B) ⊕ Cin
Cout = AB + (A ⊕ B)Cin

2
Full adder logic diagram

Full-adder implemented with half-


adders

3
Examples
1 0 0
0 1 1

Determine the outputs

Block diagram of a basic 2-bit parallel adder


using two full-adders

4
Example

A 4-bit parallel adder

5
Four-bit parallel adders

Examples of adder expansion

6
Two 74LS83A adders connected as an 8-bit
parallel adder (pin numbers are in
parentheses).

A voting
system
using full-
adders and
parallel
binary
adders

7
Ripple Carry vs. Look-Ahead Carry?
Both types of adders are the same in terms of inputs and
outputs. Difference is the speed at which they can add
numbers.
Look-ahead carry adder are faster than the ripple carry adder.

Ripple Carry adder

Look-Ahead Carry adder (1)


Carry generation Carry propagation

8
Look-Ahead Carry adder (2)
All the output
carries are
immediately
available!
No need to
wait for ripple
carry through
all stages

Comparator

9
Logic diagram for equality comparison of
two 2-bit numbers

Example

10
Logic symbol for a 4-bit comparator with
inequality indication

Example
What is the outputs?

HIGH

LOW

LOW

11
74HC85 4-bit magnitude comparator
(pin numbers are in parentheses).

An 8-bit magnitude comparator using two


74HC85s

12
Functions of
Combination Logic

Kod Çözücüler (Decoders)


 Kod çözücülerin işlevi, belirtilen bir giriş
kombinasyonu girişte oluştuğunda bunu
çıkışında bir lojik seviye veya başka bir
biçimde gösteren devrelerdir.
 Binary to decimal decoders
 BCD to decimal decoders
 BCD to 7-segment decoders
 vs.

13
Basic binary decoder
Girişte 1001 kombinasyonu olduğunda 1 çıkışı veren bir kodçözücü devresi

Girişte 1011 kombinasyonu olduğunda 1 çıkışı veren bir kodçözücü devresi

3 to 8 binary to decimal decoder

Doğruluk tablosu (Truth table)


Logic Outputs
Decimal Binary Inputs Function D0 D1 D2 D3 D4 D5 D6 D7
0 0 0 0 1 0 0 0 0 0 0 0

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

2 0 1 0 0 0 1 0 0 0 0 0
3 0 1 1 0 0 0 1 0 0 0 0
4 1 0 0 0 0 0 0 1 0 0 0
5 1 0 1 0 0 0 0 0 1 0 0
6 1 1 0 0 0 0 0 0 0 1 0
7 1 1 1 0 0 0 0 0 0 0 1

Decoding functions and truth tables for the 3-line-to-8-line decoder

14
Lojik devresi

3 to 8 binary to
decimal
decoder

74LS138 3 to 8 binary to decimal decoder

Active-low !!

15
4 to 16 binary to decimal
decoder

Figure 6--24 Logic

Decimal number
symbol for a 4-line-to-

Binary number
16-line (1-of-16)
decoder. Open file
F06-24 to verify
operation.

Pin diagram and logic symbol for the


74HC154 1-of-16 decoder.

16
A 5-bit decoder using 74HC154s.

A simplified
computer I/O
port system with
a port address
decoder with
only four address
lines shown.

17
The 74HC42 BCD-to-decimal decoder

The 74HC42 BCD-to-decimal decoder

18
Logic symbol for a BCD-to-7-segment
decoder/driver with active-LOW outputs.

Two 7-segment
display

Pin diagram and logic symbol for the 74LS47


BCD-to-7-segment decoder/driver

19
Examples of zero suppression using the 74LS47 BCD to 7-
segment decoder/driver.

Kodlayıcılar (Encoders)
 Kod çözücü (decoding) işleminin tersini
yaparlar.
 Decimal to binary encoders
 Decimal to BCD encoders
 Line encoders (like 8-to-3 line encoders)
 vs.

20
Logic symbol for a decimal-to-BCD encoder.

A3=8+9
A2=4+5+6+7
A1=2+3+6+7
A0=1+3+5+7+9

Basic logic diagram of a decimal-to-BCD encoder. A


0-digit input is not needed because the BCD outputs
are all LOW when there are no HIGH inputs.

A3=8+9
A2=4+5+6+7
A1=2+3+6+7
A0=1+3+5+7+9

21
74HC147 decimal-to-BCD priority encoder
(HPRI means highest value input has priority).

74F148 8-line-to-3-line priority encoder.

22
A 16-line-to-4 line encoder using 74F148s
and external logic.

A simplified
keyboard
encoder.

23
Code converters
 BCD-to-binary conversion
 Binary-to-Gray
 Gray-to-Binary

BCD to Binary – Method 1


87  1000 0111
8 7
Tens digit Units digits
Weights 80 40 20 10 8 4 2 1
Bit designation B3 B2 B1 B0 A3 A2 A1 A0
87 = 80+0+0+0+0+4+2+1
Her bir bit’in ağırlıkları toplanırsa binary karşılık elde edilir.

24
BCD to Binary – Method 2
 BCD sayıyı sağa bir kaydır. Her bir basamağı
(decade) incele. Değeri 7’den büyük olan
basmaklardan 3 çıkar.

Gray Code Gray code is a code that


is not weighted

Decimal Gray Code Binary


0 0000 0000
1 0001 0001
Note that in gray code
2 0011 0010 only one bit is changing
at a time while in binary
3 0010 0011
code many bits may
4 0110 0100 change at a time
5 0111 0101
6 0101 0110
7 0100 0111

25
Binary  Gray conversions

Example

26
Multiplexer

Multiplexer
 S0 ve S1 “data select” girişlerinin değerine bağlı olarak
“Data inputs” girişlerinden bir tanesi seçilerek Y
çıkışına aktarılır

S1 S0 Input
selected
0 0 D0
0 1 D1
1 0 D2
1 1 D3

27
Multiplexer

74HC157A quadruple 2-input data


selector/multiplexer

28
74LS151 8-input data selector/multiplexer

A 16-input multiplexer

29
Multiplexer
Application

Simplifying 7-segment
display

Implementing a logic function


using multiplexer

30
Implementing a logic function
using multiplexer
Implementing a logic
function 4-input

Implementing a logic function


using multiplexer

F(X,Y,Z) = X'Y'Z + X'YZ + XY'Z + XYZ' + XYZ

31
Demultiplexer

Demultiplexers

32
The 74HC154 decoder used as a
demultiplexer

Implementing a logic function


using decoder

F(X,Y,Z) = X'YZ' + X'YZ + XYZ' + XYZ + XY'Z

33
Implementing a logic function
using decoder

F(X,Y,Z) = X'Y'Z + X'YZ + XY'Z + XYZ' + XYZ

Parity

34
The 74LS280 9-bit parity
generator/checker

Parity
application

35
Example of data transmission with and
without error for the system in previous
application

Glitch
Birden çok giriş aynı anda durum değiştirirse, geçiş anlarında
farklı giriş kombinasyonları oluşur. Bun bağlı olarak çıkış farklı
(istenmeyen) değerler alır.

36
Figure 6--59 Decoder waveform displays showing how
transitional input states produce glitches in the output
waveforms.

Strobe signal is used to


eliminates glitches

37

Você também pode gostar