Top Banner
Boolean Algebra and Combinatorial Circuits
19

Boolean Algebra and Combinatorial Circuitsstaff.kmutt.ac.th/~isurnich/ftp/CMM 131/04 Boolean... · Boolean Algebra and Combinatorial Circuits. Introduction •Combinatorial circuit

Jan 18, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Boolean Algebra and Combinatorial Circuitsstaff.kmutt.ac.th/~isurnich/ftp/CMM 131/04 Boolean... · Boolean Algebra and Combinatorial Circuits. Introduction •Combinatorial circuit

Boolean Algebra and Combinatorial Circuits

Page 2: Boolean Algebra and Combinatorial Circuitsstaff.kmutt.ac.th/~isurnich/ftp/CMM 131/04 Boolean... · Boolean Algebra and Combinatorial Circuits. Introduction •Combinatorial circuit

Introduction

• Combinatorial circuit• The output is uniquely defined for every combination of

inputs

• No memory: previous inputs and the state of the system do not affect

• Only combination of the logic gates

• Sequential circuit• Output is a function, not only of the input but also of the

state of the system

Page 3: Boolean Algebra and Combinatorial Circuitsstaff.kmutt.ac.th/~isurnich/ftp/CMM 131/04 Boolean... · Boolean Algebra and Combinatorial Circuits. Introduction •Combinatorial circuit

Basis Gate type AND

𝑥1⋀𝑥2 = ቊ1 if 𝑥1 = 1 𝑎𝑛𝑑 𝑥2 = 10 otherwise

OR

𝑥1 ∨ 𝑥2 = ቊ1 if 𝑥1 = 1 or 𝑥2 = 10 otherwise

NOT

ҧ𝑥 = ቊ1 𝑖𝑓 𝑥 = 00 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒

𝑥1 𝑥2 𝑥1⋀𝑥2 𝑥1 ∨ 𝑥2 ҧ𝑥1

1 1 1 1 0

1 0 0 1 0

0 1 0 1 1

0 0 0 0 1

Page 4: Boolean Algebra and Combinatorial Circuitsstaff.kmutt.ac.th/~isurnich/ftp/CMM 131/04 Boolean... · Boolean Algebra and Combinatorial Circuits. Introduction •Combinatorial circuit

Example of combinatorial circuit

𝑦 = 𝑥1⋀𝑥2 ∨ 𝑥3

Page 5: Boolean Algebra and Combinatorial Circuitsstaff.kmutt.ac.th/~isurnich/ftp/CMM 131/04 Boolean... · Boolean Algebra and Combinatorial Circuits. Introduction •Combinatorial circuit

Properties Associative Laws𝑎 ∨ 𝑏 ∨ 𝑐 = 𝑎 ∨ 𝑏 ∨ 𝑐 𝑎⋀𝑏 ⋀𝑐 = 𝑎⋀ 𝑐⋀𝑏 ∀(𝑎, 𝑏, 𝑐) ∈ 𝑍2

Commutative laws𝑎 ∨ 𝑏 = 𝑏 ∨ 𝑎 𝑎⋀𝑏 = 𝑏⋀𝑎 ∀ 𝑎, 𝑏, 𝑐 ∈ 𝑍2

Distributive laws𝑎⋀ 𝑏 ∨ 𝑐 = 𝑎⋀𝑏 ∨ 𝑎⋀𝑐

𝑎 ∨ 𝑏⋀𝑐 = 𝑎 ∨ 𝑏 ⋀ 𝑎 ∨ 𝑐 ∀𝑎, 𝑏, 𝑐 ∈ 𝑍2Identity Laws

𝑎 ∨ 0 = 𝑎 𝑎⋀1 = 𝑎 ∀𝑎 ∈ 𝑍2Complement Laws

𝑎 ∨ ത𝑎 = 1 𝑎⋀ത𝑎 = 0 ∀𝑎 ∈ 𝑍2

Page 6: Boolean Algebra and Combinatorial Circuitsstaff.kmutt.ac.th/~isurnich/ftp/CMM 131/04 Boolean... · Boolean Algebra and Combinatorial Circuits. Introduction •Combinatorial circuit

