SlideShare ist ein Scribd-Unternehmen logo
1 von 112
บทที่ 3
พีชคณิตบูลีน และการออกแบบ
วงจรลอจิก
(Boolean Algebra and
Design of Logic Circuit)
กล่าวนำา
อริสโตเติล นักปรัชญาชาวกรีกได้ทำาการ
ศึกษาเกี่ยวกับ Logic และได้พัฒนามาใช้
เป็นเครื่องมือแก้ปัญหาทางปรัชญาของเขา
หลักจากปี ค.ศ.1930 วงจร Logic ได้ถูก
นำามาใช้ในการวิเคราะห์ระบบ Switching
ของเครื่องชุมสายโทรศัพท์แบบอัตโนมัติ
และในปัจจุบัน วงจร Logic เข้ามามี
บทบาทในการรับส่งสัญญาณและข้อมูล
ต่างๆ มากมาย เราจึงจำาเป็นต้องเรียนรู้และ
ทำาความเข้าในสนหลักการและเทคนิคของ
•หลักการเบื้องต้นของวงจร Logic
–การศึกษาวงจร Logic เบื้องต้น จะศึกษา
เกี่ยวกับ Two – State Logic คือใช้ตัวแปร
ค่า 2 สภาวะโดยมีข้อกำาหนดคือ Input และ
Output ของวงจร Logic สามารถมีได้เพียง
2 สภาวะเท่านั้น และจะอยู่ในสภาวะใด
สภาวะหนึ่งเท่านั้น จะอยู่ทั้ง 2 สภาวะในเวลา
เดียวกันไม่ได้ Logic 2 สภาวะดังกล่าว อาจ
ใช้แทนความหมายต่างๆ ได้ เช่น สูง-ตำ่า 1-0
ปิด-เปิด ใช้-ไม่ใช้ ทำางาน-ไม่ทำางาน มี-ไม่มี
ฯลฯ
•ในระบบ Electronic Logic เราใช้ระดับ
ของแรงดันไฟฟ้า (Voltage Level) แทน
สภาวะทั้งสองเมื่อใช้ Logic 1 แทนแรงดัน
ที่เป็นบวกมากกว่า เราก็ใช้ Logic 0 แทน
แรงดันที่เป็นบวกน้อยกว่า ระบบเช่นนี้เรียก
ว่า Positive Logic ในทางกลับกัน ถ้าใช้
Logic 1 แทนแรงดันที่เป็นลบมากกว่า เรา
ก็ใช้ Logic 0 แทนแรงดันที่เป็นลบน้อย
กว่า ระบบเช่นนี้เรียกว่า Negative Logic
ตัวอย่างของ Positive และ Negative
ก. Positive Logic
ข. Negative Logic
•หลักการเบื้องต้นของพีชคณิตบูลีน
(Boolean Algebra)
–พีชคณิตบูลีน เป็นเทคนิคแบบหนึ่งที่ใช้
ในการลดรูป Switching Function ซึ่ง
ผู้คิดค้นนี้คือนักคณิตศาสตร์ชาวอังกฤษ
ชื่อ George Boole ในพีชคณิตบูลีน
เราใช้ตัวอักษร A, B, C,……… แทน
ตัวแปรค่า 2 สภาวะ คือ 0 หรือ 1 ความ
สัมพันธ์ระหว่างตัวแปรแต่ละตัว เราใช้
เครื่องหมายทางเลขคณิตแทน ความ
เครื่องหมาย . แทนความ
หมาย AND
เครื่องหมาย + แทนความ
หมาย OR
เครื่องหมาย - (Bar) แทน
ความหมาย NOT
 AND
