Addition and Subtraction

Similar documents
Module 2. Basic Digital Building Blocks. Binary Arithmetic & Arithmetic Circuits Comparators, Decoders, Encoders, Multiplexors Flip-Flops

Arithmetic Circuits How to add and subtract using combinational logic Setting flags Adding faster

Advanced Information Storage 02

Overview. Arithmetic circuits. Binary half adder. Binary full adder. Last lecture PLDs ROMs Tristates Design examples

Chapter 03: Computer Arithmetic. Lesson 03: Arithmetic Operations Adder and Subtractor circuits Design

ECE 2300 Digital Logic & Computer Organization

Midterm Exam Two is scheduled on April 8 in class. On March 27 I will help you prepare Midterm Exam Two.

Information Storage and Spintronics 02

COMBINATIONAL LOGIC FUNCTIONS

Arithmetic Circuits Didn t I learn how to do addition in the second grade? UNC courses aren t what they used to be...

Adders - Subtractors

Fundamentals of Computer Systems

Combinational Logic. By : Ali Mustafa

Chapter 5. Digital systems. 5.1 Boolean algebra Negation, conjunction and disjunction

Combinational Logic Design Arithmetic Functions and Circuits

UNIT III Design of Combinational Logic Circuits. Department of Computer Science SRM UNIVERSITY

CMSC 313 Lecture 18 Midterm Exam returned Assign Homework 3 Circuits for Addition Digital Logic Components Programmable Logic Arrays

Logic and Computer Design Fundamentals. Chapter 5 Arithmetic Functions and Circuits

Systems I: Computer Organization and Architecture

Ex code

CS61C : Machine Structures

CS61C : Machine Structures

Menu. Binary Adder EEL3701 EEL3701. Add, Subtract, Compare, ALU

Additional Gates COE 202. Digital Logic Design. Dr. Muhamed Mudawar King Fahd University of Petroleum and Minerals

Chapter 5 Arithmetic Circuits

CprE 281: Digital Logic

XI STANDARD [ COMPUTER SCIENCE ] 5 MARKS STUDY MATERIAL.

CSE 20 DISCRETE MATH. Fall

Digital- or Logic Circuits. Outline Logic Circuits. Logic Voltage Levels. Binary Representation

Introduction to Digital Logic Missouri S&T University CPE 2210 Subtractors

Combinational Logic. Jee-Hwan Ryu. School of Mechanical Engineering Korea University of Technology and Education

Arithmetic Building Blocks

Logic. Combinational. inputs. outputs. the result. system can

Boolean Algebra. Philipp Koehn. 9 September 2016

UNSIGNED BINARY NUMBERS DIGITAL ELECTRONICS SYSTEM DESIGN WHAT ABOUT NEGATIVE NUMBERS? BINARY ADDITION 11/9/2018

Bit-Sliced Design. EECS 141 F01 Arithmetic Circuits. A Generic Digital Processor. Full-Adder. The Binary Adder

Carry Look Ahead Adders

Building a Computer Adder

Boole Algebra and Logic Series

Chapter 4. Combinational: Circuits with logic gates whose outputs depend on the present combination of the inputs. elements. Dr.

Combinational Logic. Course Instructor Mohammed Abdul kader

EE 457 HW 2 Arithmetic Designs Redekopp Puvvada Name: Due: See Website

Section 1A. Introduction & Basic Principles. Engineering Areas

Fundamentals of Digital Design

ELEN Electronique numérique

Department of Electrical and Computer Engineering University of Wisconsin - Madison. ECE/CS 352 Digital System Fundamentals.

Show that the dual of the exclusive-or is equal to its compliment. 7

LOGIC GATES A Y=A+B. Logic symbol of OR gate B The Boolean expression of OR gate is Y = A + B, read as Y equals A 'OR' B.

Computer organization

Chapter 2. Digital Logic Basics

Why digital? Overview. Number Systems. Binary to Decimal conversion

CMSC 313 Lecture 17. Focus Groups. Announcement: in-class lab Thu 10/30 Homework 3 Questions Circuits for Addition Midterm Exam returned

Appendix A: Digital Logic. Principles of Computer Architecture. Principles of Computer Architecture by M. Murdocca and V. Heuring

EEL 3701 Fall Multiply out the following logic expressions to obtain the Sum of Products.

