practice 2: digital systems€¦ · 19 practice 2: digital systems october 25, 2011 bonus question...

22
Digital Electronic Circuits – Semester A 2012 Practice 2: Digital Systems

Upload: others

Post on 08-Oct-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Practice 2: Digital Systems€¦ · 19 Practice 2: Digital Systems October 25, 2011 Bonus Question –From Job Interviews Reminder: Encoder A (one-hot) encoder receives 2n bits and

Digital Electronic Circuits – Semester A 2012

Practice 2:

Digital Systems

Page 2: Practice 2: Digital Systems€¦ · 19 Practice 2: Digital Systems October 25, 2011 Bonus Question –From Job Interviews Reminder: Encoder A (one-hot) encoder receives 2n bits and

Boolean Algebra

Page 3: Practice 2: Digital Systems€¦ · 19 Practice 2: Digital Systems October 25, 2011 Bonus Question –From Job Interviews Reminder: Encoder A (one-hot) encoder receives 2n bits and

October 25, 2011Practice 2: Digital Systems3

Boolean Algebra – Basic Identities

Additive

Multiplicative

0A A

0 0A

1 1A

1A A

A A A

A A A

1A A

0A A

Page 4: Practice 2: Digital Systems€¦ · 19 Practice 2: Digital Systems October 25, 2011 Bonus Question –From Job Interviews Reminder: Encoder A (one-hot) encoder receives 2n bits and

October 25, 2011Practice 2: Digital Systems4

Boolean Algebra – Basic Identities

Some Important Identities

0A A

1A A

A AB A B

A B A B

A A A A A

1 x

A AB A B

AB A B

Page 5: Practice 2: Digital Systems€¦ · 19 Practice 2: Digital Systems October 25, 2011 Bonus Question –From Job Interviews Reminder: Encoder A (one-hot) encoder receives 2n bits and

October 25, 2011Practice 2: Digital Systems5

Boolean Algebra – Function Minimization

Minimize the following function:

f A ABC A ABC A A B C

A BC A BC A BC

A A B C A A B C A ABC A BC

1A BC A BC

A BC

Page 6: Practice 2: Digital Systems€¦ · 19 Practice 2: Digital Systems October 25, 2011 Bonus Question –From Job Interviews Reminder: Encoder A (one-hot) encoder receives 2n bits and

October 25, 2011Practice 2: Digital Systems6

Boolean Algebra – Complementation

DeMorgan’s Theorem:

NAND:

NOR:

Find the complementary expression for

f A B f A B

f A B f A B

f A BC AB

f A BC AB

A BC AB

A A B AB

A B C A B

B B C BC

AB B C

ABC

Page 7: Practice 2: Digital Systems€¦ · 19 Practice 2: Digital Systems October 25, 2011 Bonus Question –From Job Interviews Reminder: Encoder A (one-hot) encoder receives 2n bits and

October 25, 2011Practice 2: Digital Systems7

Boolean Algebra – Universality

A universal set in Boolean Algebra comprises of the following

functions:

NOT

AND or OR

Several complex gates can independently comprise universal

sets, such as:

NAND

NOR

MUX

Page 8: Practice 2: Digital Systems€¦ · 19 Practice 2: Digital Systems October 25, 2011 Bonus Question –From Job Interviews Reminder: Encoder A (one-hot) encoder receives 2n bits and

October 25, 2011Practice 2: Digital Systems8

Boolean Algebra – Universality

Implement the following function using only NAND gates.

f ABC AC D

f

( )DeMorgan ABC AC D

ABC AC D

Page 9: Practice 2: Digital Systems€¦ · 19 Practice 2: Digital Systems October 25, 2011 Bonus Question –From Job Interviews Reminder: Encoder A (one-hot) encoder receives 2n bits and

Mutliplexers

Page 10: Practice 2: Digital Systems€¦ · 19 Practice 2: Digital Systems October 25, 2011 Bonus Question –From Job Interviews Reminder: Encoder A (one-hot) encoder receives 2n bits and

October 25, 2011Practice 2: Digital Systems10

Multiplexers - Reminder

Page 11: Practice 2: Digital Systems€¦ · 19 Practice 2: Digital Systems October 25, 2011 Bonus Question –From Job Interviews Reminder: Encoder A (one-hot) encoder receives 2n bits and

October 25, 2011Practice 2: Digital Systems11

Multiplexers - Example

Implement the following function using 41 Multiplexers:

, , , 0,1,5,7,13,14f A B C D

0

f AB C

f AB D

f AB C D

f AB