Boolean Algebra

Page 7: Boolean Algebra and Combinatorial Circuitsstaff.kmutt.ac.th/~isurnich/ftp/CMM 131/04 Boolean... · Boolean Algebra and Combinatorial Circuits. Introduction •Combinatorial circuit

Laws of Boolean algebra

• Associative Law𝑥 + 𝑦 + 𝑧 = 𝑥 + 𝑦 + 𝑧𝑥 ⋅ 𝑦 ⋅ 𝑧 = 𝑥 ⋅ (𝑦 ⋅ 𝑧)

• Communicative Law𝑥 + 𝑦 = 𝑦 + 𝑥, 𝑥 ⋅ 𝑦 = 𝑦 ⋅ 𝑥 ∀𝑥 ∈ 𝑆

• Distributive law𝑥 ⋅ 𝑦 + 𝑧 = 𝑥 ⋅ 𝑦 + 𝑥 ⋅ 𝑧

𝑥 + 𝑦 ⋅ 𝑧 = 𝑥 + 𝑦 ⋅ 𝑥 + 𝑧 ∀𝑥 ∈ 𝑆

• Identity Law𝑥 + 0 = 𝑥, 𝑥 ⋅ 1 = 𝑥 ∀𝑥 ∈ 𝑆

• Complement Law𝑥 + 𝑥′ = 1 𝑥 ⋅ 𝑥′ = 0 ∀𝑥 ∈ 𝑆

Page 8: Boolean Algebra and Combinatorial Circuitsstaff.kmutt.ac.th/~isurnich/ftp/CMM 131/04 Boolean... · Boolean Algebra and Combinatorial Circuits. Introduction •Combinatorial circuit

Theorem

Let 𝐵 = (𝑠, +,⋅,′ , 0,1) be a Boolean algebra. Here are the properties

(a) Idempotent Law:𝑥 + 𝑥 = 𝑥, 𝑥𝑥 = 𝑥 ∀𝑥 ∈ 𝑆

(b) Bound Law𝑥 + 1 = 1, 𝑥 ⋅= 0 ∀𝑥 ∈ 𝑆

(c) Absorption Laws𝑥 + 𝑥𝑦 = 𝑥, 𝑥 𝑥 + 𝑦 = 𝑥 ∀𝑥, 𝑦 ∈ 𝑆

(d) Involution Laws𝑥′ ′ = 𝑥 ∀𝑥 ∈ 𝑆

(e) 0 and 1 laws0′ = 1, 1′ = 0

(f) De Morgan’s law for Boolean algebras𝑥 + 𝑦 ′ = 𝑥′𝑦′, 𝑥𝑦 ′ = 𝑥′ + 𝑦′ ∀𝑥, 𝑦 ∈ 𝑆

Page 9: Boolean Algebra and Combinatorial Circuitsstaff.kmutt.ac.th/~isurnich/ftp/CMM 131/04 Boolean... · Boolean Algebra and Combinatorial Circuits. Introduction •Combinatorial circuit

Boolean Functions and Synthesis of Circuits

• Sometime we need a circuit for a specified task

• Ex. Exclusive or from basis Boolean type𝑥1⨁𝑥2

Input set = {(1,1),(1,0),(0,1),(0,0)}

Output range 𝑧2 = 0,1

Writing 𝑥1⨁𝑥2 = 𝑋(𝑥1, 𝑥2)

Solution: Use the combination of basis logic gate to solve the equation

Page 10: Boolean Algebra and Combinatorial Circuitsstaff.kmutt.ac.th/~isurnich/ftp/CMM 131/04 Boolean... · Boolean Algebra and Combinatorial Circuits. Introduction •Combinatorial circuit

DefinitionLet 𝑋 𝑥1, 𝑥2, … , 𝑥𝑛 be a Boolean expression

A Boolean function has a form𝑓 𝑥1, 𝑥2, … , 𝑥𝑛 = 𝑋(𝑥1, 𝑥2, … , 𝑥𝑛)

Ex 𝑓: 𝑧23 → 𝑧2

𝑓 𝑥1, 𝑥2, 𝑥3 = 𝑥1⋀ ҧ𝑥2 ∨ 𝑥3