EECS 427 Lecture 8: Adders Readings: EECS 427 F09 Lecture 8 1. Reminders. HW3 project initial proposal: due Wednesday 10/7

UNIT 8A Computer Circuitry: Layers of Abstraction. Boolean Logic & Truth Tables

Vidyalankar. S.E. Sem. III [EXTC] Digital System Design. Q.1 Solve following : [20] Q.1(a) Explain the following decimals in gray code form

CMSC 313 Lecture 15 Good-bye Assembly Language Programming Overview of second half on Digital Logic DigSim Demo

Learning Objectives. Boolean Algebra. In this chapter you will learn about:

Hakim Weatherspoon CS 3410 Computer Science Cornell University

Logic. Basic Logic Functions. Switches in series (AND) Truth Tables. Switches in Parallel (OR) Alternative view for OR

14:332:231 DIGITAL LOGIC DESIGN

COMPUTERS ORGANIZATION 2ND YEAR COMPUTE SCIENCE MANAGEMENT ENGINEERING UNIT 3 - ARITMETHIC-LOGIC UNIT JOSÉ GARCÍA RODRÍGUEZ JOSÉ ANTONIO SERRA PÉREZ

Digital Logic: Boolean Algebra and Gates. Textbook Chapter 3

CMSC 313 Lecture 16 Announcement: no office hours today. Good-bye Assembly Language Programming Overview of second half on Digital Logic DigSim Demo

We are here. Assembly Language. Processors Arithmetic Logic Units. Finite State Machines. Circuits Gates. Transistors

Digital Circuits. 1. Inputs & Outputs are quantized at two levels. 2. Binary arithmetic, only digits are 0 & 1. Position indicates power of 2.

CprE 281: Digital Logic

Looking at a two binary digit sum shows what we need to extend addition to multiple binary digits.

211: Computer Architecture Summer 2016

Binary addition by hand. Adding two bits

Physics 310 Lecture 10 Microprocessors

ECE 250 / CPS 250 Computer Architecture. Basics of Logic Design Boolean Algebra, Logic Gates

CHAPTER1: Digital Logic Circuits Combination Circuits

VLSI Design I; A. Milenkovic 1

CSE140: Components and Design Techniques for Digital Systems. Decoders, adders, comparators, multipliers and other ALU elements. Tajana Simunic Rosing

9/29/2016. Task: Checking for a Lower-Case Letter. ECE 120: Introduction to Computing. Change C 5 to C 5 to Obtain L(C) from U(C)

Research Article Design Multipurpose Circuits with Minimum Garbage Outputs Using CMVMIN Gate

Binary addition (1-bit) P Q Y = P + Q Comments Carry = Carry = Carry = Carry = 1 P Q

Digital Integrated Circuits A Design Perspective. Arithmetic Circuits

L2: Combinational Logic Design (Construction and Boolean Algebra)

CHAPTER 3 LOGIC GATES & BOOLEAN ALGEBRA

Combina-onal Logic Chapter 4. Topics. Combina-on Circuit 10/13/10. EECE 256 Dr. Sidney Fels Steven Oldridge

Chapter 4: Combinational Logic Solutions to Problems: [1, 5, 9, 12, 19, 23, 30, 33]

CSE140: Components and Design Techniques for Digital Systems. Logic minimization algorithm summary. Instructor: Mohsen Imani UC San Diego

Basic Gate Repertoire

Lecture 2 Review on Digital Logic (Part 1)

Cs302 Quiz for MID TERM Exam Solved

Mealy & Moore Machines

Number System. Decimal to binary Binary to Decimal Binary to octal Binary to hexadecimal Hexadecimal to binary Octal to binary

Hw 6 due Thursday, Nov 3, 5pm No lab this week

expression simply by forming an OR of the ANDs of all input variables for which the output is

Total Time = 90 Minutes, Total Marks = 50. Total /50 /10 /18

convert a two s complement number back into a recognizable magnitude.

ELCT201: DIGITAL LOGIC DESIGN

Hardware Design I Chap. 4 Representative combinational logic

CSE370 HW3 Solutions (Winter 2010)

Chapter 1 CSCI

L2: Combinational Logic Design (Construction and Boolean Algebra)

Transcription:

ddition and Subtraction Philipp Koehn 9 February 2018

1 addition

1-it dder 2 Let s start simple: dding two 1-it numbers Truth table + 0 0 0 0 1 1 1 0 1 1 1 10