ND ใช้ Contact ข. วงจร AN
รูปที่ 3.2 วงจร AND
3.2
คือ ดวงไฟจะติดก็ต่อเมื่อสวิทช์
A
และสวิทช์ B ปิด ดังได้กล่าวมา
แล้วว่า
เรากำาหนดให้ สวิทช์ปิด
คือ Logic 1 สวิทช์เปิด คือ
Logic 0ไฟติด คือ Logic 1 ไฟ
ดับ คือ Logic 0
ดังนั้น เราสามารถเขียนตาราง
ความจริง
(Truth Table) สำาหรับวงจร
A B Y = A.B
0 0 0
0 1 0
1 0 0
1 1 1
ตารางที่ 3.1 Truth Table
3.3.2 วงจร OR
ก. วงจร OR ใช้ Contact ข.
วงจร OR ใช้สวิทช์
รูปที่ 3.3 วงจร OR
หน้าที่ OR อธิบายได้ตามรูปที่ 3.3 คือ
ดวงไฟจะติดก็ต่อเมื่อสวิทช์ A หรือ สวิทช์ B
ตัวใดตัวหนึ่งหรือทั้งสองตัวปิด ดังนั้นเรา
สามารถเขียนตารางความจริงสำาหรับวงจร
OR ได้ดังนี้
A B Y = A + B
0 0 0
0 1 1
1 0 1
1 1 1
ตารางที่ 3.2 Truth Table ของวงจร OR
3.3.3 NOT หรือ Inverter
NOT หรือ Inverter หมายถึงการกลับค่า
สภาวะของตัวแปร ซึ่งกล่าวได้ว่า Output ของ
วงจร NOT เป็น Complement ของ Input
และเขียนตารางความจริงของวงจร NOT ได้ดังนี้
Y
=
AA
0 1
1 0
ตารางที่ 3.3 Truth Table
ของวงจร NOT
การพิสูจน์ทฤษฎีบทของพีชคณิตบูลีน
การพิสูจน์ทฤษฎีบทของพีชคณิตบูลีน
สามารถทำาได้หลายวิธี
แต่วิธีที่ง่ายและเห็นได้ชัดเจนที่สุด
คือการพิสูจน์โดยใช้ตารางความจริง ดัง
ตัวอย่างดังนี้
3.5.1 พิสูจน์ว่า A + A.B =
A
* *A B A.B A +
A.B
0 0 0 0
0 1 0 0
1 0 0 1
1 1 1 1
ตารางที่ 3.4 การพิสูจน์ว่า
A + A.B = A
การใช้ทฤษฎีของ Boolean ลดรูป
Switching Function
การออกแบบวงจร Logic จาก
Switching ใดๆ ก็ตาม เราจำาเป็นที่จะต้อง
ลดรูป Switching Function นั้นๆ ให้น้อย
ที่สุดก่อน ทั้งนี้ก็เพื่อวัตถุประสงค์ให้จำานวน
อุปกรณ์ในวงจรมีน้อยที่สุด การลงทุนในการ
สร้างวงจรที่ต้องการก็จะน้อยลงตามไปด้วย
และข้อสำาคัญอีกประการหนึ่งก็คือ
ลดเวลาหน่วงลดเวลาหน่วง (Delay Time)(Delay Time) ของของ
วงจรลงได้วงจรลงได้ (Delay Time(Delay Time หมายถึงหมายถึง
เวลาที่ใช้ในการทำางานของวงจร นับเวลาที่ใช้ในการทำางานของวงจร นับ
จากจาก InputInput ไปจนถึงไปจนถึง Output)Output) ดังดัง
นั้นนั้น Switching FunctionSwitching Function ที่ยืดยาวที่ยืดยาว
เราก็ต้องทำาการลดรูปให้สั้นลง ซึ่งเราก็ต้องทำาการลดรูปให้สั้นลง ซึ่ง
เทคนิคการลดรูปวิธีหนึ่งที่นิยมใช้กันเทคนิคการลดรูปวิธีหนึ่งที่นิยมใช้กัน
แพร่หลายก็คือ ใช้ทฤษฎีของแพร่หลายก็คือ ใช้ทฤษฎีของ
BooleanBoolean จึงขอให้ลองทำาความจึงขอให้ลองทำาความ
เข้าใจวิธีการลดรูปเข้าใจวิธีการลดรูป SwitchingSwitching
ษณ์ของ Gate และตารางความจริง (Tru
3.7.1 สัญลักษณ์ของ Gate แบบต่างๆ
AND Gate คือ Gate ที่ให้ Output
เป็น Logic 1 ก็ต่อเมื่อ Input ทุกตัวเป็น
Logic 1 และจะให้ Output เป็น Logic 0
ก็ต่อเมื่อ Input ตัวใดตัวหนึ่งหรือทุกตัว
เป็น Logic 0
AND Gate
OR Gate คือ Gate ที่ให้ Output
เป็น Logic 1 ก็ต่อเมื่อ Input ตัวหนึ่ง
ตัวใดหรือทุกตัวเป็น Logic 1 และจะ
ให้ Output เป็น Logic 0 ก็ต่อเมื่อ
Input ทุกตัวเป็น Logic 0
OR Gate
•NOT Gate คือ Gate ที่ให้ Output เป็น
Complement ของ Input
•NAND Gate คือ Gate ที่ให้
Output เป็น Logic 1 ก็ต่อเมื่อ
Input ตัวใดตัวหนึ่งหรือทุกตัวเป็น
Logic 0 และจะให้ Output เป็น
•NOR Gate คือ Gate ที่ให้ Output
เป็น Logic 1 ก็ต่อเมื่อ Input ทุกตัว
เป็น Logic 0 และจะให้ Output เป็น
Logic 0 ก็ต่อเมื่อ Input ตัวใดตัว
หนึ่งหรือทุกตัวเป็นLogic 1
Exclusive OR Gate คือ
Gate ที่ให้ Output เป็น
Logic 1
ก็ต่อเมื่อ Input มี Logic ต่าง
กัน
และจะให้ Output เป็น
Logic 0 ก็ต่อเมื่อ
Input มี Logic เหมือนกัน
ตารางความจริง ของ
Exclusive OR Gate
รวมทั้งวงจรและสัญลักษณ์
5 วงจรและสัญลักษณ์ของ Exclusive OR
3.7.4 Exclusive NOR3.7.4 Exclusive NOR
GateGate หรือหรือ ComparatorsComparators
Exclusive NOR GateExclusive NOR Gate
หรือหรือ ComparatorComparator คือวงจรคือวงจร
GateGate ที่ให้ที่ให้ OutputOutput เป็นเป็น
Logic 1Logic 1 ก็ต่อเมื่อก็ต่อเมื่อ InputInput มีมี
LogicLogic เหมือนกันและจะให้เหมือนกันและจะให้
OutputOutput เป็นเป็น Logic 0Logic 0 เมื่อเมื่อ
InputInput มีมี LogicLogic ต่างกัน เราต่างกัน เรา
สามารถเขียนตารางความจริง
•3.7.5 Inhibit Gate
• Inhibit Gate คือ AND
Gate ที่มี NOT Gate อยู่หน้า
Input อันหนึ่ง ซึ่งสามารถเขียน
Truth Table และวงจร พร้อมทั้ง
สัญลักษณ์ของ Inhibit Gate ได้
ดังนี้
เป็นตัวยับยั้ง (Inhibit) การทำางานของ
AND Gate กล่าวคือ Output จะเป็น
Logic 1 ก็ต่อเมื่อ Input ทุกตัวเป็น Logic
1 ยกเว้น Input C (Inhibit Gate มีชื่อ
เรียกอีกอย่างหนึ่งว่า Anti – Coincidence
Gate)
3.7.6 FAN-IN และ FAN-OUT
FAN-IN คือ จำานวน Input ของ Gate
ใด Gate หนึ่ง
FAN-OUT คือ จำานวน Gate ที่สามารถ
ต่อเข้ากับ Output ของ Gate อื่นๆ ได้
เพื่อความเข้าใจถึง FAN-IN และ FAN-
ตัวอย่างที่ 3.4 จงหาจำานวน FAN-IN และ
FAN-OUT ของ Gate ทุกตัว จากวงจร Logic
ตามรูปที่ 3.8
ที่ 3.8 แสดงจำานวน FAN-IN และ FAN-O
Gate FAN-IN FAN-
OUT
1 3 5
2 1 1
3 1 3
Gate
อื่นๆ
2 -
3.8 การเขียนวงจร Logic
เบื้องต้น
 การเขียนวงจร Logic จาก Boolean
Expression หรือ Switching
Function ให้ทำาตามลำาดับขั้นตอนดังนี้
 รวมเทอมที่อยู่ในวงเล็บเข้ากับชนิดของ
Gate นั้นๆ
 เทอมที่คูณกัน ใช้ AND Gate หรือ
NAND Gate ตาม Switching
Function ที่กำาหนด
 3.93.9 การเขียนการเขียน SwitchingSwitching
FunctionFunction จากวงจรจากวงจร LogicLogic

การเขียนการเขียน Switching FunctionSwitching Function
จากวงจรจากวงจร LogicLogic ที่กำาหนดให้นั้น วิธีที่กำาหนดให้นั้น วิธี
การเขียนต้องเริ่มต้นจากการเขียนต้องเริ่มต้นจาก InputInput มามา
ทางทาง OutputOutput เรื่อยๆ ไปตามลำาดับ จงเรื่อยๆ ไปตามลำาดับ จง
สังเกตจากตัวอย่างต่อไปนี้สังเกตจากตัวอย่างต่อไปนี้
 ตัวอย่างที่ตัวอย่างที่ 3.63.6 จงหาจงหา OutputOutput ของของ
GateGate แต่ละตัว จากวงจรแต่ละตัว จากวงจร LogicLogic ที่ที่
3.10.13.10.1 Canonical FormCanonical Form
Canonical FormCanonical Form หมายถึงหมายถึง
Switching FunctionSwitching Function ที่เขียนอยู่ในรูปที่เขียนอยู่ในรูป
ของของ Sum of ProductSum of Product หรือหรือ ProductProduct
of Sumof Sum โดยที่แต่ละโดยที่แต่ละ CombinationCombination มีมี
ตัวแปรอยู่เต็มจำานวน ถ้าเขียนอยู่ในรูปตัวแปรอยู่เต็มจำานวน ถ้าเขียนอยู่ในรูป
ของของ Product of SumProduct of Sum ก็เรียกว่าก็เรียกว่า
CanonicalCanonical Product of Sum FormProduct of Sum Form
และถ้าเขียนอยู่ในรูปของและถ้าเขียนอยู่ในรูปของ Sum ofSum of
ProductProduct ก็เรียกว่าก็เรียกว่า Canonical Sum ofCanonical Sum of
Product FormProduct Form และก่อนที่เราจะศึกษาและก่อนที่เราจะศึกษา
Logic
ในการออกแบบวงจร Logic จาก
Boolean Expression หรือ
Switching Function หรือ Truth
Table นั้น เราจะต้องลดรูป Function
ของ Output ให้เหลือน้อยที่สุดเสีย
ก่อน โดยใช้ทฤษฎีของ Boolean หรือ
วิธีอื่นๆ ซึ่งจะกล่าวในบทต่อไป ทั้งนี้ก็
เพื่อให้วงจร Logic ที่ต้องการมีจำานวน
Gate น้อยที่สุด หรือมีการลงทุนในการ
สร้างวงจรตำ่า นอกจากนี้ยังเป็นการลด
เวลาหน่วง (Delay Time) ของวงจรอีก
Timing Diagram คือรูปกราฟแบบ
หนึ่งที่ใช้แทนความหมายของสัญญาณ
Input และ Output ที่มีความสัมพันธ์กันใน
วงจร Logic หรือ Switching Network
จากตัวอย่างที่ผ่านมา เราสามารถ
ออกแบบวงจร Logic จาก Truth Table ท
กำาหนดให้ได้ และในทำานองเดียวกัน เราก็
สามารถออกแบบวงจร Logic จาก Timing
Diagram ได้เช่นเดียวกัน
ตัวอย่างที่ 3.12 จงออกแบบวงจร Logic
จาก Timing Diagram ต่อไปนี้
Output Y = 0
A = 0B = 0 C = 1 จะได้
Output Y = 1
A = 0 B = 1 C = 0 จะได้
Output Y = 1
A = 0 B = 1 C = 1 จะได้
Output Y = 1
A = 1 B = 0 C = 0 จะได้
Output Y = 0
A = 1 B = 0 C = 1 จะได้
Output Y = 1
เป็น Truth Table ได้ดังนี้
InputInput OutputOutput
AA BB CC YY
00 00 00 00 00
11 00 00 11 11
22 00 11 00 11
33 00 11 11 11
44 11 00 00 00
55 11 00 11 11
66 11 11 00 00
77 11 11 11 11
โดยใช้ NAND หรือ NOR Gate
เพียงอย่างเดียว
เนื่องจาก NAND Gate และ NOR
Gate เป็นเกทสากลที่ได้รับความนิยมใน
การนำาไปใช้ในงานทั่วไป ดังนั้นการ
ออกแบบวงจร Logic จึงมักนิยมที่จะ
ออกแบบให้วงจรประกอบด้วย NAND
Gate หรือ NOR Gate แต่เพียงอย่าง
เดียว ด้วยเหตุผลคือ เราสามารถที่
ดัดแปลงวงจรที่ประกอบด้วย AND, OR
หรือ NOT Gate ให้เป็นวงจรที่ประกอบ
•แต่ไม่สามารถที่ดัดแปลงวงจรให้ประกอบด้วยแต่ไม่สามารถที่ดัดแปลงวงจรให้ประกอบด้วย
OROR หรือหรือ ANDAND เพียงอย่างเดียวได้ ด้วยเพียงอย่างเดียวได้ ด้วย
เหตุผลดังกล่าว ทำาให้การลงทุนในการสร้างเหตุผลดังกล่าว ทำาให้การลงทุนในการสร้าง
วงจรประหยัดลงไปได้มาก ทั้งนี้เป็นเพราะในวงจรประหยัดลงไปได้มาก ทั้งนี้เป็นเพราะใน
IC 1IC 1 ตัว จะประกอบไปด้วยตัว จะประกอบไปด้วย GateGate ใดใด GateGate
หนึ่งเพียงอย่างเดียวเท่านั้น เช่นหนึ่งเพียงอย่างเดียวเท่านั้น เช่น ICIC เบอร์เบอร์ 740740
00 หนึ่งตัว จะประกอบด้วยหนึ่งตัว จะประกอบด้วย NAND GateNAND Gate
ชนิดชนิด 22 InputInput 44 ตัวตัว ICIC เบอร์เบอร์ 74027402 หนึ่งตัวหนึ่งตัว
จะประกอบด้วยจะประกอบด้วย NOR GateNOR Gate ชนิดชนิด 22 InputInput 44
เป็นต้นเป็นต้น
• จากตัวอย่างที่จากตัวอย่างที่ 3.123.12 วงจรที่ได้ต้องใช้วงจรที่ได้ต้องใช้ ICIC
 หลักการออกแบบวงจรให้ประกอบไปหลักการออกแบบวงจรให้ประกอบไป
ด้วยด้วย NAND GateNAND Gate หรือหรือ NOR GateNOR Gate
แต่เพียงอย่างเดียว มีวิธีง่ายๆ โดยใช้แต่เพียงอย่างเดียว มีวิธีง่ายๆ โดยใช้
ทฤษฎีของทฤษฎีของ BooleanBoolean เข้าช่วย กล่าวเข้าช่วย กล่าว
คือคือ
–จากจาก Switching FunctionSwitching Function ที่ได้ที่ได้
ให้ใส่ให้ใส่ complementcomplement เข้าไปเข้าไป 22
ครั้งครั้ง
–ใช้ใช้ De Morgan TheoremDe Morgan Theorem 11
ตัวอย่าง 3.15 จาก Truth Table ที่กำาหนดให้
จงออกแบบวงจร Logicโดย
a.ใช้ NAND Gate เพียงอย่างเดียว
b.ใช้ NOR Gate เพียงอย่างเดียว
Input Output
A B C Y
0 0 0 0 0
1 0 0 1 1
2 0 1 0 1
3 0 1 1 0
4 1 0 0 0
5 1 0 1 1
6 1 1 0 1
7 1 1 1 0
ตัวอย่าง 3.16 จงออกแบบ
วงจร Logic จาก Timing
Diagram ที่กำาหนดให้
โดย
a.ใช้ NAND Gate เพียงอย่าง
เดียว
b.ใช้ NOR Gate เพียงอย่าง
ming Diagram ที่กำาหนดให้ เขียนเป็น Truth Table ไ
InputInput OutputOutput
AA BB CC YY
00 00 00 00 00
11 00 00 11 00
22 00 11 00 11
33 00 11 11 11
44 11 00 00 00
55 11 00 11 11
66 11 11 00 11
77 11 11 11 11
3 booleanalgebra
3 booleanalgebra

Weitere ähnliche Inhalte

Empfohlen

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 

Empfohlen (20)

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 

3 booleanalgebra

  • 2. กล่าวนำา อริสโตเติล นักปรัชญาชาวกรีกได้ทำาการ ศึกษาเกี่ยวกับ Logic และได้พัฒนามาใช้ เป็นเครื่องมือแก้ปัญหาทางปรัชญาของเขา หลักจากปี ค.ศ.1930 วงจร Logic ได้ถูก นำามาใช้ในการวิเคราะห์ระบบ Switching ของเครื่องชุมสายโทรศัพท์แบบอัตโนมัติ และในปัจจุบัน วงจร Logic เข้ามามี บทบาทในการรับส่งสัญญาณและข้อมูล ต่างๆ มากมาย เราจึงจำาเป็นต้องเรียนรู้และ ทำาความเข้าในสนหลักการและเทคนิคของ
  • 3. •หลักการเบื้องต้นของวงจร Logic –การศึกษาวงจร Logic เบื้องต้น จะศึกษา เกี่ยวกับ Two – State Logic คือใช้ตัวแปร ค่า 2 สภาวะโดยมีข้อกำาหนดคือ Input และ Output ของวงจร Logic สามารถมีได้เพียง 2 สภาวะเท่านั้น และจะอยู่ในสภาวะใด สภาวะหนึ่งเท่านั้น จะอยู่ทั้ง 2 สภาวะในเวลา เดียวกันไม่ได้ Logic 2 สภาวะดังกล่าว อาจ ใช้แทนความหมายต่างๆ ได้ เช่น สูง-ตำ่า 1-0 ปิด-เปิด ใช้-ไม่ใช้ ทำางาน-ไม่ทำางาน มี-ไม่มี ฯลฯ
  • 4. •ในระบบ Electronic Logic เราใช้ระดับ ของแรงดันไฟฟ้า (Voltage Level) แทน สภาวะทั้งสองเมื่อใช้ Logic 1 แทนแรงดัน ที่เป็นบวกมากกว่า เราก็ใช้ Logic 0 แทน แรงดันที่เป็นบวกน้อยกว่า ระบบเช่นนี้เรียก ว่า Positive Logic ในทางกลับกัน ถ้าใช้ Logic 1 แทนแรงดันที่เป็นลบมากกว่า เรา ก็ใช้ Logic 0 แทนแรงดันที่เป็นลบน้อย กว่า ระบบเช่นนี้เรียกว่า Negative Logic ตัวอย่างของ Positive และ Negative
  • 7. •หลักการเบื้องต้นของพีชคณิตบูลีน (Boolean Algebra) –พีชคณิตบูลีน เป็นเทคนิคแบบหนึ่งที่ใช้ ในการลดรูป Switching Function ซึ่ง ผู้คิดค้นนี้คือนักคณิตศาสตร์ชาวอังกฤษ ชื่อ George Boole ในพีชคณิตบูลีน เราใช้ตัวอักษร A, B, C,……… แทน ตัวแปรค่า 2 สภาวะ คือ 0 หรือ 1 ความ สัมพันธ์ระหว่างตัวแปรแต่ละตัว เราใช้ เครื่องหมายทางเลขคณิตแทน ความ
  • 8. เครื่องหมาย . แทนความ หมาย AND เครื่องหมาย + แทนความ หมาย OR เครื่องหมาย - (Bar) แทน ความหมาย NOT
  • 9.  AND ND ใช้ Contact ข. วงจร AN รูปที่ 3.2 วงจร AND
  • 10. 3.2 คือ ดวงไฟจะติดก็ต่อเมื่อสวิทช์ A และสวิทช์ B ปิด ดังได้กล่าวมา แล้วว่า เรากำาหนดให้ สวิทช์ปิด คือ Logic 1 สวิทช์เปิด คือ Logic 0ไฟติด คือ Logic 1 ไฟ ดับ คือ Logic 0 ดังนั้น เราสามารถเขียนตาราง ความจริง (Truth Table) สำาหรับวงจร
  • 11. A B Y = A.B 0 0 0 0 1 0 1 0 0 1 1 1 ตารางที่ 3.1 Truth Table
  • 12. 3.3.2 วงจร OR ก. วงจร OR ใช้ Contact ข. วงจร OR ใช้สวิทช์ รูปที่ 3.3 วงจร OR หน้าที่ OR อธิบายได้ตามรูปที่ 3.3 คือ ดวงไฟจะติดก็ต่อเมื่อสวิทช์ A หรือ สวิทช์ B ตัวใดตัวหนึ่งหรือทั้งสองตัวปิด ดังนั้นเรา สามารถเขียนตารางความจริงสำาหรับวงจร OR ได้ดังนี้
  • 13. A B Y = A + B 0 0 0 0 1 1 1 0 1 1 1 1 ตารางที่ 3.2 Truth Table ของวงจร OR
  • 14. 3.3.3 NOT หรือ Inverter NOT หรือ Inverter หมายถึงการกลับค่า สภาวะของตัวแปร ซึ่งกล่าวได้ว่า Output ของ วงจร NOT เป็น Complement ของ Input และเขียนตารางความจริงของวงจร NOT ได้ดังนี้ Y = AA 0 1 1 0 ตารางที่ 3.3 Truth Table ของวงจร NOT
  • 15.
  • 16.
  • 17.
  • 18.
  • 20. 3.5.1 พิสูจน์ว่า A + A.B = A * *A B A.B A + A.B 0 0 0 0 0 1 0 0 1 0 0 1 1 1 1 1 ตารางที่ 3.4 การพิสูจน์ว่า A + A.B = A
  • 21.
  • 22.
  • 23.
  • 24.
  • 25. การใช้ทฤษฎีของ Boolean ลดรูป Switching Function การออกแบบวงจร Logic จาก Switching ใดๆ ก็ตาม เราจำาเป็นที่จะต้อง ลดรูป Switching Function นั้นๆ ให้น้อย ที่สุดก่อน ทั้งนี้ก็เพื่อวัตถุประสงค์ให้จำานวน อุปกรณ์ในวงจรมีน้อยที่สุด การลงทุนในการ สร้างวงจรที่ต้องการก็จะน้อยลงตามไปด้วย และข้อสำาคัญอีกประการหนึ่งก็คือ
  • 26. ลดเวลาหน่วงลดเวลาหน่วง (Delay Time)(Delay Time) ของของ วงจรลงได้วงจรลงได้ (Delay Time(Delay Time หมายถึงหมายถึง เวลาที่ใช้ในการทำางานของวงจร นับเวลาที่ใช้ในการทำางานของวงจร นับ จากจาก InputInput ไปจนถึงไปจนถึง Output)Output) ดังดัง นั้นนั้น Switching FunctionSwitching Function ที่ยืดยาวที่ยืดยาว เราก็ต้องทำาการลดรูปให้สั้นลง ซึ่งเราก็ต้องทำาการลดรูปให้สั้นลง ซึ่ง เทคนิคการลดรูปวิธีหนึ่งที่นิยมใช้กันเทคนิคการลดรูปวิธีหนึ่งที่นิยมใช้กัน แพร่หลายก็คือ ใช้ทฤษฎีของแพร่หลายก็คือ ใช้ทฤษฎีของ BooleanBoolean จึงขอให้ลองทำาความจึงขอให้ลองทำาความ เข้าใจวิธีการลดรูปเข้าใจวิธีการลดรูป SwitchingSwitching
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36. ษณ์ของ Gate และตารางความจริง (Tru 3.7.1 สัญลักษณ์ของ Gate แบบต่างๆ
  • 37. AND Gate คือ Gate ที่ให้ Output เป็น Logic 1 ก็ต่อเมื่อ Input ทุกตัวเป็น Logic 1 และจะให้ Output เป็น Logic 0 ก็ต่อเมื่อ Input ตัวใดตัวหนึ่งหรือทุกตัว เป็น Logic 0 AND Gate
  • 38.
  • 39. OR Gate คือ Gate ที่ให้ Output เป็น Logic 1 ก็ต่อเมื่อ Input ตัวหนึ่ง ตัวใดหรือทุกตัวเป็น Logic 1 และจะ ให้ Output เป็น Logic 0 ก็ต่อเมื่อ Input ทุกตัวเป็น Logic 0 OR Gate
  • 40.
  • 41. •NOT Gate คือ Gate ที่ให้ Output เป็น Complement ของ Input
  • 42.
  • 43. •NAND Gate คือ Gate ที่ให้ Output เป็น Logic 1 ก็ต่อเมื่อ Input ตัวใดตัวหนึ่งหรือทุกตัวเป็น Logic 0 และจะให้ Output เป็น
  • 44.
  • 45. •NOR Gate คือ Gate ที่ให้ Output เป็น Logic 1 ก็ต่อเมื่อ Input ทุกตัว เป็น Logic 0 และจะให้ Output เป็น Logic 0 ก็ต่อเมื่อ Input ตัวใดตัว หนึ่งหรือทุกตัวเป็นLogic 1
  • 46.
  • 47. Exclusive OR Gate คือ Gate ที่ให้ Output เป็น Logic 1 ก็ต่อเมื่อ Input มี Logic ต่าง กัน และจะให้ Output เป็น Logic 0 ก็ต่อเมื่อ Input มี Logic เหมือนกัน ตารางความจริง ของ Exclusive OR Gate รวมทั้งวงจรและสัญลักษณ์
  • 48.
  • 50. 3.7.4 Exclusive NOR3.7.4 Exclusive NOR GateGate หรือหรือ ComparatorsComparators Exclusive NOR GateExclusive NOR Gate หรือหรือ ComparatorComparator คือวงจรคือวงจร GateGate ที่ให้ที่ให้ OutputOutput เป็นเป็น Logic 1Logic 1 ก็ต่อเมื่อก็ต่อเมื่อ InputInput มีมี LogicLogic เหมือนกันและจะให้เหมือนกันและจะให้ OutputOutput เป็นเป็น Logic 0Logic 0 เมื่อเมื่อ InputInput มีมี LogicLogic ต่างกัน เราต่างกัน เรา สามารถเขียนตารางความจริง
  • 51.
  • 52.
  • 53. •3.7.5 Inhibit Gate • Inhibit Gate คือ AND Gate ที่มี NOT Gate อยู่หน้า Input อันหนึ่ง ซึ่งสามารถเขียน Truth Table และวงจร พร้อมทั้ง สัญลักษณ์ของ Inhibit Gate ได้ ดังนี้
  • 54.
  • 55.
  • 56. เป็นตัวยับยั้ง (Inhibit) การทำางานของ AND Gate กล่าวคือ Output จะเป็น Logic 1 ก็ต่อเมื่อ Input ทุกตัวเป็น Logic 1 ยกเว้น Input C (Inhibit Gate มีชื่อ เรียกอีกอย่างหนึ่งว่า Anti – Coincidence Gate) 3.7.6 FAN-IN และ FAN-OUT FAN-IN คือ จำานวน Input ของ Gate ใด Gate หนึ่ง FAN-OUT คือ จำานวน Gate ที่สามารถ ต่อเข้ากับ Output ของ Gate อื่นๆ ได้ เพื่อความเข้าใจถึง FAN-IN และ FAN-
  • 57. ตัวอย่างที่ 3.4 จงหาจำานวน FAN-IN และ FAN-OUT ของ Gate ทุกตัว จากวงจร Logic ตามรูปที่ 3.8
  • 58. ที่ 3.8 แสดงจำานวน FAN-IN และ FAN-O Gate FAN-IN FAN- OUT 1 3 5 2 1 1 3 1 3 Gate อื่นๆ 2 -
  • 59. 3.8 การเขียนวงจร Logic เบื้องต้น  การเขียนวงจร Logic จาก Boolean Expression หรือ Switching Function ให้ทำาตามลำาดับขั้นตอนดังนี้  รวมเทอมที่อยู่ในวงเล็บเข้ากับชนิดของ Gate นั้นๆ  เทอมที่คูณกัน ใช้ AND Gate หรือ NAND Gate ตาม Switching Function ที่กำาหนด
  • 60.
  • 61.
  • 62.
  • 63.
  • 64.
  • 65.  3.93.9 การเขียนการเขียน SwitchingSwitching FunctionFunction จากวงจรจากวงจร LogicLogic  การเขียนการเขียน Switching FunctionSwitching Function จากวงจรจากวงจร LogicLogic ที่กำาหนดให้นั้น วิธีที่กำาหนดให้นั้น วิธี การเขียนต้องเริ่มต้นจากการเขียนต้องเริ่มต้นจาก InputInput มามา ทางทาง OutputOutput เรื่อยๆ ไปตามลำาดับ จงเรื่อยๆ ไปตามลำาดับ จง สังเกตจากตัวอย่างต่อไปนี้สังเกตจากตัวอย่างต่อไปนี้  ตัวอย่างที่ตัวอย่างที่ 3.63.6 จงหาจงหา OutputOutput ของของ GateGate แต่ละตัว จากวงจรแต่ละตัว จากวงจร LogicLogic ที่ที่
  • 66.
  • 67.
  • 68.
  • 69.
  • 70.
  • 71. 3.10.13.10.1 Canonical FormCanonical Form Canonical FormCanonical Form หมายถึงหมายถึง Switching FunctionSwitching Function ที่เขียนอยู่ในรูปที่เขียนอยู่ในรูป ของของ Sum of ProductSum of Product หรือหรือ ProductProduct of Sumof Sum โดยที่แต่ละโดยที่แต่ละ CombinationCombination มีมี ตัวแปรอยู่เต็มจำานวน ถ้าเขียนอยู่ในรูปตัวแปรอยู่เต็มจำานวน ถ้าเขียนอยู่ในรูป ของของ Product of SumProduct of Sum ก็เรียกว่าก็เรียกว่า CanonicalCanonical Product of Sum FormProduct of Sum Form และถ้าเขียนอยู่ในรูปของและถ้าเขียนอยู่ในรูปของ Sum ofSum of ProductProduct ก็เรียกว่าก็เรียกว่า Canonical Sum ofCanonical Sum of Product FormProduct Form และก่อนที่เราจะศึกษาและก่อนที่เราจะศึกษา
  • 72.
  • 73.
  • 74.
  • 75.
  • 76.
  • 77.
  • 78.
  • 79.
  • 80.
  • 81. Logic ในการออกแบบวงจร Logic จาก Boolean Expression หรือ Switching Function หรือ Truth Table นั้น เราจะต้องลดรูป Function ของ Output ให้เหลือน้อยที่สุดเสีย ก่อน โดยใช้ทฤษฎีของ Boolean หรือ วิธีอื่นๆ ซึ่งจะกล่าวในบทต่อไป ทั้งนี้ก็ เพื่อให้วงจร Logic ที่ต้องการมีจำานวน Gate น้อยที่สุด หรือมีการลงทุนในการ สร้างวงจรตำ่า นอกจากนี้ยังเป็นการลด เวลาหน่วง (Delay Time) ของวงจรอีก
  • 82.
  • 83.
  • 84.
  • 85.
  • 86.
  • 87.
  • 88.
  • 89.
  • 90.
  • 91.
  • 92.
  • 93. Timing Diagram คือรูปกราฟแบบ หนึ่งที่ใช้แทนความหมายของสัญญาณ Input และ Output ที่มีความสัมพันธ์กันใน วงจร Logic หรือ Switching Network จากตัวอย่างที่ผ่านมา เราสามารถ ออกแบบวงจร Logic จาก Truth Table ท กำาหนดให้ได้ และในทำานองเดียวกัน เราก็ สามารถออกแบบวงจร Logic จาก Timing Diagram ได้เช่นเดียวกัน ตัวอย่างที่ 3.12 จงออกแบบวงจร Logic จาก Timing Diagram ต่อไปนี้
  • 94.
  • 95. Output Y = 0 A = 0B = 0 C = 1 จะได้ Output Y = 1 A = 0 B = 1 C = 0 จะได้ Output Y = 1 A = 0 B = 1 C = 1 จะได้ Output Y = 1 A = 1 B = 0 C = 0 จะได้ Output Y = 0 A = 1 B = 0 C = 1 จะได้ Output Y = 1
  • 96. เป็น Truth Table ได้ดังนี้ InputInput OutputOutput AA BB CC YY 00 00 00 00 00 11 00 00 11 11 22 00 11 00 11 33 00 11 11 11 44 11 00 00 00 55 11 00 11 11 66 11 11 00 00 77 11 11 11 11
  • 97.
  • 98. โดยใช้ NAND หรือ NOR Gate เพียงอย่างเดียว เนื่องจาก NAND Gate และ NOR Gate เป็นเกทสากลที่ได้รับความนิยมใน การนำาไปใช้ในงานทั่วไป ดังนั้นการ ออกแบบวงจร Logic จึงมักนิยมที่จะ ออกแบบให้วงจรประกอบด้วย NAND Gate หรือ NOR Gate แต่เพียงอย่าง เดียว ด้วยเหตุผลคือ เราสามารถที่ ดัดแปลงวงจรที่ประกอบด้วย AND, OR หรือ NOT Gate ให้เป็นวงจรที่ประกอบ
  • 99. •แต่ไม่สามารถที่ดัดแปลงวงจรให้ประกอบด้วยแต่ไม่สามารถที่ดัดแปลงวงจรให้ประกอบด้วย OROR หรือหรือ ANDAND เพียงอย่างเดียวได้ ด้วยเพียงอย่างเดียวได้ ด้วย เหตุผลดังกล่าว ทำาให้การลงทุนในการสร้างเหตุผลดังกล่าว ทำาให้การลงทุนในการสร้าง วงจรประหยัดลงไปได้มาก ทั้งนี้เป็นเพราะในวงจรประหยัดลงไปได้มาก ทั้งนี้เป็นเพราะใน IC 1IC 1 ตัว จะประกอบไปด้วยตัว จะประกอบไปด้วย GateGate ใดใด GateGate หนึ่งเพียงอย่างเดียวเท่านั้น เช่นหนึ่งเพียงอย่างเดียวเท่านั้น เช่น ICIC เบอร์เบอร์ 740740 00 หนึ่งตัว จะประกอบด้วยหนึ่งตัว จะประกอบด้วย NAND GateNAND Gate ชนิดชนิด 22 InputInput 44 ตัวตัว ICIC เบอร์เบอร์ 74027402 หนึ่งตัวหนึ่งตัว จะประกอบด้วยจะประกอบด้วย NOR GateNOR Gate ชนิดชนิด 22 InputInput 44 เป็นต้นเป็นต้น • จากตัวอย่างที่จากตัวอย่างที่ 3.123.12 วงจรที่ได้ต้องใช้วงจรที่ได้ต้องใช้ ICIC
  • 100.  หลักการออกแบบวงจรให้ประกอบไปหลักการออกแบบวงจรให้ประกอบไป ด้วยด้วย NAND GateNAND Gate หรือหรือ NOR GateNOR Gate แต่เพียงอย่างเดียว มีวิธีง่ายๆ โดยใช้แต่เพียงอย่างเดียว มีวิธีง่ายๆ โดยใช้ ทฤษฎีของทฤษฎีของ BooleanBoolean เข้าช่วย กล่าวเข้าช่วย กล่าว คือคือ –จากจาก Switching FunctionSwitching Function ที่ได้ที่ได้ ให้ใส่ให้ใส่ complementcomplement เข้าไปเข้าไป 22 ครั้งครั้ง –ใช้ใช้ De Morgan TheoremDe Morgan Theorem 11
  • 101.
  • 102.
  • 103.
  • 104. ตัวอย่าง 3.15 จาก Truth Table ที่กำาหนดให้ จงออกแบบวงจร Logicโดย a.ใช้ NAND Gate เพียงอย่างเดียว b.ใช้ NOR Gate เพียงอย่างเดียว
  • 105. Input Output A B C Y 0 0 0 0 0 1 0 0 1 1 2 0 1 0 1 3 0 1 1 0 4 1 0 0 0 5 1 0 1 1 6 1 1 0 1 7 1 1 1 0
  • 106.
  • 107.
  • 108. ตัวอย่าง 3.16 จงออกแบบ วงจร Logic จาก Timing Diagram ที่กำาหนดให้ โดย a.ใช้ NAND Gate เพียงอย่าง เดียว b.ใช้ NOR Gate เพียงอย่าง
  • 109.
  • 110. ming Diagram ที่กำาหนดให้ เขียนเป็น Truth Table ไ InputInput OutputOutput AA BB CC YY 00 00 00 00 00 11 00 00 11 00 22 00 11 00 11 33 00 11 11 11 44 11 00 00 00 55 11 00 11 11 66 11 11 00 11 77 11 11 11 11