Graduate Institute of Electronics Engineering, NTU Basic Division Scheme

Similar documents
Lecture 11. Advanced Dividers

Chapter 1: Solutions to Exercises

14:332:231 DIGITAL LOGIC DESIGN. 2 s-complement Representation

Hardware Design I Chap. 4 Representative combinational logic

Complement Arithmetic

ALU (3) - Division Algorithms

Lecture 8. Sequential Multipliers

ECE380 Digital Logic. Positional representation

Binary Multipliers. Reading: Study Chapter 3. The key trick of multiplication is memorizing a digit-to-digit table Everything else was just adding

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

Answers (1) A) 36 = - - = Now, we can divide the numbers as shown below. For example : 4 = 2, 2 4 = -2, -2-4 = -2, 2-4 = 2.

Menu. Review of Number Systems EEL3701 EEL3701. Math. Review of number systems >Binary math >Signed number systems

Part VI Function Evaluation

DIVIDER IMPLEMENTATION

SRT Division and the Pentium FDIV Bug (draft lecture notes, CSCI P415)

EE260: Digital Design, Spring n Digital Computers. n Number Systems. n Representations. n Conversions. n Arithmetic Operations.

Lecture 8: Sequential Multipliers

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

DIVISION BY DIGIT RECURRENCE

Multiplication of signed-operands

Conversions between Decimal and Binary

The goal differs from prime factorization. Prime factorization would initialize all divisors to be prime numbers instead of integers*

Divider Implementation

EDULABZ INTERNATIONAL NUMBER SYSTEM

Residue Number Systems Ivor Page 1

ENGIN 112 Intro to Electrical and Computer Engineering

9. Datapath Design. Jacob Abraham. Department of Electrical and Computer Engineering The University of Texas at Austin VLSI Design Fall 2017

Svoboda-Tung Division With No Compensation

Adders, subtractors comparators, multipliers and other ALU elements

MATH Dr. Halimah Alshehri Dr. Halimah Alshehri

Chapter 5: Solutions to Exercises

Numbers and Arithmetic

14:332:231 DIGITAL LOGIC DESIGN. Why Binary Number System?

CHAPTER 2 NUMBER SYSTEMS

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

Numbering Systems. Contents: Binary & Decimal. Converting From: B D, D B. Arithmetic operation on Binary.

0,..., r 1 = digits in radix r number system, that is 0 d i r 1 where m i n 1

CSE 241 Digital Systems Spring 2013

Adders, subtractors comparators, multipliers and other ALU elements

Hakim Weatherspoon CS 3410 Computer Science Cornell University

Digital Systems Roberto Muscedere Images 2013 Pearson Education Inc. 1

ARITHMETIC COMBINATIONAL MODULES AND NETWORKS

Chapter 5 Arithmetic Circuits

CSCI 255. S i g n e d N u m s / S h i f t i n g / A r i t h m e t i c O p s.

1. Division by a Monomial

Computer Architecture 10. Residue Number Systems

VLSI Arithmetic. Lecture 9: Carry-Save and Multi-Operand Addition. Prof. Vojin G. Oklobdzija University of California

CMP 334: Seventh Class

Chapter 6: Solutions to Exercises

A HIGH-SPEED PROCESSOR FOR RECTANGULAR-TO-POLAR CONVERSION WITH APPLICATIONS IN DIGITAL COMMUNICATIONS *

CprE 281: Digital Logic

Class 7 Integers. Answer the questions. Choose correct answer(s) from the given choices. Fill in the blanks

Numbers and Arithmetic

Negative Bit Representation Outline

Combinational Logic Design Arithmetic Functions and Circuits

hexadecimal-to-decimal conversion

Cost/Performance Tradeoff of n-select Square Root Implementations

EECS150 - Digital Design Lecture 24 - Arithmetic Blocks, Part 2 + Shifters

CS 140 Lecture 14 Standard Combinational Modules

Multiplying and dividing integers Student Activity Sheet 2; use with Exploring Patterns of multiplying and dividing integers

Ex code

ELEN Electronique numérique

Tree and Array Multipliers Ivor Page 1

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

RSA Implementation. Oregon State University

