Digital logic: Gates, Truth tables, logic equations

Preview:

Citation preview

1/17

Digital logic: Gates, Truth tables, logic equations

Yipeng Huang

Rutgers University

April 20, 2021

2/17

Table of contents

Announcements

Transistors: The building block of computers

Combinational logicBasic gatesMore-than-2-input gates

3/17

Looking ahead

Class plan

1. PA5 due Monday, 4/26.2. Digital logic. Reading assignment: CS:APP Chapter 4.2. Recommended

reading: Patterson & Hennessy, Computer organization and design, appendixon "The Basics of Logic Design." Available online via Rutgers Libraries.

4/17

Table of contents

Announcements

Transistors: The building block of computers

Combinational logicBasic gatesMore-than-2-input gates

5/17

Computer organizationLayer cake

I SocietyI Human beingsI ApplicationsI AlgorithmsI High-level programming languagesI InterpretersI Low-level programming languagesI CompilersI ArchitecturesI MicroarchitecturesI Sequential/combinational logicI TransistorsI SemiconductorsI Materials scienceI PhysicsI Mathematics

Yipeng Huang
Java, Python
Yipeng Huang
C, assembly

6/17

Why binary

Figure: Source: CS:APP

Yipeng Huang
Data representation: bits, ints, floats

7/17

To build logic, we need switches

Vacuum tubes a.k.a. valves

Figure: Source: By Stefan Riepl (Quark48) -Self-photographed, CC BY-SA 2.0https://commons.wikimedia.org/w/index.php?curid=14682022

Transistors

Figure: Source: Wikimedia

I The first transistor developed at BellLabs, Murray Hill, New Jeresy

I https://www.bell-labs.com/about/locations/murray-hill-new-jersey-usa/

8/17

MOSFETs

MOS: Metal-oxide-semiconductorI A sandwich of conductor-insulator-semiconductor.

FET: Field-effect transistorI Gate exerts electric field that changes conductivity of semiconductor.

9/17

NMOS, PMOS, CMOS

PMOS: P-type MOS

I positive gate voltage, acts as opencircuit (insulator)

I negative gate voltage, acts as shortcircuit (conductor)

NMOS: N-type MOS

I positive gate voltage, acts as shortcircuit (conductor)

I negative gate voltage, acts as opencircuit (insulator)

CMOS: Complementary MOS

I A combination of NMOS and PMOS to build logical gates such as NOT,AND, OR.

I We’ll go to slides posted in supplementary material to see how they work.

10/17

Combinational vs. sequential logic

Combinational logic

I No internal state nor memoryI Output depends entirely on inputI Examples: NOT, AND, NAND, OR,

NOR, XOR, XNOR gates, decoders,multiplexers.

Sequential logic

I Has internal state (memory)I Output depends on the inputs and

also internal stateI Examples: latches, flip-flops, Mealy

and Moore machines, registers,pipelines, SRAMs.

11/17

Table of contents

Announcements

Transistors: The building block of computers

Combinational logicBasic gatesMore-than-2-input gates

Yipeng Huang
Just either the NAND or the NOR gate are universal to implement all combinational logic
Yipeng Huang
All truth tables can be expressed in just NOT, AND and OR gates (sum-of-products form)

12/17

NOT gate

A A

A A0 11 0

Table: Truth table for NOT gate

13/17

AND gate, NAND gate

AB

AB

A B AB0 0 00 1 01 0 01 1 1

Table: Truth table for AND gate

AB

AB

A B AB0 0 10 1 11 0 11 1 0

Table: Truth table for NAND gate

Yipeng Huang
We write AND like a product

14/17

OR gate, NOR gate

AB

A + B

A B A + B0 0 00 1 11 0 11 1 1

Table: Truth table for OR gate

AB

A + B

A B A + B0 0 10 1 01 0 01 1 0

Table: Truth table for NOR gate

Yipeng Huang
We write OR like a sum

15/17

XOR gate, XNOR gate

AB

A ⊕ B

A B A ⊕ B0 0 00 1 11 0 11 1 0

Table: Truth table for XOR gate

AB

A ⊕ B

A B A ⊕ B0 0 10 1 01 0 01 1 1

Table: Truth table for XNOR gate

16/17

More-than-2-input AND gate

AB

AB

CABC

A B C ABC0 0 0 00 0 1 00 1 0 00 1 1 01 0 0 01 0 1 01 1 0 01 1 1 1

Table: Truth table for three-input AND gate

Yipeng Huang
ABC

17/17

More-than-2-input OR gate

AB

A + B

CA + B + C

A B C A + B + C0 0 0 00 0 1 10 1 0 10 1 1 11 0 0 11 0 1 11 1 0 11 1 1 1

Table: Truth table for three-input AND gate

Yipeng Huang
A+B+C

Recommended