Lecture 3: Binary Subtraction, Switching Algebra, Gates, and Algebraic Expressions

Similar documents
Lecture 4: Implementation AND, OR, NOT Gates and Complement

SYNERGY INSTITUTE OF ENGINEERING & TECHNOLOGY,DHENKANAL LECTURE NOTES ON DIGITAL ELECTRONICS CIRCUIT(SUBJECT CODE:PCEC4202)

ENGIN 112 Intro to Electrical and Computer Engineering

Bawar Abid Abdalla. Assistant Lecturer Software Engineering Department Koya University

60-265: Winter ANSWERS Exercise 4 Combinational Circuit Design

LSN 4 Boolean Algebra & Logic Simplification. ECT 224 Digital Computer Fundamentals. Department of Engineering Technology

CDA 3200 Digital Systems. Instructor: Dr. Janusz Zalewski Developed by: Dr. Dahai Guo Spring 2012

EE292: Fundamentals of ECE

Experiment 4 Boolean Functions Implementation

Logic Design: Part 2

EEE130 Digital Electronics I Lecture #4_1

Lecture (04) Boolean Algebra and Logic Gates

Lecture (04) Boolean Algebra and Logic Gates By: Dr. Ahmed ElShafee

Part 2,Number Systems Questions

Assignment (3-6) Boolean Algebra and Logic Simplification - General Questions

Chapter 2: Combinational Systems

Summary. Boolean Addition

Digital Arithmetic. Digital Arithmetic: Operations and Circuits Dr. Farahmand

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

Logic Gates and Boolean Algebra ENT263

Circuit analysis summary

2.6 BOOLEAN FUNCTIONS

Combinational Logic Circuits

CARLETON UNIVERSITY. Laboratory 2.0

DeMorgan's Theorem. George Self. 1 Introduction

Combinational Circuits

Simplification of Boolean Functions

QUESTION BANK FOR TEST

A complement number system is used to represent positive and negative integers. A complement number system is based on a fixed length representation

Chapter 10 Binary Arithmetics

1. Prove that if you have tri-state buffers and inverters, you can build any combinational logic circuit. [4]


Chapter 4. Operations on Data

World Inside a Computer is Binary

Semester Transition Point. EE 109 Unit 11 Binary Arithmetic. Binary Arithmetic ARITHMETIC

Combinational Devices and Boolean Algebra

CO Computer Architecture and Programming Languages CAPL. Lecture 9

Computer Organization and Programming

Unit-IV Boolean Algebra

Data Representation COE 301. Computer Organization Prof. Muhamed Mudawar

Points Addressed in this Lecture. Standard form of Boolean Expressions. Lecture 4: Logic Simplication & Karnaugh Map

Introduction to Computer Architecture

Binary Adders: Half Adders and Full Adders

Read this before starting!

SWITCHING THEORY AND LOGIC CIRCUITS

Variable, Complement, and Literal are terms used in Boolean Algebra.

DKT 122/3 DIGITAL SYSTEM 1

4. Write a sum-of-products representation of the following circuit. Y = (A + B + C) (A + B + C)

INF2270 Spring Philipp Häfliger. Lecture 4: Signed Binaries and Arithmetic

Objectives: 1- Bolean Algebra. Eng. Ayman Metwali

CS470: Computer Architecture. AMD Quad Core

Boolean Analysis of Logic Circuits

CS/COE 0447 Example Problems for Exam 2 Spring 2011

Sets 1. The things in a set are called the elements of it. If x is an element of the set S, we say

Chapter 3. Boolean Algebra and Digital Logic

ELCT201: DIGITAL LOGIC DESIGN

Binary Values. CSE 410 Lecture 02

Bawar Abid Abdalla. Assistant Lecturer Software Engineering Department Koya University

SE311: Design of Digital Systems

Basic Arithmetic (adding and subtracting)

CS101 Lecture 04: Binary Arithmetic

DIGITAL SYSTEM DESIGN

