1 UNIT 8A Computer Circuitry: Layers of Abstraction 15110 Principles of Computing, Carnegie Mellon University - CORTINA 1 Boolean Logic & Truth Tables • Computer circuitry works based on Boolean logic: operations on true (1) and false (0) values. 15110 Principles of Computing, Carnegie Mellon University - CORTINA 2 A B A ∧ B (A AND B) (Ruby: A && B) A ∨ B (A OR B) (Ruby: A || B) 0 0 0 0 0 1 0 1 1 0 0 1 1 1 1 1 A ¬ A (NOT A) (Ruby: !A) 0 1 1 0
12
Embed
UNIT 8A - cs.cmu.edutcortina/15110f11/Unit08PtA.pdf · 1 UNIT 8A Computer Circuitry: Layers of Abstraction 15110 Principles of Computing, Carnegie Mellon University - CORTINA 1 Boolean
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
1
UNIT 8AComputer Circuitry: Layers of Abstraction
15110 Principles of Computing,
Carnegie Mellon University - CORTINA1
Boolean Logic & Truth Tables
• Computer circuitry works based on Boolean
logic: operations on true (1) and false (0)
values.
15110 Principles of Computing,
Carnegie Mellon University - CORTINA2
A B A ∧∧∧∧ B
(A AND B)
(Ruby: A && B)
A ∨∨∨∨ B
(A OR B)
(Ruby: A || B)
0 0 0 0
0 1 0 1
1 0 0 1
1 1 1 1
A ¬¬¬¬ A
(NOT A)
(Ruby: !A)
0 1
1 0
2
Gates
• A gate is an electronic device that implements
a logical function. (Images from Wikipedia)
• Circuit
diagram:
• Abstract
Diagram:
15110 Principles of Computing,
Carnegie Mellon University - CORTINA3
A
B
A
BAA ∨ B
“OR”
¬ A
“NOT”
A ∧ B
“AND”
Properties
• Commutative: a ∧ b = b ∧ a a ∨ b = b ∨ a
• Associative: a ∧ b ∧ c = (a ∧ b) ∧ c = a ∧ (b ∧ c)