Computer Arithmetic andveriloghdl Fundamentals

Similar documents
Digital Design. Verilo. and. Fundamentals. fit HDL. Joseph Cavanagh. CRC Press Taylor & Francis Group Boca Raton London New York

Verilog HDL. Design Examples

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

COPYRIGHTED MATERIAL INDEX

Injntu.com Injntu.com Injntu.com R16

Computer Architecture and Organization

Principles of Computer Architecture. Chapter 3: Arithmetic

CPE300: Digital System Architecture and Design

Chap.3 3. Chap reduces the complexity required to represent the schematic diagram of a circuit Library

Digital Design Using Digilent FPGA Boards -- Verilog / Active-HDL Edition

Digital Fundamentals

UPY14602-DIGITAL ELECTRONICS AND MICROPROCESSORS Lesson Plan

R07. Code No: V0423. II B. Tech II Semester, Supplementary Examinations, April

CHW 261: Logic Design

At the ith stage: Input: ci is the carry-in Output: si is the sum ci+1 carry-out to (i+1)st state

EE 8351 Digital Logic Circuits Ms.J.Jayaudhaya, ASP/EEE

Topics. 6.1 Number Systems and Radix Conversion 6.2 Fixed-Point Arithmetic 6.3 Seminumeric Aspects of ALU Design 6.4 Floating-Point Arithmetic

D I G I T A L C I R C U I T S E E

1. Mark the correct statement(s)

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

Hardware Modules for Safe Integer and Floating-Point Arithmetic

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

ii) Do the following conversions: output is. (a) (101.10) 10 = (?) 2 i) Define X-NOR gate. (b) (10101) 2 = (?) Gray (2) /030832/31034

PESIT Bangalore South Campus

EC2303-COMPUTER ARCHITECTURE AND ORGANIZATION

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

VTU NOTES QUESTION PAPERS NEWS RESULTS FORUMS Arithmetic (a) The four possible cases Carry (b) Truth table x y


Combinational Circuits

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

Combinational Logic II

Digital System Design with SystemVerilog

VALLIAMMAI ENGINEERING COLLEGE

PRINCIPLES OF MODERN DIGITAL DESIGN. Parag K. Lala Cary and Lois Patterson Chair of Electrical Engineering Texas A&M University Texarkana

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

VALLIAMMAI ENGINEERING COLLEGE

Preface... xxi Chapter One: Digital Signals and Systems... 1 Chapter Two: Numbering Systems... 17

DHANALAKSHMI SRINIVASAN COLLEGE OF ENGINEERING AND TECHNOLOGY

Chapter 4. Combinational Logic

SUBJECT CODE: IT T35 DIGITAL SYSTEM DESIGN YEAR / SEM : 2 / 3


Chapter Three. Digital Components

Chapter 4. Operations on Data

SOME ASSEMBLY REQUIRED

Combinational Logic. Prof. Wangrok Oh. Dept. of Information Communications Eng. Chungnam National University. Prof. Wangrok Oh(CNU) 1 / 93

Combinational Logic Circuits

FUNDAMENTALS OF DIGITAL CIRCUITS

SYLLABUS. osmania university CHAPTER - 1 : REGISTER TRANSFER LANGUAGE AND MICRO OPERATION CHAPTER - 2 : BASIC COMPUTER


Computer Arithmetic Ch 8

Computer Arithmetic Ch 8

GATE CSE. GATE CSE Book. November 2016 GATE CSE

Week 7: Assignment Solutions

DIRECTORATE OF TECHNICAL EDUCATION DIPLOMA IN ELECTRICAL AND ELECTRONICS ENGINEERING II YEAR M SCHEME IV SEMESTER.

Basic Arithmetic (adding and subtracting)

Advanced Computer Architecture-CS501

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

KING FAHD UNIVERSITY OF PETROLEUM & MINERALS COMPUTER ENGINEERING DEPARTMENT

Objectives: 1. Design procedure. 2. Fundamental circuits. 1. Design procedure

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

UNIT IV: DATA PATH DESIGN

Divide: Paper & Pencil

SHRI ANGALAMMAN COLLEGE OF ENGINEERING. (An ISO 9001:2008 Certified Institution) SIRUGANOOR, TIRUCHIRAPPALLI

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

