CS 261 Fall Mike Lam, Professor. Logic Gates

Similar documents
CS 261 Fall Mike Lam, Professor. Combinational Circuits

CS429: Computer Organization and Architecture

6.1 Combinational Circuits. George Boole ( ) Claude Shannon ( )

Digital Logic Design Exercises. Assignment 1

Topics of this Slideset. CS429: Computer Organization and Architecture. Digital Signals. Truth Tables. Logic Design

6.1 Combinational Circuits. George Boole ( ) Claude Shannon ( )

Systems Programming. Lecture 2 Review of Computer Architecture I

QUESTION BANK FOR TEST

Henry Lin, Department of Electrical and Computer Engineering, California State University, Bakersfield Lecture 7 (Digital Logic) July 24 th, 2012

BUILDING BLOCKS OF A BASIC MICROPROCESSOR. Part 1 PowerPoint Format of Lecture 3 of Book

Computer Organization and Levels of Abstraction

Computer Organization and Levels of Abstraction

Reference Sheet for C112 Hardware

CS 31: Intro to Systems Digital Logic. Kevin Webb Swarthmore College February 3, 2015

Code No: R Set No. 1

GC03 Boolean Algebra

CS 31: Intro to Systems Digital Logic. Kevin Webb Swarthmore College February 2, 2016

Combinational Circuits

Many ways to build logic out of MOSFETs

Computer Systems. Binary Representation. Binary Representation. Logical Computation: Boolean Algebra

(ii) Simplify and implement the following SOP function using NOR gates:

Von Neumann Architecture

CONTENTS CHAPTER 1: NUMBER SYSTEM. Foreword...(vii) Preface... (ix) Acknowledgement... (xi) About the Author...(xxiii)

LECTURE 4. Logic Design

Boolean Logic CS.352.F12

6. Combinational Circuits. Building Blocks. Digital Circuits. Wires. Q. What is a digital system? A. Digital: signals are 0 or 1.

Chapter 4. The Processor

EXPERIMENT #8: BINARY ARITHMETIC OPERATIONS

DIGITAL ELECTRONICS. P41l 3 HOURS

Chapter 2 Logic Gates and Introduction to Computer Architecture

History of Computing. Ahmed Sallam 11/28/2014 1

Let s put together a Manual Processor

FPGA Design Challenge :Techkriti 14 Digital Design using Verilog Part 1

Sample Exam I PAC II ANSWERS

Basic Arithmetic (adding and subtracting)

CSC 220: Computer Organization Unit 10 Arithmetic-logic units

ECE 550D Fundamentals of Computer Systems and Engineering. Fall 2017

Code No: R Set No. 1

END-TERM EXAMINATION

Arithmetic-logic units

Introduction to Boole algebra. Binary algebra

Arithmetic Logic Unit. Digital Computer Design

Injntu.com Injntu.com Injntu.com R16

Electronic Engineering Part 1 Laboratory Experiment. Digital Circuit Design 1 Combinational Logic. (3 hours)

Combinational Logic II

UNIT - V MEMORY P.VIDYA SAGAR ( ASSOCIATE PROFESSOR) Department of Electronics and Communication Engineering, VBIT

Memory Supplement for Section 3.6 of the textbook

UC Berkeley College of Engineering, EECS Department CS61C: Combinational Logic Blocks

UC Berkeley College of Engineering, EECS Department CS61C: Combinational Logic Blocks

COMPUTER ARCHITECTURE AND ORGANIZATION Register Transfer and Micro-operations 1. Introduction A digital system is an interconnection of digital

CS61C : Machine Structures

Digital Design with FPGAs. By Neeraj Kulkarni

Chapter 4. The Processor. Instruction count Determined by ISA and compiler. We will examine two MIPS implementations

Arab Open University. Computer Organization and Architecture - T103

ECE 331: N0. Professor Andrew Mason Michigan State University. Opening Remarks

Week 2 Tutorial: The Verilog Primer

e-pg Pathshala Subject : Computer Science Paper: Embedded System Module: Introduction to Computing Module No: CS/ES/1 Quadrant 1 e-text

Overview. CSE372 Digital Systems Organization and Design Lab. Hardware CAD. Two Types of Chips

CS101 Lecture 25: The Machinery of Computation: Computer Architecture. John Magee 29 July 2013 Some material copyright Jones and Bartlett

CS 24: INTRODUCTION TO. Spring 2015 Lecture 2 COMPUTING SYSTEMS

Lecture 10: Combinational Circuits

Lab 3: Combinational Logic Computation Structures Spring 2019

3. The high voltage level of a digital signal in positive logic is : a) 1 b) 0 c) either 1 or 0

Midterm Project Design of 4 Bit ALU Fall 2001

Digital Systems. John SUM Institute of Technology Management National Chung Hsing University Taichung, ROC. December 6, 2012

Chapter 4. The Processor Designing the datapath

Boolean Algebra and Logic Gates

ELCT 501: Digital System Design

Mark Redekopp, All rights reserved. EE 352 Unit 8. HW Constructs