Combinational Circuits Digital Logic (Materials taken primarily from:

SIR C.R.REDDY COLLEGE OF ENGINEERING, ELURU DEPARTMENT OF INFORMATION TECHNOLOGY LESSON PLAN

Lecture 6: Signed Numbers & Arithmetic Circuits. BCD (Binary Coded Decimal) Points Addressed in this Lecture

Boolean Algebra. P1. The OR operation is closed for all x, y B x + y B

Unit 3: Multiplication and Division Reference Guide pages x 7 = 392 factors: 56, 7 product 392

IT 201 Digital System Design Module II Notes

CS61C : Machine Structures

Chapter 2. Boolean Expressions:

CS 31: Intro to Systems Binary Arithmetic. Kevin Webb Swarthmore College January 26, 2016

Binary Arithmetic. Daniel Sanchez Computer Science & Artificial Intelligence Lab M.I.T.

2.1 Binary Logic and Gates

Binary Addition. Add the binary numbers and and show the equivalent decimal addition.

EE 109 Unit 6 Binary Arithmetic

Summary of Course Coverage

(Refer Slide Time 6:48)

Injntu.com Injntu.com Injntu.com R16

Introduction to Computers and Programming. Numeric Values

ELCT201: DIGITAL LOGIC DESIGN

DIGITAL ARITHMETIC: OPERATIONS AND CIRCUITS

Chapter 3. Gate-Level Minimization. Outlines

Combinational Logic & Circuits

Unit 2: Accentuate the Negative Name:

Chapter 4. Combinational Logic

ENGIN 112. Intro to Electrical and Computer Engineering

Advanced Computer Architecture-CS501

EE 109L Review. Name: Solutions

Definitions. 03 Logic networks Boolean algebra. Boolean set: B 0,

Le L c e t c ur u e e 2 To T p o i p c i s c t o o b e b e co c v o e v r e ed e Variables Operators

Computer Organization and Levels of Abstraction

2. BOOLEAN ALGEBRA 2.1 INTRODUCTION

Chapter 1: Number and Operations

Digital Techniques. Lecture 1. 1 st Class

Propositional Calculus. CS 270: Mathematical Foundations of Computer Science Jeremy Johnson

Microcomputers. Outline. Number Systems and Digital Logic Review

Gate Level Minimization Map Method

Digital Logic Design (CEN-120) (3+1)

LABORATORY # 6 * L A B M A N U A L. Datapath Components - Adders

4 Operations On Data 4.1. Foundations of Computer Science Cengage Learning

Transcription:

EE210: Switching Systems Lecture 3: Binary Subtraction, Switching Algebra, Gates, and Algebraic Expressions Prof. YingLi Tian Feb. 5/7, 2019 Department of Electrical Engineering The City College of New York The City University of New York (CUNY) 1

Outlines Quick Review of the Last Lecture Switching Algebra Gates Algebraic Expressions Course Web-page: http://medialab.ccny.cuny.edu/wordpress/yltccnyh omepage/ee2100.html 2

Covered In Last Lecture Convert positive binary integers (unsigned) to decimal Convert decimal to positive binary integers (unsigned) Add (Subtraction ) two numbers together Unsigned Signed 3

Signed Numbers Signed binary numbers use the first bit as a sign indicator (normally 0 for positive and 1 for negative). Signed binary numbers are stored in two s complement format. Unsigned 4

Two s Complement Format for Negative Numbers Step 1: Find the binary equivalent of the magnitude Step 2: Complement each bit (that is, change 0 s to 1 s and 1 s to 0 s) Step: Add 1 Example 1: How to find the binary representation of a negative number. -5, 1) find 5: 0101; 2) Complement each bit; 3) add 1; 4) -5: 1011 Example 2 : How to find the magnitude of a negative binary number? 1011, 1) bit-by-bit complement, 2) add 1; 3) 0101 (5) 5

Overflow Overflow occurs when the sum is out of range. Can occur for both unsigned and signed numbers. For example: A 4-bit unsigned number: range [0, 15] A 4-bit signed number: range [-8, +7] Tips: For signed number, there is an overflow if: Two positive numbers result a negative sum, or Two negative numbers result a positive sum Practice: Example 1.16 (p13) (5 + 4) Example 1.17 (p14) (-5) + (-4) 6

Binary Subtraction a-b is computed as a+(-b). See Example 1.18 (Page 14): 7-5 = 7 + (-5) When doing addition or subtraction, two numbers must be both signed or unsigned. For unsigned number subtraction, overflow will happen if the carry out of the highorder bit is 0. For signed numbers, the carry out of the high-order bit is ignored. 7

Binary Subtraction Practice 5 3 unsigned numbers, if overflow? a) Use 3 bits, b) use 4 bits 3 5 unsigned numbers, if overflow? a) Use 3 bits, b) use 4 bits 5 3 signed numbers, if overflow? a) Use 4 bits, b) use 5 bits 3 5 signed numbers, if overflow? a) Use 4 bits, b) use 5 bits For signed numbers, can use 3 bits? 8