Floating Point. The World is Not Just Integers. Programming languages support numbers with fraction

UNIVERSITY OF MASSACHUSETTS Dept. of Electrical & Computer Engineering. Digital Computer Arithmetic ECE 666

Chapter 3: part 3 Binary Subtraction

Part III The Arithmetic/Logic Unit. Oct Computer Architecture, The Arithmetic/Logic Unit Slide 1

Digital Fundamentals

Code No: R Set No. 1

Korea University of Technology and Education

Floating-Point Data Representation and Manipulation 198:231 Introduction to Computer Organization Lecture 3

Digital Fundamentals. CHAPTER 2 Number Systems, Operations, and Codes

INSTITUTE OF AERONAUTICAL ENGINEERING Dundigal, Hyderabad ELECTRONICS AND COMMUNICATIONS ENGINEERING

MIPS Integer ALU Requirements

COMBINATIONAL LOGIC CIRCUITS

CHAPTER V NUMBER SYSTEMS AND ARITHMETIC

Computer Architecture

SIDDHARTH GROUP OF INSTITUTIONS :: PUTTUR Siddharth Nagar, Narayanavanam Road QUESTION BANK (DESCRIPTIVE)

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

Floating Point Arithmetic

Verilog HDL. A Guide to Digital Design and Synthesis. Samir Palnitkar. SunSoft Press A Prentice Hall Title

By, Ajinkya Karande Adarsh Yoga

COMPUTER ORGANIZATION AND DESIGN. 5 th Edition. The Hardware/Software Interface. Chapter 3. Arithmetic for Computers Implementation

Number Systems Standard positional representation of numbers: An unsigned number with whole and fraction portions is represented as:

DIGITAL ARITHMETIC. Miloš D. Ercegovac Computer Science Department University of California Los Angeles and

The ALU consists of combinational logic. Processes all data in the CPU. ALL von Neuman machines have an ALU loop.

Chapter 03: Computer Arithmetic. Lesson 09: Arithmetic using floating point numbers

Chapter 3 Part 2 Combinational Logic Design

EE878 Special Topics in VLSI. Computer Arithmetic for Digital Signal Processing

A Binary Floating-Point Adder with the Signed-Digit Number Arithmetic

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

ELEC 326: Class project

Code No: R Set No. 1

B.Tech II Year I Semester (R13) Regular Examinations December 2014 DIGITAL LOGIC DESIGN

(+A) + ( B) + (A B) (B A) + (A B) ( A) + (+ B) (A B) + (B A) + (A B) (+ A) (+ B) + (A - B) (B A) + (A B) ( A) ( B) (A B) + (B A) + (A B)

CS Computer Architecture. 1. Explain Carry Look Ahead adders in detail

±M R ±E, S M CHARACTERISTIC MANTISSA 1 k j

ECE 30 Introduction to Computer Engineering

Hardware Description Languages (HDLs) Verilog

Transcription:

Computer Arithmetic andveriloghdl Fundamentals Joseph Cavanagh Santa Clara University California, USA ( r ec) CRC Press vf J TayiorS«. Francis Group ^"*" "^ Boca Raton London New York CRC Press is an imprint of the Taylor & Francis Group, an tnforma business

CONTENTS Preface xv Chapter 1 Number Systems and Number Representations 1 1.1 Number Systems 1 1.1.1 Binary Number System 4 1.1.2 Octal Number System 6 1.1.3 Decimal Number System 8 1.2 Number Representations 12 1.2.1 Sign Magnitude 13 1.2.2 Diminished-Radix Complement 15 1.2.3 Radix Complement 18 1.3 Problems 22 Chapter 2 Logic Design Fundamentals 25 2.1 Boolean Algebra 25 2.2 Minimization Techniques 32 2.2.1 Algebraic Minimization 32 2.2.2 Karnaugh Maps 33 2.2.3 Quine-McCluskey Algorithm 39 2.3 Combinational Logic 44 2.3.1 Multiplexers 47 2.3.2 Decoders 53 2.3.3 Encoders 56 2.3.4 Comparators 58 2.4 Sequential Logic 60 2.4.1 Counters 62 2.4.2 Moore Machines 71 2.4.3 Mealy Machines 78 2.5 Problems 84 Chapter 3 Introduction to Verilog HDL 93 3.1 Built-in Primitives 94 3.2 User-Defined Primitives 108 3.3 Dataflow Modeling 118 3.3.1 Continuous Assignment 118 3.4 Behavioral Modeling 129 3.4.1 Initial Statement 129

