19
EEE2243 Digital System Design Chapter 1: Combinational Logic Recap by Muhazam Mustapha, January 2011

EEE2243 Digital System Design Chapter 1: Combinational Logic Recap by Muhazam Mustapha, January 2011

Embed Size (px)

Citation preview

Page 1: EEE2243 Digital System Design Chapter 1: Combinational Logic Recap by Muhazam Mustapha, January 2011

EEE2243Digital System Design

Chapter 1: Combinational Logic Recap

by Muhazam Mustapha, January 2011

Page 2: EEE2243 Digital System Design Chapter 1: Combinational Logic Recap by Muhazam Mustapha, January 2011

Learning Outcome

• By the end of this chapter, students are expected to refresh their knowledge on combinatorial logic related to HDL

Page 3: EEE2243 Digital System Design Chapter 1: Combinational Logic Recap by Muhazam Mustapha, January 2011

Chapter Content

• Boolean Logic

• Representation of Boolean Function

Page 4: EEE2243 Digital System Design Chapter 1: Combinational Logic Recap by Muhazam Mustapha, January 2011

Boolean Logic

Page 5: EEE2243 Digital System Design Chapter 1: Combinational Logic Recap by Muhazam Mustapha, January 2011

Definition• Boolean algebra has 2 similar but different

definitions for mathematician and engineers• Mathematician: Boolean algebra is part of the

so called abstract mathematics that involves structures and lattice– Wikipedia: http://en.wikipedia.org/wiki/Boolean_algebra_(structure)

• Engineers: Boolean algebra is calculus of truth values that is used as a means to facilitate the design of logic and digital systems– Wikipedia: http://en.wikipedia.org/wiki/Boolean_algebra_(logic)

• We’ll refresh our boolean algebra / logic enough for use with HDL (Verilog)

Page 6: EEE2243 Digital System Design Chapter 1: Combinational Logic Recap by Muhazam Mustapha, January 2011

Boolean Values• Pairs of 2 distinct values

1 0

HIGH LOW

True False

ON OFF

Page 7: EEE2243 Digital System Design Chapter 1: Combinational Logic Recap by Muhazam Mustapha, January 2011

Boolean Operations• OR (binary operation)

– symbol: ‘+’ (plus)– gives true (1) if any of the parameters is true

• AND (binary operation)– symbol: ‘·’ (dot) – optional– gives true (1) if both parameters are true

• NOT (unary operation)– symbol: ‘‾’ (bar / overline)– gives true (1) if the parameter is false– gives false (0) if the parameter is true– also called ‘inverter’

Page 8: EEE2243 Digital System Design Chapter 1: Combinational Logic Recap by Muhazam Mustapha, January 2011

Boolean Operations• NOR

– OR followed by NOT– A NOR B = A+B

• NAND– AND followed by NOT– A NAND B = AB

• XOR– true if either one, but not

both, is true– symbol: ‘⊕’

• XNOR– true if both parameters

are the same– XOR followed by NOT– symbol: ‘ ’⊙

Page 9: EEE2243 Digital System Design Chapter 1: Combinational Logic Recap by Muhazam Mustapha, January 2011

Boolean Gates

AND

NAND

NOT

OR

NOR

XOR

XNOR

Page 10: EEE2243 Digital System Design Chapter 1: Combinational Logic Recap by Muhazam Mustapha, January 2011

Basic Truth Table

A B AB

0 0 0

0 1 0

1 0 0

1 1 1

A B A+B

0 0 0

0 1 1

1 0 1

1 1 1

A B AB

0 0 1

0 1 1

1 0 1

1 1 0

A B A+B

0 0 1

0 1 0

1 0 0

1 1 0

A B

0 0 0

0 1 1

1 0 1

1 1 0

A B

0 0 1

0 1 0

1 0 0

1 1 1

A A

0 1

1 0

AND

NAND

NOT

OR

NOR

XOR

XNOR

BA

BA

Page 11: EEE2243 Digital System Design Chapter 1: Combinational Logic Recap by Muhazam Mustapha, January 2011

General Truth Table

A B C AC B F

0 0 0 0 1 1

0 0 1 0 1 1

0 1 0 0 0 0

0 1 1 0 0 0

1 0 0 0 1 1

1 0 1 1 1 1

1 1 0 0 0 0

1 1 1 1 0 1

• Example of step by step construction of truth table of function:

BACCBAf ),,(

Page 12: EEE2243 Digital System Design Chapter 1: Combinational Logic Recap by Muhazam Mustapha, January 2011

DeMorgan’s Theorem• Used to split groups of large inversion

BABA BAAB

A B A B AB A+B A+B

0 0 1 1 1 0 1

0 1 1 0 0 1 0

1 0 0 1 0 1 0

1 1 0 0 0 1 0

A B A B A+B AB AB

0 0 1 1 1 0 1

0 1 1 0 1 0 1

1 0 0 1 1 0 1

1 1 0 0 0 1 0

Page 13: EEE2243 Digital System Design Chapter 1: Combinational Logic Recap by Muhazam Mustapha, January 2011

DeMorgan’s Theorem• Reflections of DeMorgan’s Theorem on logic

gates

NAND

NOR

BA

BAAB

BA

AB

AB

Negative OR

AB

Negative AND

AB

Page 14: EEE2243 Digital System Design Chapter 1: Combinational Logic Recap by Muhazam Mustapha, January 2011

Representation of Boolean Function

Page 15: EEE2243 Digital System Design Chapter 1: Combinational Logic Recap by Muhazam Mustapha, January 2011

Boolean Function Representation• There are 3 ways of representing boolean

functions that are convenient for HDL:– Truth Table– Minterm (Maxterm is less useful for HDL)– AOI (AND-OR-INVERTER) Gate Tree

(OAI (OR-AND-INVERTER) Gate Tree is less popular)

Page 16: EEE2243 Digital System Design Chapter 1: Combinational Logic Recap by Muhazam Mustapha, January 2011

Boolean Function Representation

A B C F

0 0 0 1

0 0 1 1

0 1 0 0

0 1 1 0

1 0 0 1

1 0 1 1

1 1 0 0

1 1 1 1

Truth Table

ABCCBACBACBACBAF

Sum of Product (SOP)

7)m(0,1,4,5,F

Page 17: EEE2243 Digital System Design Chapter 1: Combinational Logic Recap by Muhazam Mustapha, January 2011

Boolean Function Representation

ABCCBACBACBACBAF

A B C F

Sum of Product Gate Tree in FPGA

× × × ×

× × ×

× × ×

× × ×

×××

×

×

×

×

Page 18: EEE2243 Digital System Design Chapter 1: Combinational Logic Recap by Muhazam Mustapha, January 2011

Boolean Function Representation

A B C F

0 0 0 1

0 0 1 1

0 1 0 0

0 1 1 0

1 0 0 1

1 0 1 1

1 1 0 0

1 1 1 1

Truth Table

C)BA)(CBC)(AB(AF

Product of Sum (POS)

M(2,3,6)F

POS is not so useful for HDL as most of FPGA (programmable logic) hardware are build with SOP structure

Page 19: EEE2243 Digital System Design Chapter 1: Combinational Logic Recap by Muhazam Mustapha, January 2011

Simplification• In introductory courses of digital electronics we

spent so much on boolean function simplification

• Thank God! In intermediate digital electronics we don’t have to do that for FPGA programming

• This is due to the fact that FPGA structure is made of minterms

• This means we are not going to cover function simplification