Page 12: Practice 2: Digital Systems€¦ · 19 Practice 2: Digital Systems October 25, 2011 Bonus Question –From Job Interviews Reminder: Encoder A (one-hot) encoder receives 2n bits and

October 25, 2011Practice 2: Digital Systems12

Multiplexers

Implement the following function using 41 Multiplexers:

, , , 0,1,5,7,13,14f A B C D

0

f AB C

f AB D

f AB C D

f AB

Page 13: Practice 2: Digital Systems€¦ · 19 Practice 2: Digital Systems October 25, 2011 Bonus Question –From Job Interviews Reminder: Encoder A (one-hot) encoder receives 2n bits and

Finite State Machines

Page 14: Practice 2: Digital Systems€¦ · 19 Practice 2: Digital Systems October 25, 2011 Bonus Question –From Job Interviews Reminder: Encoder A (one-hot) encoder receives 2n bits and

October 25, 2011Practice 2: Digital Systems14

Finite State Machines

All digital circuits are constructed using FSMs:

q is the state vector

x is the input vector

Page 15: Practice 2: Digital Systems€¦ · 19 Practice 2: Digital Systems October 25, 2011 Bonus Question –From Job Interviews Reminder: Encoder A (one-hot) encoder receives 2n bits and

October 25, 2011Practice 2: Digital Systems15

Finite State Machines

Moore machines have a predefined

output for each state:

Mealy machines have an output that

is determined by the previous state

and the input:

Page 16: Practice 2: Digital Systems€¦ · 19 Practice 2: Digital Systems October 25, 2011 Bonus Question –From Job Interviews Reminder: Encoder A (one-hot) encoder receives 2n bits and

October 25, 2011Practice 2: Digital Systems16

Finite State Machines - Example

Parity Counter

Page 17: Practice 2: Digital Systems€¦ · 19 Practice 2: Digital Systems October 25, 2011 Bonus Question –From Job Interviews Reminder: Encoder A (one-hot) encoder receives 2n bits and

October 25, 2011Practice 2: Digital Systems17

Finite State Machines – Example 2

2-bit Counter

Page 18: Practice 2: Digital Systems€¦ · 19 Practice 2: Digital Systems October 25, 2011 Bonus Question –From Job Interviews Reminder: Encoder A (one-hot) encoder receives 2n bits and

Bonus Qustion

If we have time…

Page 19: Practice 2: Digital Systems€¦ · 19 Practice 2: Digital Systems October 25, 2011 Bonus Question –From Job Interviews Reminder: Encoder A (one-hot) encoder receives 2n bits and

October 25, 2011Practice 2: Digital Systems19

Bonus Question – From Job Interviews

Reminder: Encoder

A (one-hot) encoder receives 2n bits and outputs the binary

position of the only 1.

This is the opposite operation of a Decoder.

A “Priority Encoder” or a Leading Ones Detector:

Outputs the binary position of the first 1 in the input vector.

These are often used to select the highest priority interrupt if

several are asserted at the same time.

Page 20: Practice 2: Digital Systems€¦ · 19 Practice 2: Digital Systems October 25, 2011 Bonus Question –From Job Interviews Reminder: Encoder A (one-hot) encoder receives 2n bits and

October 25, 2011Practice 2: Digital Systems20

Bonus Question – From Job Interviews

Create a 4-bit Priority Encoder:

4 bit input vector (I3I2I1I0)

2 bit output (O1O0) – encoding the place of the leading ‘1’

1 bit flag (F) – showing that no ‘1’ was found

Page 21: Practice 2: Digital Systems€¦ · 19 Practice 2: Digital Systems October 25, 2011 Bonus Question –From Job Interviews Reminder: Encoder A (one-hot) encoder receives 2n bits and

October 25, 2011Practice 2: Digital Systems21

Bonus Question – From Job Interviews

3 2 1 0 3 2 1 0F I I I I I I I I

1 1 0 1 0O I I I I

0 0 2 1O I I I

I3 I2 I1 I0 O1 O0 F

X X X 1 0 0 0

X X 1 0 0 1 0

X 1 0 0 1 0 0

1 0 0 0 1 1 0

0 0 0 0 X X 1

Page 22: Practice 2: Digital Systems€¦ · 19 Practice 2: Digital Systems October 25, 2011 Bonus Question –From Job Interviews Reminder: Encoder A (one-hot) encoder receives 2n bits and

October 25, 2011Practice 2: Digital Systems22

Bonus Question – From Job Interviews

Using 4-bit Priority Encoders, create a 16-bit Priority

Encoder.