Really 2 Operations 3 Truth table for "position 0" bit + 0 0 0 0 1 1 1 0 1 1 1 0 xor Truth table for carry bit + carry 0 0 0 0 1 0 1 0 0 1 1 1 and

Reminder: asic Gates 4 ND OR NOT NND NOR

Circuits 5 "Position 0" bit OUT0 0 0 0 0 1 1 1 0 1 1 1 0 xor OR NND ND OUT0 Carry bit OUTC 0 0 0 0 1 0 1 0 0 1 1 1 and ND OUTC

Putting them Together 6 OR ND OUT0 NND ND CRRY

N-it ddition 7 011 +11 --- 110 --- 110

N-it ddition 8 011 +11 --- 110 --- 110 1+1 = 0, carry the 1

N-it ddition 9 011 +11 --- 110 --- 110 1+1+1 = 1, carry the 1

N-it ddition 10 011 +11 --- 110 --- 110 copy carry bit

1-it dder 11 OR ND OUT0 NND ND CRRY Our adder cannot handle carry as input yet

Half 1-it dder 12 OR ND OUT0 NND ND CRRY 1-IT HLF DDER

uilding a 1-it Full dder 13 1-IT HLF DDER S C SUM CRRY

uilding a 1-it Full dder 14 CRRY 1-IT HLF DDER S C 1-IT HLF DDER CRRY S C SUM CRRY

uilding a 1-it Full dder 15 CRRY 1-IT HLF DDER S C 1-IT HLF DDER S C OR SUM CRRY

1-it Full dder 16 CRRY 1-IT HLF DDER S C 1-IT HLF DDER S C OR SUM CRRY 1-IT FULL DDER

N-it Full dder 17 011 +11 --- 110 --- 110

N-it Full dder 18 011 +11 --- 110 --- 110 0 0 1-IT FULL DDER CO CI S SUM0

N-it Full dder 19 011 +11 --- 110 --- 110 1 1 1-IT FULL DDER CO CI S 0 0 1-IT FULL DDER CO CI S SUM1 SUM0

N-it Full dder 20 2 1 0 2 1 0 and so on... 1-IT FULL DDER CI 1-IT FULL DDER CI 1-IT FULL DDER CI CO S CO S CO S SUM2 SUM1 SUM0

21 subtraction

First, a Trick 22 Normally, we subtract like this: 0253-176 ---- 0110 ---- 0077

Computing the Inverse 23 Now we use the inverse of the subtrahend 0999-176 ---- 0823

Subtraction by ddition 24 This allows us to carry our subtraction by addition Well, with minor corrections 00253 +0823 ----- 01076 01076 +0001-1000 ----- 0077

lso Works in inary 25 Original problem 00253-0176 ----- 00077 0011111101-010110000 ---------- 0001001101 Inverse of subtrahend 00823 0001001111 ddition 00253 +0823 ----- 01076 Corrections +0001-1000 ---------- 0077 0011111101 +001001111 ---------- 0101001100 +000000001-100000000 ---------- 0001001101

Start with N-it dder 26 0 CO 1 2 3 0 1 2 4-IT FULL DDER 3 CI S0 S1 S2 S3

Invert its of Subtrahend 27 0 1 2 3 0 CO 1 2 3 0 1 2 4-IT FULL DDER 3 CI S0 S1 S2 S3

dd One 28 0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3 CO 4-IT FULL DDER CI V S0 S1 S2 S3 Trick: add one as carry in

Invert Overflow --- DONE 29 0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3 CO 4-IT FULL DDER CI V S0 S1 S2 S3 OVERFLOW SUM mm...

30 unifying addition and subtraction machines

Goal 31 Not two machines for addition and subtraction Combined adder and subtractor Input:,, and subtraction flag SU Output if SU=0: + if SU=1: -

NOT only if SU 32 0 1 2 3 0 1 2 3 0 1 2 3 0 1 2 3 CO 4-IT FULL DDER CI V S0 S1 S2 S3 OVERFLOW SUM mm...

NOT only if SU 33 Truth table SU X OUT 0 0 0 0 1 1 1 0 1 1 1 0 Looks like XOR XOR

Combined Machine 34 0 1 2 3 0 1 2 3 SU 0 1 2 3 0 1 2 3 SU CO 4-IT FULL DDER S0 S1 S2 S3 CI SU OVERFLOW SUM