Binary Subtraction Practice 5 3 unsigned numbers, No overflow! a) Use 3 bits 101 + 101 = (1) 010, b) use 4 bits -- 0101 + 1101 = (1) 0010 3 5 unsigned numbers, Overflow! a) Use 3 bits, 011 + 011 = (0) 110, b) use 4 bits: 0011 + 1011 = (0) 1110 5 3 signed numbers, No overflow! a) Can use 4 bits? 0101 + 1101 = (1) 0010, b) use 5 bits -- 00101 + 11101 = (1) 00010 3 5 signed numbers, No overflow! a) Use 4 bits 0011 + 1011 = 1110, b) use 5 bits 00011 + 11011 = 11110 9

Combinational Logic Combinational logic has no memory (see Example 1)! Outputs are only function of current input combination Nothing is known about past events Repeating a sequence of inputs always gives the same output sequence 10

Design Combinational Systems Step 1: Represent each of the inputs and outputs in binary Step 2: Formalize the design specification either in the form of a truth table or of an algebraic expression Step 3: Simplify the description Step 4: Implement the system with the available components, subject to the design objective and constrains. 11

Truth Table A system with two inputs, A and B, and one output, Y. The output Y = 1 if any of the input is 1. 12

Don t Care Conditions For a system, the output is specified for only some of the input conditions. For the remaining input combinations, we don t care. In a truth table, we use X for don t care. 13

Design a System with Don t Care Can be one of the outputs, for example, in Table 2.3, can be either f1 or f2. Choose the one with less cost. In system design, Don t cares occur: The combination will never happen. For example, a bank alert system, only when you money <= 0, send out the alert. The design of one system to derive a second system (Handle in Chapter 7) 14

Truth Table Development Example CE1: A system with four inputs, A B, C, and D, and one output, Z, such that Z=1 iff (if and only if) three of the inputs are 1. Z1 is the correct answer of CE1 15

Design of a 7-segment display -- 1 A system displays a decimal digit (0-9) to a 7-segment display. 16

Design of a 7-segment display -- 2 17

Switching Algebra Why need Switching Algebra? Creating a whole truth table is slow Algebra allows us to simplify the expression of complex system Algebra can enable us to satisfy the constrains of a problem Switching algebra is binary All variables and constants take on one of two values: 0 and 1 18

Definition of Switching Algebra OR (written as +) a + b (read a OR b) is 1 if a = 1 or b = 1 or both. AND (written as ) a b = ab (read a AND b) is 1 if and only if a = 1 and b = 1. NOT (written as ) a (read NOT a) is 1 if and only if a = 0. 19

Gates A gate is a circuit with one output that implements one of the basic functions such as OR and AND, but the input can be 2, 3, 4 or 8. 20

Typical Gates 21

Properties of Switching Algebra -- 1 Commutative: P1a: a + b = b + a P1b: ab = ba Associative: P2a: a + (b + c) = (a + b) + c P2b: a(bc) = (ab) c Identity: P3a: a + 0 = a P3b: a 1 = a Null: P4a: a + 1 = 1 P4b: a 0 = 0 22

Properties of Switching Algebra -- 2 Complement: P5a: a + a = 1 P5b: a a = 0 Idempotency: P6a: a + a = a P6b: a a = a Involution: P7: (a ) = a Distributive: P8a: a (b + c) = ab + ac P8b: a + bc = (a + b)(a + c) 23

Properties of Switching Algebra -- 3 Adjacency: P9a: ab + ab = a P9b: (a + b)(a + b ) = a Simplification: P10a: a + a b = a + b P10b: a(a + b) = ab DeMorgan: P11a: (a + b) = a b P11b: (ab) = a + b P11aa: (a + b + c ) = a b c P11bb: (abc ) = a + b + c + Distributive: P12a: a + ab = a P12b: a(a + b) = a 24

Verify properties by constructing a truth table P8b: a + bc = (a + b)(a + c) 25

Order of precedence: Parentheses expressions inside the parentheses are evaluated first. If without parentheses: 1) NOT ; 2) AND; 3) OR Example: ab + c d = [a(b )] + [(c )d] 26

Gate Implementation P2b: a(bc) = (ab) c P2a: a + (b + c) = (a + b) + c Who want to implement it? 27

Announcement: HW1 is due Feb. 14. Review Chapter 2.2 Next class (Chapter 2.3-2.5): Implementation AND, OR, NOT Gates Complement Truth table to algebraic expressions 28