ETGG1801 Game Programming Foundations I Andrew Holbrook Fall Lecture 0 - Introduction to Computers 1

Code No: R Set No. 1

HANSABA COLLEGE OF ENGINEERING & TECHNOLOGY (098) SUBJECT: DIGITAL ELECTRONICS ( ) Assignment

Lecture #21 March 31, 2004 Introduction to Gates and Circuits

COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING QUESTION BANK SUBJECT CODE & NAME: EC 1312 DIGITAL LOGIC CIRCUITS UNIT I

R a) Simplify the logic functions from binary to seven segment display code converter (8M) b) Simplify the following using Tabular method

EE292: Fundamentals of ECE

DIGITAL CIRCUIT LOGIC UNIT 9: MULTIPLEXERS, DECODERS, AND PROGRAMMABLE LOGIC DEVICES

CS140 Lecture 03: The Machinery of Computation: Combinational Logic

Introduction to Computer Science. Homework 1

211: Computer Architecture Summer 2016

Storage Elements & Sequential Circuits

2008 The McGraw-Hill Companies, Inc. All rights reserved.


CS 31: Intro to Systems Digital Logic

Chapter 4. The Processor

ECE 2030B 1:00pm Computer Engineering Spring problems, 5 pages Exam Two 10 March 2010

Systems Architecture I

REGISTER TRANSFER LANGUAGE

Date Performed: Marks Obtained: /10. Group Members (ID):. Experiment # 09 MULTIPLEXERS

Chapter 2: Universal Building Blocks. CS105: Great Insights in Computer Science

Department of Electrical Engineering McGill University ECSE 221 Introduction to Computer Engineering Assignment 2 Combinational Logic

COSC 243. Computer Architecture 1. COSC 243 (Computer Architecture) Lecture 6 - Computer Architecture 1 1

Register Transfer Language and Microoperations (Part 2)


ECE 2030D Computer Engineering Spring problems, 5 pages Exam Two 8 March 2012

EECS 150 Homework 7 Solutions Fall (a) 4.3 The functions for the 7 segment display decoder given in Section 4.3 are:

VALLIAMMAI ENGINEERING COLLEGE. SRM Nagar, Kattankulathur DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING EC6302 DIGITAL ELECTRONICS

Lecture Topics. Announcements. Today: Integer Arithmetic (P&H ) Next: continued. Consulting hours. Introduction to Sim. Milestone #1 (due 1/26)

Institute of Engineering & Management

COMP combinational logic 1 Jan. 18, 2016

Transcription:

CS 261 Fall 2016 Mike Lam, Professor Logic Gates

The final frontier Java programs running on Java VM C programs compiled on Linux Assembly / machine code on CPU + memory??? Switches and electric signals

Aside: Relays From Code recommended reading: Question: what happens if we connect the light bulb to the other contact? Relay

Aside: Relays From Code recommended reading: Regular relay Inverted relay (NOT)

Aside: Relays From Code recommended reading: ON ON ON

Aside: Relays From Code recommended reading: ON ON ON Relays in series (AND) Relays in parallel (OR)

Digital hardware Digital signals are transmitted via electric signals by varying voltages 1.0 V (high) = binary 1 0.0 V (low) = binary 0 Use a threshold to distinguish Images from https://learn.sparkfun.com/tutorials/transistors

Digital hardware Digital signals are transmitted via electric signals by varying voltages 1.0 V (high) = binary 1 0.0 V (low) = binary 0 Use a threshold to distinguish AND OR Images from https://learn.sparkfun.com/tutorials/transistors

Transistors Transistors are the fundamental hardware component of computing Similar to relays; replaced vacuum tubes Smaller, more reliable, and use less energy Primary functions: switching and amplification Mostly silicon-based semiconductors now Metal Oxide Semiconductor Field-Effect Transistor (MOSFET) n-channel ( on when Vgate = 1V) vs. p-channel ( off when V gate = 1V) Mass-produced on integrated circuit chips For convenience, we abstract their behavior using logic gates

Logic gates Primary gates: & 0 0 0 1 0 1 1 1! 1 0 1 1 1 0 0 1 0 0 ^ 0 1 1 0

Logic gates Primary gates: &! 0 0 0 0 1 1 1 1 1 0 AND OR NOT ^ 1 0 0 1 1 0 1 0 0 1 1 0 NAND NOR XOR

Basic combinatorial circuits Circuits are formed by connecting gates together Textbook uses Hardware Description Language (HDL) Equivalent to boolean formulas or functions f(g(x, y)) means apply operation f to the result of operation g on x and y In a diagram: x,y g f (i.e., ordering is g first, then f)

Basic combinatorial circuits Circuits are formed by connecting gates together Textbook uses Hardware Description Language (HDL) Equivalent to boolean formulas or functions f(g(x, y)) means apply operation f to the result of operation g on x and y In a diagram: x,y g f (i.e., ordering is g first, then f) NAND example: (similarly for NOR) Infix/boolean notation: a NAND b =!(a & b) Function notation: NAND(a, b) = NOT(AND(a, b)) a b 0?? 1?? 0 0 0 1 a AND b

