This document discusses basic logic gates and their implementation in the Hack platform. It begins by defining logic gates and their use in implementing Boolean functions. The basic logic gates - NOT, AND, OR, NAND, NOR, XOR and XNOR - are then described along with their truth tables. It explains that in this course, hardware units will be built using only NAND gates. Students are instructed to implement the basic logic gates of AND, NOT, OR and NOR using only NAND gates in the Hack platform and test them using interactive simulation.
This document discusses basic logic gates and their implementation in the Hack platform. It begins by defining logic gates and their use in implementing Boolean functions. The basic logic gates - NOT, AND, OR, NAND, NOR, XOR and XNOR - are then described along with their truth tables. It explains that in this course, hardware units will be built using only NAND gates. Students are instructed to implement the basic logic gates of AND, NOT, OR and NOR using only NAND gates in the Hack platform and test them using interactive simulation.
This document discusses basic logic gates and their implementation in the Hack platform. It begins by defining logic gates and their use in implementing Boolean functions. The basic logic gates - NOT, AND, OR, NAND, NOR, XOR and XNOR - are then described along with their truth tables. It explains that in this course, hardware units will be built using only NAND gates. Students are instructed to implement the basic logic gates of AND, NOT, OR and NOR using only NAND gates in the Hack platform and test them using interactive simulation.
Department of AI / Center for Computational Engineering and Networking (CEN) Amrita School of AI, Coimbatore Acknowledgment: Prof. Noam Nisan, Prof. Shimon Schocken , Dr. D. Govind Gate Logic • A technique for implementing Boolean function using logic gates • What is a logic Gate ? – Elementary chip – Composite – Designed to deliver a well-defined functionality – It has one output and one or more inputs EOC-1|B.TECH CSE (AI)|CEN|Dr. Jyothish 2 Basic Logic Gates • NOT gate • Also called inverter Truth Table
EOC-1|B.TECH CSE (AI)|CEN|Dr. Jyothish 3
• AND gate – For 2 inputs (say A, B), the output will be 1 if both the inputs are 1, and 0 otherwise – Denoted as A.B Truth Table
EOC-1|B.TECH CSE (AI)|CEN|Dr. Jyothish 4
• OR Gate – For 2 inputs (say A, B), the output will be 1 if at least one of the inputs are 1, and 0 otherwise – Denoted as A+B Truth Table
EOC-1|B.TECH CSE (AI)|CEN|Dr. Jyothish 5
• NAND gate – For 2 inputs (say A, B), the output will be 1 if at least one of the inputs are 0, and 0 otherwise – Denoted as (A.B)’ Truth Table
EOC-1|B.TECH CSE (AI)|CEN|Dr. Jyothish 6
• NOR gate – For 2 inputs (say A, B), the output will be 1 if both the the inputs are 0, and 0 otherwise – Denoted as (A+B)’ Truth Table
EOC-1|B.TECH CSE (AI)|CEN|Dr. Jyothish 7
• Exclusive OR (XOR) gate – For 2 inputs (say A, B), the output will be 1 if odd number of inputs are at 1, and 0 otherwise – Denoted as A B Truth Table
EOC-1|B.TECH CSE (AI)|CEN|Dr. Jyothish 8
• Exclusive NOR (XNOR) gate – For 2 inputs (say A, B), the output will be 1 if both the inputs of the gate are same, and 0 otherwise – In general, an XNOR gate will give an output value of logic “1” ONLY when there are an EVEN number of 1’s on the inputs to the gate (the inverse of the Ex-OR gate) except when all its inputs are “LOW” Truth Table – Denoted as ( A B )
EOC-1|B.TECH CSE (AI)|CEN|Dr. Jyothish 9
How do we build a chip?
We use Hardware Simulators
https://www.nand2tetris.org/course
EOC-1|B.TECH CSE (AI)|CEN|Dr. Jyothish 10
Steps • Design the gate architecture • Specify the architecture in HDL • Test the chip in a hardware simulator • Optimize the design
EOC-1|B.TECH CSE (AI)|CEN|Dr. Jyothish 11
HDL: some comments
EOC-1|B.TECH CSE (AI)|CEN|Dr. Jyothish 12
Interactive simulation Simulation process: • Load the HDL file into the hardware simulator • Enter values (0’s and 1’s) into the chip’s input pins (example: a and b) • Evaluate the chip’s logic • Inspect the resulting values of: – Output pins – Internal pins
EOC-1|B.TECH CSE (AI)|CEN|Dr. Jyothish 13
v
EOC-1|B.TECH CSE (AI)|CEN|Dr. Jyothish 14
In this course, the hardware units are built using NAND gates
EOC-1|B.TECH CSE (AI)|CEN|Dr. Jyothish 15
Realization of basic gates using NAND NOT gate
AND gate
OR gate
EOC-1|B.TECH CSE (AI)|CEN|Dr. Jyothish 16
Implement the basic Logic Gates in Hack Platform
1. AND using NAND
2. NOT using NAND 3. OR using NAND 4. NOR using NAND