17
2/2550 A. Yaicharoen 1 Boolean Algebra วววววววววววววววววววววว วววววววววววววววว (Boolean algebra) วววววววววววววววววววววววววววววว (Boolean expression) ววววววววววววว วววววววววววววววววววววววววววววววว วววววววววววววววววว ววววววววววววววววววววววววววววววว ววววววว (combination circuit)

Boolean Algebra

  • Upload
    nariko

  • View
    114

  • Download
    1

Embed Size (px)

DESCRIPTION

Boolean Algebra. วัตถุประสงค์ของบทเรียน รู้จักพีชคณิตบูล (Boolean algebra) รู้จักวิธีการเขียนนิพจน์แบบบูล (Boolean expression) ในรูปแบบต่างๆ สามารถเขียนนิพจน์แบบบูลให้อยู่ในรูปแบบที่สั้นลงได้ ศึกษาวิธีแปลงนิพจน์แบบบูลไปเป็นวงจรผสม (combination circuit). Boolean Algebra. - PowerPoint PPT Presentation

Citation preview

Page 1: Boolean Algebra

2/2550 A. Yaicharoen 1

Boolean Algebra

วั�ตถุ�ประสงค์�ของบทเร�ยน ร� �จั�กพี�ชค์ณิ�ตบ�ล (Boolean algebra) ร� �จั�กวั�ธี�การเข�ยนน�พีจัน�แบบบ�ล (Boolean expression) ในร�ปแบบต"างๆ

สามารถุเข�ยนน�พีจัน�แบบบ�ลให้�อย�"ในร�ปแบบท�&ส� 'นลงได้�

ศึ+กษาวั�ธี�แปลงน�พีจัน�แบบบ�ลไปเป-นวังจัรผสม(combination circuit)

Page 2: Boolean Algebra

2/2550 A. Yaicharoen 2

Boolean Algebra

Boolean algebra ค์/อระบบทางค์ณิ�ตศึาสตร�ท�&น�ก ค์ณิ�ตศึาสตร�ช/&อ George Boole ค์�ด้ข+'นในป0 ค์.ศึ.

1854 ซึ่+&งประกอบด้�วัย• เซึ่2ตของสมาช�ก (B)• binary operation 2 อย"างค์/อ + และ .• เค์ร/&องห้มาย =• วังเล2บเพี/&อแสด้งล3าด้�บของการท3า operation

โด้ยท�&ข�อค์วัาม (postulate) ต"อไปน�'ต�องเป-นจัร�งด้�วัยP1: operation + และ . ต�องม�ค์�ณิสมบ�ต�ป5ด้(closed)

ส3าห้ร�บท�ก x,y B x+y B และ x.y B

Page 3: Boolean Algebra

2/2550 A. Yaicharoen 3

Boolean Algebra

P2: เซึ่2ต B จัะต�องประกอบด้�วัยสมาช�กท�&ม� ค์�ณิสมบ�ต�เอกล�กษณิ� (identity element)

แสด้งด้�วัย 0 ห้ร/อ 1 ส3าห้ร�บท�ก x B0+x = x+0 = x และ 1.x =

x.1 = xP3: operation + และ . ต�องม�ค์�ณิสมบ�ต�การ

สล�บท�& (commutative) ส3าห้ร�บท�ก x,y Bx+y = y+x และ x.y = y.x

Page 4: Boolean Algebra

2/2550 A. Yaicharoen 4

Boolean Algebra

P4: operation + และ . ต�องม�ค์�ณิสมบ�ต�การกระจัาย(distributive)

ส3าห้ร�บท�ก x,y,z Bx+(y.z) = (x+y).(x+z) และ x.(y+z)

= (x.y)+(x.z)P5: ส3าห้ร�บท�กสมาช�ก x ใน B จัะต�องม� x' ซึ่+&งเป-นcompliment ของ x ซึ่+&งจัะท3าให้�

x+x' = 1 และ x.x' = 0 P6: ในเซึ่2 ต B จัะต�องม�สมาช�กอย"างน�อยสองต�วัท�&ไม"เท"าก�น

x,y B โด้ยท�& x y

Page 5: Boolean Algebra

2/2550 A. Yaicharoen 5

Boolean Algebra: Rules and Theories

Principle of Duality: ในพี�ชค์ณิ�ตบ�ล�น expression ทางซึ่�ายม/อและทางขวัาม/อของ

เค์ร/&องห้มาย = จัะย�งค์งเป-นจัร�ง เม/&อม�การ เปล�&ยนแปลงเค์ร/&องห้มายระห้วั"าง + ก�บ . และ 1

ก�บ 0

ทฤษฎี�อ/&นๆ- x' จัะม�เพี�ยงค์"าเด้�ยวัโด้ยจัะข+'นอย�"ก�บค์"า x- ส3าห้ร�บท�กสมาช�ก x ในเซึ่2ต B

x+1 = 1 และ x.0 = 0

Page 6: Boolean Algebra

2/2550 A. Yaicharoen 6

Boolean Algebra: Rules and Theories

- identity element จัะเป-น complement ของ identity element ท�&เห้ล/อ

0' = 1 และ 1' = 0

- Idempotent lawx+x = x และ xx = x

