THE ARITHMETIC-LOGIC UNIT. BINARY HALF-ADDER BINARY HALF-ADDER condt Half adder InputOutput XYSC 0000 0110 1010 1101.

Slides:



Advertisements
Similar presentations
Multiplication and Division
Advertisements

CMPE 325 Computer Architecture II
Cosc 2150: Computer Organization Chapter 9, Part 2 Integer multiplication and division.
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania ECE Computer Organization Lecture 8 - Multiplication.
Number Systems & Operations
Integer division Pencil and paper binary division (dividend)(divisor) 1000.
Division CPSC 321 Computer Architecture Andreas Klappenecker.
CMPT 334 Computer Organization Chapter 3 Arithmetic for Computers [Adapted from Computer Organization and Design 5 th Edition, Patterson & Hennessy, ©
Princess Sumaya Univ. Computer Engineering Dept. Chapter 3:
Princess Sumaya Univ. Computer Engineering Dept. Chapter 3: IT Students.
Binary Addition Rules Adding Binary Numbers = = 1
L10 – Multiplication Division 1 Comp 411 – Fall /19/2009 Binary Multipliers ×
Integer Multiplication and Division ICS 233 Computer Architecture and Assembly Language Dr. Aiman El-Maleh College of Computer Sciences and Engineering.
Computer Organization Multiplication and Division Feb 2005 Reading: Portions of these slides are derived from: Textbook figures © 1998 Morgan Kaufmann.
1 Lecture 8: Binary Multiplication & Division Today’s topics:  Addition/Subtraction  Multiplication  Division Reminder: get started early on assignment.
Digital Arithmetic Wen-Hung Liao, Ph.D.. Objectives Perform binary addition, subtraction, multiplication, and division on two binary numbers. Add and.
DIGITAL SYSTEMS TCE1111 Representation and Arithmetic Operations with Signed Numbers Week 6 and 7 (Lecture 1 of 2)
Data Representation in Computers. Data Representation in Computers/Session 3 / 2 of 33 Number systems  The additive approach – Number earlier consisted.
1 Arithmetic and Logical Operations - Part II. Unsigned Numbers Addition in unsigned numbers is the same regardless of the base. Given a pair of bit sequences.
Data Representation – Binary Numbers
ECE 4110– Sequential Logic Design
Computer Architecture Lecture 3: Logical circuits, computer arithmetics Piotr Bilski.
PRESENTATION 1 Whole Numbers. PLACE VALUE The value of any digit depends on its place value Place value is based on multiples of 10 as follows: UNITS.
Copyright 1995 by Coherence LTD., all rights reserved (Revised: Oct 97 by Rafi Lohev, Oct 99 by Yair Wiseman, Sep 04 Oren Kapah) IBM י ב מ 10-1 The ALU.
Topic: Arithmetic Circuits Course: Digital Systems Slide no. 1 Chapter # 5: Arithmetic Circuits.
Integer Conversion Between Decimal and Binary Bases Conversion of decimal to binary more complicated Task accomplished by –Repeated division of decimal.
Multiplication of signed-operands
L/O/G/O CPU Arithmetic Chapter 7 CS.216 Computer Architecture and Organization.
Computer Arithmetic and the Arithmetic Unit Lesson 2 - Ioan Despi.
Conversion to Larger Number of Bits Ex: Immediate Field (signed 16 bit) to 32 bit Positive numbers have implied 0’s to the left. So, put 16 bit number.
Princess Sumaya Univ. Computer Engineering Dept. Chapter 3:
Number Systems & Operations
Mohamed Younis CMCS 411, Computer Architecture 1 CMSC Computer Architecture Lecture 11 Performing Division March 5,
Division. Just as multiplication can be expressed as a series of additions, division can be seen as a series of subtractions. 21 ÷ 7 asks how many times.
Department of Communication Engineering, NCTU 1 Unit 4 Arithmetic and Logic Units.
Division Quotient Divisor Dividend – – Remainder.
©2010 Cengage Learning SLIDES FOR CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION Click the mouse to move to the next page. Use the ESC key to exit.
COMPUTER ARITHMETIC Arithmetic with Signed-2's Complement Numbers
1 Lecture 5Multiplication and Division ECE 0142 Computer Organization.
William Stallings Computer Organization and Architecture 8th Edition
More Binary Arithmetic - Multiplication
COMPUTER ARITHMETIC Arithmetic with Signed-2's Complement Numbers
Computer Architecture & Operations I
Multiplication and Division basics
CHAPTER 18 Circuits for Arithmetic Operations
Warm-up 6-4.
Computer Architecture & Operations I
Integer Multiplication and Division
Digital Arithmetic Wen-Hung Liao, Ph.D..
COMPUTING FUNDAMENTALS
Morgan Kaufmann Publishers
Multiplication & Division
Lecture 16 Arithmetic Circuits
Arithmetic and Logic Units
CSCI206 - Computer Organization & Programming
Topic 3c Integer Multiply and Divide
Computer Organization and Design
ECEG-3202 Computer Architecture and Organization
12/7/
Reading: Study Chapter (including Booth coding)
October 15 Chapter 4 – Multiplication/Division Go to the State Fair!
Montek Singh Mon, Mar 28, 2011 Lecture 11
CHAPTER 18 Circuits for Arithmetic Operations
October 5 Register to vote! Go to the State Fair! (15-24 October)
1 Lecture 5Multiplication and Division ECE 0142 Computer Organization.
Presentation transcript:

THE ARITHMETIC-LOGIC UNIT

BINARY HALF-ADDER

BINARY HALF-ADDER condt Half adder InputOutput XYSC

Karnaugh Map and formulae for S 01 10

FULL ADDER InputsOutputs XYCiCi S C o

Karnaugh Map and formulae for S

Karnaugh Map and formulae for carry out

FULL ADDER condt Half adder S2S2

FULL ADDER condt

FULL ADDER (IBM version)

FULL ADDER (IBM version) condt

PARALLEL ADDER

Applying the parallel adder for addition of natural numbers Examples a)b)