ECE260: Fundamentals of Computer Engineering

Computer Architecture, IFE CS and T&CS, 4 th sem. Representation of Integer Numbers in Computer Systems

L1 2.1 Long Division of Polynomials and The Remainder Theorem Lesson MHF4U Jensen

Number Representations

Binary addition example worked out

Fundamentals of Digital Design

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

Linear Feedback Shift Registers (LFSRs) 4-bit LFSR

KEYWORDS: Multiple Valued Logic (MVL), Residue Number System (RNS), Quinary Logic (Q uin), Quinary Full Adder, QFA, Quinary Half Adder, QHA.

In the 1960's, the term "Op Art" was coined to describe the work of a growing group of abstract painters. This movement was led by Vasarely.

Chapter 1. Binary Systems 1-1. Outline. ! Introductions. ! Number Base Conversions. ! Binary Arithmetic. ! Binary Codes. ! Binary Elements 1-2

Design of Sequential Circuits

Warm-Up. Use long division to divide 5 into

Design and FPGA Implementation of Radix-10 Algorithm for Division with Limited Precision Primitives

THE POWERS OF THREE. J. M. WILLIAMS, JR. San Francisco, California

A number that can be written as, where p and q are integers and q Number.

L1 2.1 Long Division of Polynomials and The Remainder Theorem Lesson MHF4U Jensen

Four Important Number Systems

COMBINATIONAL LOGIC FUNCTIONS

A VLSI Algorithm for Modular Multiplication/Division

International Association of Scientific Innovation and Research (IASIR) (An Association Unifying the Sciences, Engineering, and Applied Research)

EECS150 - Digital Design Lecture 27 - misc2

An Effective New CRT Based Reverse Converter for a Novel Moduli Set { 2 2n+1 1, 2 2n+1, 2 2n 1 }

Chapter 1 CSCI

Remainders. We learned how to multiply and divide in elementary


Binary Floating-Point Numbers

Digital Techniques. Figure 1: Block diagram of digital computer. Processor or Arithmetic logic unit ALU. Control Unit. Storage or memory unit

Arithmetic in Integer Rings and Prime Fields

Number representation

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

Addition of QSD intermediat e carry and sum. Carry/Sum Generation. Fig:1 Block Diagram of QSD Addition

Warm-Up. Simplify the following terms:

What s the Deal? MULTIPLICATION. Time to multiply

Transcription:

Basic Division Scheme 台灣大學電子所吳安宇博士 2002 ACCESS IC LAB

Outline Shift/subtract division algorithm. Programmed division. Restoring hardware dividers. Nonstoring and signed division. Radix-2 SRT divisioin. High-Radix division. pp. 2

Shift/Subtract Division Algorithms z Dividend z z... z z 2k 1 2k 2 1 0 d Divisor d d... d d k 1 k 2 1 0 q Quotient q q... q q k 1 k 2 1 0 s Remainder[ z ( d q)] s s... s s k 1 k 2 1 0 q d z -q 3 d 2 3 -q 2 d 2 2 -q 1 d 2 1 -q 0 d 2 0 s Division can be done by a sequence of shifts and subtract. pp. 3

Overflow Check Multiplication: product of two k-bit numbers is always 2k bits. Division: quotient of a 2k-bit number divided by a k-bit number may more than k bits. integer z = [( d q)] + s integer (2 k k z < 1) d + d = 2 d 2k k k 2k 2 z = [(2 d) (2 q)] + 2 s fractions z = [( d q )] + 2 k s Z fractions frac frac frac frac frac < d frac pp. 4

Sequential Division Algorithm Left shift partial remainder, align to the term to be subtracted. S = 2 s q (2 d) with s = z and s = 2 s ( j) ( j 1) k (0) ( k) k k j Shift left Subtract After k iteration ( ) (0) S k = 2 k s q(2 k d) = 2 k [ z ( q d)] = 2 k s Fractional version S = 2s q d with s = z and s = 2 s ( j) ( j 1) (0) k frac frac j frac frac frac frac frac ( k ) pp. 5

Example of sequential division with integer and fractional operands pp. 6

Programmed Division Use shift and add to perform integer division by a processor. Two k-bit register to store the partial remainder and the quotient. pp. 7