- Involution law(x')' = x

Page 7: Boolean Algebra

2/2550 A. Yaicharoen 7

Boolean Algebra: Rules and Theories

- Absorption lawx+xy = x และ x(x+y) = x

- ส3าห้ร�บท�กค์�"ของสมาช�ก x,yx+(x'.y) = x+y และ x.

(x'+y) = xy

- Operators + และ . ม�ค์�ณิสมบ�ต�associative

x+(y+z) = (x+y)+z และ x(yz) = (xy)z

Page 8: Boolean Algebra

2/2550 A. Yaicharoen 8

Boolean Algebra: Rules and Theories

- DeMorgan’s law(x+y)' = x' y'(xy)' = x' +y'

( ในระบบด้�จั�ตอล สมาช�กในเซึ่2ต B ค์/อ 0 และ 1 เท"าน�'น)

+ ค์/อ or-operation ในระบบลอจั�ก . ค์/อ and-operation ในระบบลอจั�ก

Page 9: Boolean Algebra

2/2550 A. Yaicharoen 9

Boolean Formulas and Functions

Boolean formula ห้ร/อ expression เป-น ข�อค์วัามท�&ประกอบด้�วัยค์"าค์งท�&ห้ร/อต�วัแปรทาง

Boolean ก�บ Boolean operation ท�&ใช�ใน การอธี�บายการท3างานของ Boolean

function โด้ยจัะอย�"ในร�ปของf(x,y,z) = Boolean expression ห้ร/อf = Boolean expression

โด้ยอาจัจัะอย�"ในร�ปของ normal formula ห้ร/อ canonical formula

Page 10: Boolean Algebra

2/2550 A. Yaicharoen 10

Canonical Formulas

เป-นการเข�ยน Boolean function ข+'นจัากtruth table

โด้ยในแต"ละเทอมจัะต�องม�ต�วัแปรค์รบท�กต�วัแปรม�สองร�ปแบบค์/อ1. Minterm canonical formulas แต"ละ

เทอมจัะอย�"ในร�ปของผลค์�ณิ แล�วัจั+งน3ามาบวักก�น2. Maxterm canonical formulas แต"ละเทอมจัะอย�"ในร�ปของผลบวัก แล�วัจั+งน3ามาค์�ณิก�น

Page 11: Boolean Algebra

2/2550 A. Yaicharoen 11

Minterm Canonical Formulas

อาจัเร�ยกเป-น standard sum-of-products ห้ร/อ disjunctive canonical formulas

สามารถุเข�ยนให้�อย�"ในร�ปของ m-notationf(v1,v2,...,vn) = mi + mj + mk + ml

โด้ยท�& 0 i,j,k,l 2n-1ห้ร/อ f(v1,v2,...,vn) = m(i,j,k,l)

Page 12: Boolean Algebra

2/2550 A. Yaicharoen 12

Maxterm Canonical Formulas

อาจัเร�ยกเป-น standard product-of-sums ห้ร/อ conjunctive canonical formulas

สามารถุเข�ยนให้�อย�"ในร�ปของ M-notationf(v1,v2,...,vn) = Mi Mj Mk Ml

โด้ยท�& 0 i,j,k,l 2n-1 ห้ร/อ f(v1,v2,...,vn) =

M(i,j,k,l)

Page 13: Boolean Algebra

2/2550 A. Yaicharoen 13

Examples

Normal form:

f(x,y,z) = x'y+z

Minterm canonical formulas:

f(x,y,z) = x'yz'+x'yz+x'y'z+xy'z+xyz

m-notation:

f(x,y,z) = m2+m3+m1+m5+m7

f(x,y,z) = m(1,2,3,5,7)

Page 14: Boolean Algebra

2/2550 A. Yaicharoen 14

Examples

Normal form:

f(x,y,z) = (x'+z).(y+z)

Maxterm canonical formulas:

f(x,y,z) = (x+y+z).(x'+y+z).(x'+y'+z)

M-notation: f(x,y,z) = M0.M4.M6

f(x,y,z) = ∏M(0,4,6)

Page 15: Boolean Algebra

2/2550 A. Yaicharoen 15

Boolean Expression Manipulation

1. Equation complementation เป-นการห้า complement ของสมการโด้ยใช�กฎีของ DeMorgan

2. Expansion about a variable เป-นการจั�ด้ให้�อย�"ในร�ปf(x1,...,xi,...,xn) = xig1+xig2 ห้ร/อ (xi+h1).(xi+h2)

โด้ยท�& g1,g2,h1,h2 ไม"ม� xi อย�"ด้�วัยเลย ซึ่�&งจัะใช� Shannon’s expansion theorem ในการจั�ด้f(x1,...,xi,...,xn) ให้�อย�"ในร�ป= xi.f(x1,...,1,...,xn)+xi'.f(x1,..., 0,...,xn) ห้ร/อ= [xi+f(x1,...,0,...,xn)].[xi'+f(x1,..., 1,...,xn)]

Page 16: Boolean Algebra

2/2550 A. Yaicharoen 16

Boolean Expression Manipulation

3. Equation simplification เป-นการห้าร�ปท�&ส� 'นท�&ส�ด้ของ สมการ โด้ยใช�กฎีต"างๆของ Boolean algebra

4. Reduction theorem เป-นวั�ธี�การท3าให้�ได้�ร�ปสมการท�&ส� 'นลงโด้ย ใช� Shannon’s reduction theorems ช"วัยลด้ร�ปสมการ

xi.f(x1,...,xi,...,xn)=xi.f(x1,...,1,...,xn) ห้ร/อxi+f(x1,..., xi,...,xn)=xi +f(x1,...,0,...,xn)

และxi'.f(x1,...,xi,...,xn)=xi'.f(x1,...,0,...,xn) ห้ร/อxi'+f(x1,..., xi,...,xn)=xi' +f(x1,...,1,...,xn)

Page 17: Boolean Algebra

2/2550 A. Yaicharoen 17

Boolean Expression Manipulation

5. จั�ด้ให้�อย�"ในร�ป Minterm canonical formulas

6. จั�ด้ให้�อย�"ในร�ป Maxterm canonical formulas

7. การห้า complement ของcanonical formulas สามารถุท3าได้�โด้ยการห้าเทอมท�&เห้ล/ออย�"ในตารางค์"าค์วัามจัร�ง