eceg-3201 digital logic design - wordpress.com · encoder it works opposite ways from decoders....

35
Addis Ababa Institute of Technology (AAIT) Department of Electrical and Computer Engineering ECEG-3201 Digital Logic Design

Upload: others

Post on 15-May-2020

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: ECEG-3201 Digital Logic Design - WordPress.com · Encoder It works opposite ways from decoders. Circuit that allows only one input to be activated, and produces an N-bit output code,

Addis Ababa Institute of Technology (AAIT) Department of Electrical and

Computer Engineering

ECEG-3201 Digital Logic Design

Page 2: ECEG-3201 Digital Logic Design - WordPress.com · Encoder It works opposite ways from decoders. Circuit that allows only one input to be activated, and produces an N-bit output code,

AAIT, Department of Electrical and Computer

Engineering

Nebyu Yonas Sutri 2

Learning Outcomes

At the end of the lecture, students should get

familiarized with;

Adders/Subtractors.

Comparators.

Decoders.

Encoders.

Page 3: ECEG-3201 Digital Logic Design - WordPress.com · Encoder It works opposite ways from decoders. Circuit that allows only one input to be activated, and produces an N-bit output code,

3 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

Addition is an important process in digital

systems, especially computers.

There are two types of basic adders:

Half Adder

Full Adder

Adders

0 + 0 = 0

0 + 1 = 1

1 + 0 = 1

1 + 1 = 10

Simple Binary Addition

Page 4: ECEG-3201 Digital Logic Design - WordPress.com · Encoder It works opposite ways from decoders. Circuit that allows only one input to be activated, and produces an N-bit output code,

4 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

Half Adders

Half adder: Is a circuit that add two binary digits

and produce a sum bit and a carry bit.

A

+ B

Co S

Carry Sum

Half Adder

Circuit

B A

S CO

Page 5: ECEG-3201 Digital Logic Design - WordPress.com · Encoder It works opposite ways from decoders. Circuit that allows only one input to be activated, and produces an N-bit output code,

5 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

Half Adders

Truth table: Equation:

A B CO S

0 0 0 0

0 1 0 1

1 0 0 1

1 1 1 0

BAC

BAS

O

A

BS

CO

Logic Circuit:

Page 6: ECEG-3201 Digital Logic Design - WordPress.com · Encoder It works opposite ways from decoders. Circuit that allows only one input to be activated, and produces an N-bit output code,

6 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

Full Adders Since half adder cannot handle crisis when there

is an input carry from previous bit, we need to use

a full adder.

Full adder: circuit that adds two binary numbers

with the existence of a carry in bit. It produces a

sum and a carry out.

Full Adder

Circuit

B A

S CO

Cin

Cin

A

+ B

Co S Carry Sum

Page 7: ECEG-3201 Digital Logic Design - WordPress.com · Encoder It works opposite ways from decoders. Circuit that allows only one input to be activated, and produces an N-bit output code,

7 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

Full Adders

Truth table: Equation:

A B Cin 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

in in in in

o in in in in

S ABC ABC ABC ABC

C ABC ABC ABC ABC

( )in

A B C

AB C A B

Page 8: ECEG-3201 Digital Logic Design - WordPress.com · Encoder It works opposite ways from decoders. Circuit that allows only one input to be activated, and produces an N-bit output code,

8 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

Full Adders

Full adder circuit can also be implemented using 2

half adders.

Page 9: ECEG-3201 Digital Logic Design - WordPress.com · Encoder It works opposite ways from decoders. Circuit that allows only one input to be activated, and produces an N-bit output code,

9 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

Full Adders

Page 10: ECEG-3201 Digital Logic Design - WordPress.com · Encoder It works opposite ways from decoders. Circuit that allows only one input to be activated, and produces an N-bit output code,

10 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

Parallel Binary Adder

Two bit adder

Page 11: ECEG-3201 Digital Logic Design - WordPress.com · Encoder It works opposite ways from decoders. Circuit that allows only one input to be activated, and produces an N-bit output code,

11 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

Parallel Binary Adder

A group of 4 bits is called a Nibble.

Four bit parallel adder.

Page 12: ECEG-3201 Digital Logic Design - WordPress.com · Encoder It works opposite ways from decoders. Circuit that allows only one input to be activated, and produces an N-bit output code,

12 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

Parallel Binary Adder