Applying the parallel adder for addition of integers in 2s complement code Examples a)

Example b) Skip!

Example c) Skip! Contradiction because

Applying the parallel adder for addition of integers in 1s complement code Example a)

Example b)

Parallel addition and subtraction

Basic logic operations

Shift operations

Generalized parallel arithmetic element

Problems encountered during multiplication Multiplicand Multiplier Partial products Product

Operations to be performed by ALU during multiplication: To sense whether a given bit is 1 or 0; To shift left partial products; To add the partial products.

Basic steps during multiplication: The accumulator is reset to 0, the multiplicand is load to the register Y and the multiplier is load to the register B. Accumulator 0………….0 B register multiplier Y register multiplicand

Basic steps during multiplication condt The following basic step is repeated n times where n is the number of bits in magnitude part of the numbers being multiplied: –1 0 If the rightmost bit in the B register is a 0, the combined accumulator and B register are shifted right one place. –2 0 If the rightmost bit in the B register is a 1, the number in Y register is added to the contents of the accumulator, and then the combined accumulator and B register are shifted right one place. When basic steps are finished, the contents of the combined accumulator and the B register consist of the product being derived. The sign of it is set by a separate circuit.

Example Product:

Problems encountered during division Divisor Dividend Remainder Quotient a)

Problems encountered during division condt Remainder b) Dividend Divisor Quotient

Problems encountered during division condt Remainder c) Divisor Quotient Dividend

Description of the division procedure: Before the procedure starts, the B register is reset to 0, the dividend is read into the accumulator and the divisor into the Y register. After the division, the quotient is stored in the B register, and the remainder in the accumulator. Both divisor and dividend are to be positive. Accumulator dividend Y register divisor B register 00000

Description of the division procedure condt The procedure is divided into the following steps: –Step I. A „trial division” is made by subtracting the Y register from the accumulator. The sign bit of the accumulator is examined and the dividend (accumulator) is restored by adding the divisor to the result of the subtraction. If the above sign bit is 1, the process of division is completed, if it is 0, the process is continued.

Description of the division procedure condt –Step II. The leftmost 1 bit in the divisor is aligned with the leftmost 1 bit in the dividend by shifting the divisor left and recording the number of shifts required to make this alignment. That number of shifts plus 1 is the value of the parameter p applied in the next step. –Step III. The contents of the Y register is subtracted from the accumulator (operation performed in 2s complement code, the result replaces the contents of the accumulator). There are two possible cases. a) A new contents of the accumulator represents a negative number i.e. its sign bit is 1. Therefore the previous contents of the accumulator is restored by adding to it the contents of the Y register and the long register X+B is shifted left one place putting 0 is as the rightmost bit of X+B. b) A new contents of the accumulator represents a non negative number i.e. its sign bit is 0. In that case the long register X+B is shifted left one place putting 1 as the rightmost bit of X+B. The step III is repeated p times. –Step IV. The contents of the accumulator is shifted right p times.

Examples a)c) b)

Example a) quotient: 10 2 ; remainder: 0 2.

Example b) quotient: 0 2 ; remainder:

Example c) quotient: ; remainder: 1 2.