180 likes | 413 Views
Hardware and gates. Input signals A,B and output signal C represent individual bit values. GATE FUNCTION. A. C. C = f(A,B). F(A,B). B. Output signal from the gate. Input signals to the gate. This is a logical equation in three variable C = A and B
E N D
Hardware and gates • Input signals A,B and output signal C represent individual bit values GATE FUNCTION A C C = f(A,B) F(A,B) B Output signal from the gate • Input signals to the gate • This is a logical equation in three variable • C = A and B • Dependent variable, C, is a function of two independent variables A & B • Each variable can have only two possible values, 1 or 0 • Called Boolean Algebra Hardware Computer Organization for the Software Professional Arnold S. Berger
Why is this called a gate? • Think of the AND gate inputs as a control signal “A” and a variable signal “B” • Output C, will follow input B as long as input A is high • When input A is low, output C is low, no matter what state input B is in A = 1 C 1 0 AND B timing diagram A = 0 C 1 0 AND B Hardware Computer Organization for the Software Professional Arnold S. Berger
Three “atomic” gates B = A • The Gate is the basic element of all digital systems • Three types of gates form the “atomic” elements A C is TRUE if A is TRUE AND B is TRUE C C = A*B AND B A C = A + B C is TRUE if A is TRUE OR B is TRUE OR C B NEGATION SYMBOL B is TRUE if A is FALSE NOT A B Hardware Computer Organization for the Software Professional Arnold S. Berger
OR gate circuit • Closing switch A OR B will turn on the light bulb • Closing switch A or switch B completes the circuit and turns on the light • Closing both switches is the same as closing either one Connection between 2 wires indicated with a dot B C + A C = A and B Battery Symbol - Light bulb (load) Hardware Computer Organization for the Software Professional Arnold S. Berger
Bus Structure: Tristate CHIP SELECT INPUT OUTPUT 0 1 1 Truth table for Bus Interface Gate 0 0 0 1 1 Hi Z Bus Interface Gate 1 0 Hi Z INPUT 1 or 0 or HiZ 1 or 0 Logic Gate OUTPUT Output Enable (OE) Hardware Computer Organization for the Software Professional Arnold S. Berger
NAND and NOR gates C = A*B • Derived gates: NAND and NOR • NAND = NOT AND > NOT( A and B) • NOR = NOT OR > NOT ( A or B ) A A C NAND C NOT NOT AND B B C is FALSE if A is TRUE AND B is TRUE A A C OR NOT C NOR B B C is FALSE if A is TRUE OR B is TRUE C = A+ B Hardware Computer Organization for the Software Professional Arnold S. Berger
Exclusive OR ( XOR ) Gate A B A* A A XOR C B B C = A + B C B B C = A * A * + A C = A + B B B A * B Physical Connection C is TRUE if A is TRUE OR B is TRUE, but not if A is TRUE AND B is TRUE Alternatively C is FALSE if A = B Hardware Computer Organization for the Software Professional Arnold S. Berger
Combining gates AND AND AND AND AND AND AND • Computing systems combine gates in order to operate on 4,8,16,32 and 64-bit numbers • Example: Consider a logical ANDing of two bytes, 0xAA and 0x55 0x55 0xAA 0x00 1 0 1 0 1 0 1 0 27 26 25 24 23 22 21 20 0 0 0 0 0 0 0 0 0 1 0 1 0 1 0 1 AND Logical Equation: 0xAA AND 0x55 = 0x00 Hardware Computer Organization for the Software Professional Arnold S. Berger
Building compound gates • It is easy to prove to yourself that these are “logically” equivalent • Are they electronically (dynamically) equivalent? Why or why not? • This is logically the same as the 4-input gate shown below A AND B C = f(A,B,G,D) AND G C AND D A B F(A,B,G,D) C = f(A,B,G,D) G C D Hardware Computer Organization for the Software Professional Arnold S. Berger
What is a gate? • A gate is an electronic circuit block • Gates are the fundamental building blocks of digital systems • Gates are combined to create more complex functions • Concepts of gates are like atoms • Atoms are arranged to form complex molecules and materials • Arrangement of the atoms determines the behavior of a system PIN 1 To 0 V (Ground) Pin 1 Pin 7 A • Typical NAND gate circuit • Quad, 2-input NAND gate • Cost: ~ $0.10 • Propagation delay ~ 5 nsec • 14-pin Dual in-line (DIP) package • Circuits vary from 8 pin DIP packages • to over 600 pin high-density packages B C D Pin 14 Pin 8 To +3.3V (5V) Hardware Computer Organization for the Software Professional Arnold S. Berger
Truth Table A A A A A A B B B B B B C C C C C C 0 0 0 0 0 0 1 0 1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 0 1 0 0 1 1 0 0 0 0 0 0 1 0 0 1 0 1 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 0 1 1 • Build a table showing all possible input and output states OR AND NAND NOR XOR XNOR • The XOR gate is very useful for addition • and comparison operations. Why? Hardware Computer Organization for the Software Professional Arnold S. Berger
ตัวอย่างการประยุกต์ใช้ลอจิกเกตตัวอย่างการประยุกต์ใช้ลอจิกเกต • ใช้ AND เกตในงานควบคุม A = 1 C 1 0 AND B timing diagram A = 0 C 1 0 AND B Hardware Computer Organization for the Software Professional Arnold S. Berger
ตัวอย่างการประยุกต์ใช้ลอจิกเกตตัวอย่างการประยุกต์ใช้ลอจิกเกต • ใช้ AND เกตในงานควบคุม 1 second control pulse 2 Hz A C 1 0 AND B Hardware Computer Organization for the Software Professional Arnold S. Berger
พีชคณิตบูลีน • ตัวดำเนินการบูลีน การบวกแบบบูลีน (Boolean addition) 0 + 0 = 0 1 + 0 = 1 0 + 1 = 1 1 + 1 = 1 การคูณแบบบูลีน (Boolean multiplication) 0.0 = 0 0.1 = 0 1.0 = 0 1.1 = 1 Hardware Computer Organization for the Software Professional Arnold S. Berger
กฎและทฤษฎีบูลีน กฎการสลับที่ (Commutative Laws) A + B = B + A A.B = B.A กฎการจัดหมู่ (Associative Laws) A + (B + C) = (A + B) + C กฎการกระจาย (Distributive Laws) A . (B + C) = A . B + A . C Hardware Computer Organization for the Software Professional Arnold S. Berger
กฎของพีชคณิตบูลีน • A + 0 = A • A + 1 = 1 • A . 0 = 0 • A . 1 = A • A + A = A • A + A = 1 • A . A = A • A . A = 0 • A = A • A + A . B = A • A + A . B = A + B • (A + B) . (A + C) = A + B . C A A OR 0 A A AND 1 Hardware Computer Organization for the Software Professional Arnold S. Berger
Designing a digital system • We can use the concept of a truth table as a design tool, rather than as a method of simply expressing an existing logical function a b c d e f g h X Y Z ? • Suppose that we want to design a digital system, such as the above “gray box” • For each of the outputs, X, Y and Z, we can design the truth table to express what the output should be, depending upon the state of the input variables Hardware Computer Organization for the Software Professional Arnold S. Berger