Page 13: ECEG-3201 Digital Logic Design - WordPress.com · Encoder It works opposite ways from decoders. Circuit that allows only one input to be activated, and produces an N-bit output code,

13 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

Parallel adders can be placed in to two categories

based on the way in which the internal carries

from stage to stage are handled.

Ripple carry adder

Look-ahead carry adder

Externally, both types of adders are the same in

terms of inputs and outputs.

The difference is the speed at which they can add

numbers. The look-ahead carry adder is much

faster than ripple carry adder.

Parallel Binary Adder

Page 14: ECEG-3201 Digital Logic Design - WordPress.com · Encoder It works opposite ways from decoders. Circuit that allows only one input to be activated, and produces an N-bit output code,

14 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

Ripple Carry Adder In ripple carry adder, the second full adder (FA2) needs to

wait for the input carry (Cin), coming from the output carry

(Cout) from first adder (FA1).

Assume one adder has a delay of 8 ns. 4 adders will

contribute to 32 ns delay in adding up the 4 bits number .

Page 15: ECEG-3201 Digital Logic Design - WordPress.com · Encoder It works opposite ways from decoders. Circuit that allows only one input to be activated, and produces an N-bit output code,

15 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

Look-Ahead Carry Adder The objective of the adder is to reduce the adder’s delay in

performing the addition. This is because, the input carry

and output carry is dependent on the input’s value of the

adder itself.

No propagation delay from one adder to the other.

Page 16: ECEG-3201 Digital Logic Design - WordPress.com · Encoder It works opposite ways from decoders. Circuit that allows only one input to be activated, and produces an N-bit output code,

16 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

4 Bit 2’s Complementer Circuit

Page 17: ECEG-3201 Digital Logic Design - WordPress.com · Encoder It works opposite ways from decoders. Circuit that allows only one input to be activated, and produces an N-bit output code,

17 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

4 Bit Adder Subtractor

Page 18: ECEG-3201 Digital Logic Design - WordPress.com · Encoder It works opposite ways from decoders. Circuit that allows only one input to be activated, and produces an N-bit output code,

18 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

Comparator Comparator is a device that compares two digital

quantities to determine the relationship of those

quantities.

Comparison is made in terms of:

Equal to ‘=’

Less than ‘<’

Greater than ‘>’

The function of a comparator is to compare either

the input bit is the same as the reference bit or

not.

It can be a 1-bit, 2-bit or 4-bit comparator.

Page 19: ECEG-3201 Digital Logic Design - WordPress.com · Encoder It works opposite ways from decoders. Circuit that allows only one input to be activated, and produces an N-bit output code,

19 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

Comparator

1 bit comparator

The output is 1 when the inputs are equal.

A B X

0 0 1

0 1 0

1 0 0

1 1 1

Equals to X-NOR

Page 20: ECEG-3201 Digital Logic Design - WordPress.com · Encoder It works opposite ways from decoders. Circuit that allows only one input to be activated, and produces an N-bit output code,

20 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

Comparator

2 bit comparator

The output is 1 when A0 = B0 AND A1 = B1.

Page 21: ECEG-3201 Digital Logic Design - WordPress.com · Encoder It works opposite ways from decoders. Circuit that allows only one input to be activated, and produces an N-bit output code,

21 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

Comparator

4 bit comparator.

Page 22: ECEG-3201 Digital Logic Design - WordPress.com · Encoder It works opposite ways from decoders. Circuit that allows only one input to be activated, and produces an N-bit output code,

22 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

Decoder

Circuit that:

Accepts a set of inputs (binary number /code) and

Activates the only output that corresponds to that

particular input.

Types of decoders:

Binary decoder

3-bit decoder

4-bit decoder

BCD-to-decimal decoder

BCD-to-7-segment decoder

Page 23: ECEG-3201 Digital Logic Design - WordPress.com · Encoder It works opposite ways from decoders. Circuit that allows only one input to be activated, and produces an N-bit output code,

23 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

Binary Decoder

Is used to determine if a specific binary number

occurs or not in a digital circuitry.

The output is 1 only when:

A0 = 1

A1 = 0

A2 = 0

A3 = 1

Page 24: ECEG-3201 Digital Logic Design - WordPress.com · Encoder It works opposite ways from decoders. Circuit that allows only one input to be activated, and produces an N-bit output code,