Basic combinatorial circuits Circuits are formed by connecting gates together Textbook uses Hardware Description Language (HDL) Equivalent to boolean formulas or functions f(g(x, y)) means apply operation f to the result of operation g on x and y In a diagram: x,y g f (i.e., ordering is g first, then f) NAND example: (similarly for NOR) Infix/boolean notation: a NAND b =!(a & b) Function notation: NAND(a, b) = NOT(AND(a, b)) a b 0 0 0 1 a AND b 1 1 1 0 NOT (a AND b) 1 1 1 0 a NAND b

Basic combinatorial circuits Circuits are equivalent if the truth tables are the same a XOR b = (a OR b) AND (a NAND b) XOR(a, b) = AND(OR(a,b), NAND(a,b)) 0 1 1 1 a OR b ^ 0 1 1 0 XOR 1 1 1 0 a NAND b 0?? 1?? (a OR b) AND (a NAND b)

Basic combinatorial circuits Circuits are equivalent if the truth tables are the same a XOR b = (a OR b) AND (a NAND b) XOR(a, b) = AND(OR(a,b), NAND(a,b)) 0 1 1 1 a OR b ^ 0 1 1 0 XOR 1 1 1 0 a NAND b 0 1 1 0 (a OR b) AND (a NAND b)

Basic combinatorial circuits Circuits can be equivalent even if the structure is different f(a, b) = (a AND!b) OR (!a AND b) What is this equivalent to? b a 0 0 0 1 1 0 a AND!b a b 0 1 0 0!a AND b 0?? 1?? (a AND!b) OR (!a AND b)

Basic combinatorial circuits Circuits can be equivalent even if the structure is different f(a, b) = (a AND!b) OR (!a AND b) What is this equivalent to? b a 0 0 0 1 1 0 a AND!b ^ 0 0 1 1 0 b 1 1 0 XOR a 0 1 0 0 (a AND!b) OR (!a AND b)!a AND b

Important properties Identity: a AND 1 = a (a OR 0) = a Constants: a AND 0 = 0 (a OR 1) = 1 Also: a NAND 0 = 1 (a NOR 1) = 0 Inverses: a NAND 1 =!a (a NOR 0) =!a Also: a NAND a =!a a NOR a =!a Double inverse:!!a = a Or: NOT(NOT(a)) = a De Morgan s law:!(a & b) =!a!b Alternatively:!(a b) =!a &!b (remember this from CS 227?)

Universal gates NAND and NOR gates are universal Each one alone can reproduce all other gates Example: a AND b = a & b =!(!(a & b)) =!(a NAND b) = (a NAND b) NAND (a NAND b) 1 1 1 0 a NAND b 0 0 0 1 (a NAND b) NAND (a NAND b) 0 0 0 1 a AND b

Universal gates NAND and NOR gates are universal Each one alone can reproduce all other gates Example: a AND b = a & b =!(!(a & b)) =!(a NAND b) = (a NAND b) NAND (a NAND b) Similarly: a AND b =!(!(a & b)) =!(!a!b) =!a NOR!b = (a NOR a) NOR (b NOR b) 1 1 1 0 0 0 0 1 0 0 0 1 a NAND b (a NAND b) NAND (a NAND b) a AND b (a NOR a) NOR (b NOR b)

Computation Identify circuits that perform useful computation Testing bits to see if they re equal Selecting between multiple inputs Adding or subtracting bits Bitwise operations (AND, OR, XOR) Make them work on bytes instead of bits

Equality

Equality a EQ b = (a & b) (!a &!b) EQ(a, b) = OR(AND(a, b), AND(NOT(a), NOT(b)))

Multiplexor ( selector )

Multiplexor ( selector ) MUX (a, b, s) = (s & a) (!s & b)

Abstraction Name circuits, then use them to build more complex circuits E.g., use bit-level EQ to build a word-level equality circuit:

Word-level 2-way multiplexer

Word-level 4-way multiplexer

Adders and flip-flops Half Adder SR Flip-flop Full Adder Gated D Flip-flop

ALUs and memory Combine adders and multiplexors to make arithmetic/logic units Combine flip-flops to make register files and main memory Basic Arithmetic Logic Unit (ALU) 4-bit Register

CPUs Combine ALU with registers and memory to make CPUs

Computers Combine CPU with other electronic components and devices (similarly constructed) communicating via buses to make a computer

Big picture Basic systems design approach: exploit abstraction Start with simple components Combine to make more complex components Repeat using the new components as black box simple components This is true of most areas in systems CS 261: transistors gates circuits adders/flip-flops ALUs/registers CPUs/memory computers CS 261: machine code assembly C code Java/Python code CS 361/470: threads processes nodes networks/clusters CS 432: scanner parser analyzer code generator optimizer CS 450: files + processes + I/O kernel operating system

Course status We ve hit the bottom Or at least as far down as we re going to go (logic gates) from here we go back up! Next week Combinational circuits Sequential circuits CPU architecture Suggestion: download Logisim (already installed on lap machines) and play around with some circuits!