Restoring Hardware Dividers restore unchanged pp. 8

Nonrestoring and Signed Division Restoring division have timing issues because every cycle must be long enough to allow: Shifting of the registers. Propagation of signals through the adder Storing of the quotient digit. To avoid timing issues nonstoring division can be use. Unsigned nonstoring: Skip restore step in restoring division. keeping the incorrect partial product, and add the divisor at next cycle. Signed nonstoring: Avoid correction add operation in unsigned nonstoring by allow quotient to be {-1,1}. pp. 9

Nonrestoring Unsigned division example pp. 10

Partial Remainder variation for restoring and nonrestoring dividsion pp. 11

Nonstoring Signed Division If the quotient digits are selected from the set {1,-1}, (1 sub,-1 add). Goal is to end up with a remainder matches the sign of the dividend. (dividend can be positive or negative). The rule for quotient digit selection becomes: if sign( s) sign( d) then q = 1else q = 1 = k j k j pp. 12

Nonstoring Signed Division: Two Problems The quotient with digits 1 and -1 must be converted to standard binary. If the final remainder s has a sign opposite that of z, a correction step addition ± d to the remainder and subtraction of ± 1 from the quotient, is needed. Convert a k-digit BSD quotient to a k-bit 2 s complement number. A. replace all -1 digits with 0s to get the k-bit number p = p p... p, p {0,1} k 1 k 2 0 i B. complement p k-1 and then shift p left by 1 bit, inserting 1 to the LSB, get q= ( p p... p 1) k 1 k 2 0 2' s compl. pp. 13

Nonstoring Signed Division: example pp. 14

Radix-2 2 SRT Division: review of nonrestoring division Reconsider radix-2 nonrestoring division algorithm for fractional operands. S = 2s q d with s = z and s = 2 s ( j ) ( j 1) (0) ( k ) k j Quotient is obtained with the digit set {-1,1} and is then converted to the standard digit set {0,1}. New partial remainder Shifted old partial remainder For 2s (j-1) =0 pp. 15

Radix-2 2 SRT Division (con t) Quotient is obtained using digit set {-1,0,1}. Quotient 0 is selected when q -j =0 for d 2s (j-1) < d Quotient 0 is simple shift, can speed up the division operation. But determined d 2s (j-1) < d need trial subtraction. Would consume more time than they save! pp. 16

Radix-2 2 SRT Division (con t) SRT: Sweeney, Roberson, and Tocher discovered SRT division about the same time. Normalized divisor and normalized partial dividend. Divisor and partial dividend is limited in the range [1/2,1) or (-1,-1/2]. Easier comparison can be used due to normalized divisor. pp. 17

Radix-2 2 SRT Division (con t) Because of normalized divisor. comparison become: 2s (j-1) > +½ =(0.1) 2 s-compl implies 2s (j-1) =(0.1u -2 u -3 ) 2 s-compl 2s (j-1) < -½ =(1.1) 2 s-compl implies uu 2s (j-1) =(1.0u -2 u -3 ) 2 s-compl uu 0 1 0 1 2s (j-1) > +½ is given by, and 2s (j-1) < -½ is given by. Much easier!. pp. 18

Example of Radix-2 2 SRT Division pp. 19

Basic of High-Radix Division z Dividend z z... z z 2k 1 2k 2 1 0 d Divisor d d... d d k 1 k 2 1 0 q Quotient q q... q q k 1 k 2 1 0 s Remainder[ z ( d q)] s s... s s k 1 k 2 1 0 Ex: Radix-4 division (dot notation) d q z -(q 3 q 2 ) two d4 1 -(q 1 q 0 ) two d4 0 s pp. 20

High-Radix Division example pp. 21

Features of High-Radix Division Dividing binary number in radix 2b reduces the cycles required by a factor of b, but each cycle is more difficult to implement: The higher radix makes the guessing of the correct quotient digit more difficult. The value to be subtracted are determined sequentially, one per cycle. Possible value to be subtracted become harder to generate. Other variations in division and divider please consult reference Computer Arithmetic: algorithm and hardware designs / Behrooz Parhami, OXFORD university press ch13~ch16. pp. 22