viii Contents 3.4.2 Always Statement 129 3.4.3 Intrastatement Delay 133 3.4.4 Interstatement Delay 133 3.4.5 Blocking Assignments 133 3.4.6 Nonblocking Assignments 136 3.4.7 Conditional Statements 138 3.4.8 Case Statement 141 3.4.9 Loop Statements 150 3.5 Structural Modeling 154 3.5.1 Module Instantiation 154 3.5.2 Design Examples 155 3.6 Problems 179 Chapter 4 Fixed-Point Addition 183 4.1 Ripple-Carry Addition 184 4.2 Carry Lookahead Addition 191 4.3 Carry-Save Addition 201 4.3.1 Multiple-Bit Addition 201 4.3.2 Multiple-Operand Addition 206 4.4 Memory-Based Addition 212 4.5 Carry-Select Addition 216 4.6 Serial Addition 227 4.7 Problems 234 Chapter 5 Fixed-Point Subtraction 237 5.1 Twos Complement Subtraction 238 5.2 Ripple-Carry Subtraction 243 5.3 Carry Lookahead Addition/Subtraction 250 5.4 Behavioral Addition/Subtraction 267 5.5 Problems 271 Chapter 6 Fixed-Point Multiplication 275 6.1 Sequential Add-Shift Multiplication 276 6.1.1 Sequential Add-Shift Multiplication Hardware Algorithm 278 6.1.2 Sequential Add-Shift Multiplication Version 1 282 6.1.3 Sequential Add-Shift Multiplication Version 2 285 6.2 Booth Algorithm Multiplication 289 6.3 Bit-Pair Recoding Multiplication 304

Contents 6.4 6.5 6.6 6.7 6.8 Chapter 7 Array Multiplication Table Lookup Multiplication Memory-Based Multiplication Multiple-Operand Multiplication Problems Fixed-Point Division 7.1 7.2 7.3 7.4 7.5 7.6 Chapter 8 Sequential Shift-Add/Subtract Restoring Division 7.1.1 Restoring Division Version 1 7.1.2 Restoring Division Version 2 Sequential Shift-Add/Subtract Nonrestormg Division SRT Division 7.3.1 SRT Division Using Table Lookup 7.3.2 SRT Division Using the Case Statement Multiplicative Division Array Division Problems Decimal Addition 8.1 8.2 8.3 8.4 8.5 Chapter 9 Addition with Sum Correction Addition Using Multiplexers Addition with Memory-Based Correction Addition with Biased Augend Problems Decimal Subtraction 9.1 9.2 9.3 9.4 Chapter 10 10.1 10.2 10.3 10.4 ix 318 329 339 344 353 359 360 362 368 374 382 393 397 402 408 423 427 427 437 444 454 460 463 Subtraction Examples 464 Two-Decade Addition/Subtraction Unit for A+B and A-B... 467 Two-Decade Addition/Subtraction Unit for A+B, A-B, andb-a 481 Problems 491 Decimal Multiplication Binary-to-BCD Conversion Multiplication Using Behavioral Modeling Multiplication Using Structural Modeling Multiplication Using Memory 493 493 495 498 510

x Contents 10.5 Multiplication Using Table Lookup 524 10.6 Problems 528 Chapter 11 Decimal Division 529 11.1 Restoring Division Version 1 529 11.2 Restoring Division Version 2 538 11.3 Division Using Table Lookup 545 11.4 Problems 550 Chapter 12 Floating-Point Addition 551 12.1 Floating-Point Format 552 12.2 Biased Exponents 554 12.3 Floating-Point Addition 557 12.4 Overflow and Underflow 560 12.5 General Floating-Point Organization 561 12.6 Verilog HDL Implementation 564 12.7 Problems 569 Chapter 13 Floating-Point Subtraction 571 13.1 Numerical Examples 573 13.2 Flowcharts 581 13.3 Verilog HDL Implementations 584 13.3.1 True Addition 584 13.3.2 True Subtraction Version 1 589 13.3.3 True Subtraction Version 2 593 13.3.4 True Subtraction Version 3 598 13.3.5 True Subtraction Version 4 603 13.4 Problems 608 Chapter 14 Floating-Point Multiplication 611 14.1 Double Bias 613 14.2 Flowcharts 614 14.3 Numerical Examples 616 14.4 Verilog HDL Implementations 618 14.4.1 Floating-Point Multiplication Version 1 618 14.4.2 Floating-Point Multiplication Version 2 624 14.5 Problems 631