𝑥1 𝑥2 𝑥3 𝑓 𝑥1, 𝑥2, 𝑥31 1 1 11 1 0 01 0 1 11 0 0 10 1 1 00 1 0 00 0 1 00 0 0 0

Page 11: Boolean Algebra and Combinatorial Circuitsstaff.kmutt.ac.th/~isurnich/ftp/CMM 131/04 Boolean... · Boolean Algebra and Combinatorial Circuits. Introduction •Combinatorial circuit

Ex.

Find combinatorial circuit for this truth table

Consider the first row get

𝑓1 𝑥1, 𝑥2, 𝑥3 = 𝑥1⋀𝑥2⋀𝑥3

4th row

𝑓4 𝑥1, 𝑥2, 𝑥3 = 𝑥1⋀ ҧ𝑥2⋀ ҧ𝑥3

6th row

𝑓6 𝑥1, 𝑥2, 𝑥3 = ҧ𝑥1⋀𝑥2⋀ ҧ𝑥3

From the theory OR all the term

𝑓 𝑥1, 𝑥2, 𝑥3 = 𝑥1⋀𝑥2⋀𝑥3 ∨ 𝑥1⋀ ҧ𝑥2⋀ ҧ𝑥3 ∨ ҧ𝑥1⋀𝑥2⋀ ҧ𝑥3

𝑥1 𝑥2 𝑥3 𝑓(𝑥1, 𝑥2, 𝑥3)

1 1 1 1

1 1 0 0

1 0 1 0

1 0 0 1

0 1 1 0

0 1 0 1

0 0 1 0

0 0 0 0

Page 12: Boolean Algebra and Combinatorial Circuitsstaff.kmutt.ac.th/~isurnich/ftp/CMM 131/04 Boolean... · Boolean Algebra and Combinatorial Circuits. Introduction •Combinatorial circuit

minterm

Let 𝑥1, 𝑥2, … , 𝑥𝑛 is a Boolean expression of the form𝑦1⋀𝑦2⋀…⋀𝑦𝑛

Where 𝑦𝑖 is either 𝑥𝑖 or ҧ𝑥𝑖Theorem:

If 𝑓: 𝑧2𝑛 → 𝑧2, 𝑡ℎ𝑒𝑛 𝑓 is a Boolean function. If 𝑓 is not identically zero,

let 𝐴1, … , 𝐴𝑘 : elements 𝐴𝑖 of 𝑍2𝑛 for which 𝑓 𝐴𝑖 = 𝑎1, … , 𝑎𝑛 , set

𝑚𝑖 = 𝑦1⋀…⋀𝑦𝑛Where

𝑦𝑗 = ൝𝑥𝑗 𝑖𝑓𝑎𝑗 = 1

ҧ𝑥𝑗 𝑖𝑓 𝑎𝑗 = 0

Then 𝑓 𝑥1, … , 𝑥𝑛 = 𝑚1 ∨ ⋯∨𝑚𝑘

Called: Disjunctive normal form of function 𝑓

Page 13: Boolean Algebra and Combinatorial Circuitsstaff.kmutt.ac.th/~isurnich/ftp/CMM 131/04 Boolean... · Boolean Algebra and Combinatorial Circuits. Introduction •Combinatorial circuit

Applications

A design for Boolean combinatorial circuit from some combinatorial of gate AND, OR and not

A gate is a function form 𝑍2𝑛 into 𝑍2

AND gate 𝑍22 into 𝑍2

NOT gate 𝑍2 into 𝑍2

Page 14: Boolean Algebra and Combinatorial Circuitsstaff.kmutt.ac.th/~isurnich/ftp/CMM 131/04 Boolean... · Boolean Algebra and Combinatorial Circuits. Introduction •Combinatorial circuit

NAND gate

• Denotation𝑥 ↑ 𝑦 = 𝑥𝑦

Let 𝑥1, 𝑥2 as input

𝑥1 ↑ 𝑥2 = ቊ0 if 𝑥1 = 1 and 𝑥2 = 11 otherwise

Additionalҧ𝑥 = 𝑥𝑥 = 𝑥 ↑ 𝑥