24 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

3-Bit/Binary to Octal Decoder The decoder converts standard 3-bit binary into one octal

high output at a time.

Enable Data input Active high data outputs

EN2 EN1 C B A X0 X1 X2 X3 X4 X5 X6 X7

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

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

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

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

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

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

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

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

0 X X X X 0 0 0 0 0 0 0 0

X 0 X X X 0 0 0 0 0 0 0 0

Page 25: ECEG-3201 Digital Logic Design - WordPress.com · Encoder It works opposite ways from decoders. Circuit that allows only one input to be activated, and produces an N-bit output code,

25 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

3-Bit/Binary to Octal Decoder

Page 26: ECEG-3201 Digital Logic Design - WordPress.com · Encoder It works opposite ways from decoders. Circuit that allows only one input to be activated, and produces an N-bit output code,

26 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

3-Bit Active-Low Decoder

Enable Data input Active high data outputs

EN2 EN1 C B A X0 X1 X2 X3 X4 X5 X6 X7

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

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

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

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

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

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

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

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

1 X X X X 1 1 1 1 1 1 1 1

X 1 X X X 1 1 1 1 1 1 1 1

Page 27: ECEG-3201 Digital Logic Design - WordPress.com · Encoder It works opposite ways from decoders. Circuit that allows only one input to be activated, and produces an N-bit output code,

27 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

3-Bit Active-Low Decoder

Page 28: ECEG-3201 Digital Logic Design - WordPress.com · Encoder It works opposite ways from decoders. Circuit that allows only one input to be activated, and produces an N-bit output code,

28 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

4-Bit Decoder

Also called

binary to

hexadecimal

decoder.

Input Output

D C B A X

0 0 0 0 X0

0 0 0 1 X1

0 0 1 0 X2

0 0 1 1 X3

0 1 0 0 X4

0 1 0 1 X5

0 1 1 0 X6

0 1 1 1 X7

1 0 0 0 X8

1 0 0 1 X9

1 0 1 0 X10

1 0 1 1 X11

1 1 0 0 X12

1 1 0 1 X13

1 1 1 0 X14

1 1 1 1 X15

Page 29: ECEG-3201 Digital Logic Design - WordPress.com · Encoder It works opposite ways from decoders. Circuit that allows only one input to be activated, and produces an N-bit output code,

29 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

BCD to Decimal Decoder Act the same as a 4-bit decoder but limited to 10 decimal

digits only

Input Output

D C B A X0 X1 X2 X3 X4 X5 X6 X7 X8 X9

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

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

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

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

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

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

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

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

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

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

Page 31: ECEG-3201 Digital Logic Design - WordPress.com · Encoder It works opposite ways from decoders. Circuit that allows only one input to be activated, and produces an N-bit output code,

31 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

BCD-to-7 Segment Decoder If Active High;

Page 32: ECEG-3201 Digital Logic Design - WordPress.com · Encoder It works opposite ways from decoders. Circuit that allows only one input to be activated, and produces an N-bit output code,

32 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

Encoder

It works opposite ways from decoders.

Circuit that allows only one input to be activated,

and produces an N-bit output code, depending on

which input is activated.

Common encoders:

8-line-to-3-line encoder

Decimal-to-BCD encoder

Page 33: ECEG-3201 Digital Logic Design - WordPress.com · Encoder It works opposite ways from decoders. Circuit that allows only one input to be activated, and produces an N-bit output code,

33 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

8-Line-to-3-Line Encoder Octal to binary converter: Octal input is applied by pressing

one of the push buttons at a time. Circuit converts the applied

input to a binary at the output, X.

Page 34: ECEG-3201 Digital Logic Design - WordPress.com · Encoder It works opposite ways from decoders. Circuit that allows only one input to be activated, and produces an N-bit output code,

34 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

Decimal-to-BCD Encoder Also called 10-Line-to-4-Line converter.

Page 35: ECEG-3201 Digital Logic Design - WordPress.com · Encoder It works opposite ways from decoders. Circuit that allows only one input to be activated, and produces an N-bit output code,

35 AAIT, Department of

Electrical and Computer Engineering

Nebyu Yonas Sutri

Read about Multiplexers, Demultiplexers and

Code Converters.

Digital Fundamentals, Thomas L. Floyd, Chapter 6,

Pages 329 – 342.

What to do this week?