Contents xi Chapter 15 Floating-Point Division 633 15.1 Zero Bias 635 15.2 Exponent Overflow/Underflow 638 15.3 Flowcharts 641 15.4 Numerical Examples 643 15.5 Problems 646 Chapter 16 Additional Floating-Point Topics 649 16.1 Rounding Methods 649 16.1.1 Truncation Rounding 650 16.1.2 Adder-Based Rounding 651 16.1.3 Von Neumann Rounding 653 16.2 Guard Bits 654 16.3 Verilog HDL Implementations 654 16.3.1 Adder-Based Rounding Using Memory 655 16.3.2 Adder-Based Rounding Using Combinational Logic 660 16.3.3 Adder-Based Rounding Using Behavioral Modeling 668 16.3.4 Combined Truncation, Adder-Based, and von Neumann Rounding 674 16.4 Problems 680 Chapter 17 Additional Topics in Computer Arithmetic 685 17.1 Residue Checking 686 17.1.1 Dataflow Modeling 690 17.1.2 Structural Modeling 693 17.2 Parity-Checked Shift Register 717 17.3 Parity Prediction 723 17.4 Condition Codes for Addition 738 17.5 Logical and Algebraic Shifters 747 17.5.1 Behavioral Modeling 748 17.5.2 Structural Modeling 753 17.6 Arithmetic and Logic Units 760 17.6.1 Four-Function Arithmetic and Logic Unit 760 17.6.2 Sixteen-Function Arithmetic and Logic Unit 764 17.7 Count-Down Counter 771 17.8 Shift Registers 775 17.8.1 Parallel-In, Serial-Out Shift Register 775 17.8.2 Serial-In, Serial-Out Shift Register 778

xii Contents 17.8.3 Parallel-In, Serial-In, Serial-Out Shift Register 782 17.8.4 Serial-In, Parallel-Out Shift Register 787 17.9 Problems 795 Appendix A Verilog HDL Designs for Select Logic Functions 8 l A.l AND Gate 801 A.2 NAND Gate 806 A.3 OR Gate 809 A.4 NOR Gate 811 A.5 Exclusive-OR Function 814 A.6 Exclusive-NOR Function 818 A.7 Multiplexers 822 A.8 Decoders 825 A.9 Encoders 829 A.10 Priority Encoder 833 A.ll Binary-to-Gray Code Converter 836 A.12 Adder/Subtractor 843 Appendix В Event Queue 849 B.l Event Handling for Dataflow Assignments 849 B.2 Event Handling for Blocking Assignments 854 B.3 Event Handling for Nonblocking Assignments 857 B.4 Event Handling for Mixed Blocking and Nonblocking Assignments 861 Appendix С Verilog HDL Project Procedure 865 Appendix D Answers to Select Problems 867 Chapter 1 Number Systems and Number Representations 867 Chapter 2 Logic Design Fundamentals 869 Chapter 3 Introduction to Verilog HDL 873 Chapter 4 Fixed-Point Addition 883 Chapter 5 Fixed-Point Subtraction 887 Chapter 6 Fixed-Point Multiplication 891 Chapter 7 Fixed-Point Division 897 Chapter 8 Decimal Addition 903 Chapter 9 Decimal Subtraction 907

Contents xiii Chapter 10 Decimal Multiplication 908 Chapter 11 Decimal Division 912 Chapter 12 Floating-Point Addition 913 Chapter 13 Floating-Point Subtraction 915 Chapter 14 Floating-Point Multiplication 918 Chapter 15 Floating-Point Division 924 Chapter 16 Additional Floating-Point Topics 926 Chapter 17 Additional Topics in Computer Arithmetic 932 Index 943