𝑥 ∨ 𝑦 = ҧ𝑥 ത𝑦 = ҧ𝑥 ↑ ത𝑦 = 𝑥 ↑ 𝑥 ↑ 𝑦 ↑ 𝑦

Page 15: Boolean Algebra and Combinatorial Circuitsstaff.kmutt.ac.th/~isurnich/ftp/CMM 131/04 Boolean... · Boolean Algebra and Combinatorial Circuits. Introduction •Combinatorial circuit

Ex1

Design combinatorial circuits using NAND gate to compute the functions 𝑓1 𝑥 = ҧ𝑥 and 𝑓2 𝑥, 𝑦 = 𝑥 ∨ 𝑦

Page 16: Boolean Algebra and Combinatorial Circuitsstaff.kmutt.ac.th/~isurnich/ftp/CMM 131/04 Boolean... · Boolean Algebra and Combinatorial Circuits. Introduction •Combinatorial circuit

Ex2.

Consider this table

The disjunctive normal is

𝑓 𝑥, 𝑦, 𝑧 = 𝑥𝑦𝑧 ∨ 𝑥𝑦 ҧ𝑧 ∨ 𝑥 ത𝑦 ҧ𝑧

The combinatorial circuit is

𝑥 𝑦 𝑧 𝑓(𝑥, 𝑦, 𝑧)1 1 1 11 1 0 11 0 1 01 0 0 10 1 1 00 1 0 00 0 1 00 0 0 0

Page 17: Boolean Algebra and Combinatorial Circuitsstaff.kmutt.ac.th/~isurnich/ftp/CMM 131/04 Boolean... · Boolean Algebra and Combinatorial Circuits. Introduction •Combinatorial circuit

The half adder

Accept as input two bits x and y and produces as output binary sum 𝑐𝑠 of x and 𝑦. The term 𝑐𝑠 is a two-bit binary number: s is sum and c is carry

By Observation𝑐 = 𝑥𝑦, 𝑠 = 𝑥⨁𝑦

𝑥 𝑦 𝑐 𝑠

1 1 1 0

1 0 0 1

0 1 0 1

0 0 0 0

Page 18: Boolean Algebra and Combinatorial Circuitsstaff.kmutt.ac.th/~isurnich/ftp/CMM 131/04 Boolean... · Boolean Algebra and Combinatorial Circuits. Introduction •Combinatorial circuit

The full adder

Accept input three bits 𝑥, 𝑦 𝑎𝑛𝑑 𝑧

Outputs 𝑐, 𝑠

Binary equations𝑠 = 𝑥⨁𝑦⨁𝑧𝑐 = 𝑥𝑦𝑧 ∨ 𝑥𝑦 ҧ𝑧 ∨ 𝑥 ത𝑦𝑧 ∨ ҧ𝑥𝑦𝑧= 𝑥𝑦 ∨ 𝑥 ത𝑦𝑧 ∨ ҧ𝑥𝑦𝑧= 𝑥𝑦 ∨ 𝑥𝑦𝑧 ∨ 𝑥ത𝑦𝑧 ∨ ҧ𝑥𝑦𝑧= 𝑥𝑦 ∨ 𝑥𝑧 ∨ ҧ𝑥𝑦𝑧= 𝑥𝑦 ∨ 𝑥𝑧 ∨ 𝑥𝑦𝑧 ∨ ҧ𝑥𝑦𝑧= 𝑥𝑦 ∨ 𝑥𝑧 ∨ 𝑦𝑧= 𝑥𝑦 ∨ 𝑧(𝑥 ∨ 𝑦)

𝑥 𝑦 𝑧 𝑐 𝑠

1 1 1 1 1

1 1 0 1 0

1 0 1 1 0

1 0 0 0 1

0 1 1 1 0

0 1 0 0 1

0 0 1 0 1

0 0 0 0 0

Page 19: Boolean Algebra and Combinatorial Circuitsstaff.kmutt.ac.th/~isurnich/ftp/CMM 131/04 Boolean... · Boolean Algebra and Combinatorial Circuits. Introduction •Combinatorial circuit

3 bits adder