An instruction set processor consist of two important units: Data Processing Unit (DataPath) Program Control Unit

Similar documents
COMPUTER ARCHITECTURE AND ORGANIZATION. Operation Add Magnitudes Subtract Magnitudes (+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) ( A) ( B) (A B) + (B A) + (A B)

UNIT - I: COMPUTER ARITHMETIC, REGISTER TRANSFER LANGUAGE & MICROOPERATIONS

Arithmetic Logic Unit

Computer Architecture and Organization: L04: Micro-operations

Chapter 5 : Computer Arithmetic

Divide: Paper & Pencil

REGISTER TRANSFER LANGUAGE

Timing for Ripple Carry Adder

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

COMPUTER ARCHITECTURE AND ORGANIZATION Register Transfer and Micro-operations 1. Introduction A digital system is an interconnection of digital

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

Number Systems and Computer Arithmetic

More complicated than addition. Let's look at 3 versions based on grade school algorithm (multiplicand) More time and more area

UNIT-III REGISTER TRANSFER LANGUAGE AND DESIGN OF CONTROL UNIT

Register Transfer Language and Microoperations (Part 2)

Register Transfer and Micro-operations

REGISTER TRANSFER AND MICROOPERATIONS

COMPUTER ARITHMETIC (Part 1)

COMP 303 Computer Architecture Lecture 6

Organisasi Sistem Komputer

PESIT Bangalore South Campus

CHAPTER 4: Register Transfer Language and Microoperations

For Example: P: LOAD 5 R0. The command given here is used to load a data 5 to the register R0.

Module 2: Computer Arithmetic


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

COMPUTER ORGANIZATION AND. Edition. The Hardware/Software Interface. Chapter 3. Arithmetic for Computers

9 Multiplication and Division

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

REGISTER TRANSFER AND MICROOPERATIONS

EECS150 - Digital Design Lecture 13 - Combinational Logic & Arithmetic Circuits Part 3

Computer Organization (Autonomous)

COMPUTER ORGANIZATION AND ARCHITECTURE

Chapter 4. Operations on Data

Tailoring the 32-Bit ALU to MIPS

Chapter 3 Arithmetic for Computers. ELEC 5200/ From P-H slides

CPE300: Digital System Architecture and Design

Introduction to Digital Logic Missouri S&T University CPE 2210 Multipliers/Dividers

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

Combinational and sequential circuits (learned in Chapters 1 and 2) can be used to create simple digital systems.

CS222: Processor Design

EXPERIMENT #8: BINARY ARITHMETIC OPERATIONS

SUBROUTINE NESTING AND THE PROCESSOR STACK:-

By, Ajinkya Karande Adarsh Yoga

Microcomputers. Outline. Number Systems and Digital Logic Review

Homework 3. Assigned on 02/15 Due time: midnight on 02/21 (1 WEEK only!) B.2 B.11 B.14 (hint: use multiplexors) CSCI 402: Computer Architectures

CO Computer Architecture and Programming Languages CAPL. Lecture 9

CHW 261: Logic Design

CS 5803 Introduction to High Performance Computer Architecture: Arithmetic Logic Unit. A.R. Hurson 323 CS Building, Missouri S&T

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

UNIT-III COMPUTER ARTHIMETIC

EC2303-COMPUTER ARCHITECTURE AND ORGANIZATION

361 div.1. Computer Architecture EECS 361 Lecture 7: ALU Design : Division

Binary Adders. Ripple-Carry Adder

UNIT-IV COMPUTER ARITHMETIC

Computer Organization

ECE 341 Midterm Exam

MIPS Integer ALU Requirements

Hardware Description Languages M E 2202 Tutorial Sheet

CSE 141 Computer Architecture Summer Session Lecture 3 ALU Part 2 Single Cycle CPU Part 1. Pramod V. Argade

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

1. NUMBER SYSTEMS USED IN COMPUTING: THE BINARY NUMBER SYSTEM

UNIT - V MEMORY P.VIDYA SAGAR ( ASSOCIATE PROFESSOR) Department of Electronics and Communication Engineering, VBIT

Operations On Data CHAPTER 4. (Solutions to Odd-Numbered Problems) Review Questions

EE260: Logic Design, Spring n Integer multiplication. n Booth s algorithm. n Integer division. n Restoring, non-restoring

Floating Point Arithmetic

COMPUTER ORGANIZATION

Integer Multiplication. Back to Arithmetic. Integer Multiplication. Example (Fig 4.25)

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

Week 7: Assignment Solutions

Computer Organisation CS303

Computer Arithmetic Ch 8

Computer Arithmetic Ch 8

PART A (22 Marks) 2. a) Briefly write about r's complement and (r-1)'s complement. [8] b) Explain any two ways of adding decimal numbers.

CSE 140L Spring 2010 Bonus Final

DIGITAL ARITHMETIC: OPERATIONS AND CIRCUITS

CS222: Processor Design

Introduction to Computer Science. Homework 1

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

Iterative Division Techniques COMPUTER ARITHMETIC: Lecture Notes # 6. University of Illinois at Chicago

Let s put together a Manual Processor

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

Kinds Of Data CHAPTER 3 DATA REPRESENTATION. Numbers Are Different! Positional Number Systems. Text. Numbers. Other

McGill University Faculty of Engineering FINAL EXAMINATION Fall 2007 (DEC 2007)

Least Common Multiple (LCM)

Lecture Topics. Announcements. Today: Integer Arithmetic (P&H ) Next: The MIPS ISA (P&H ) Consulting hours. Milestone #1 (due 1/26)

Digital Circuit Design and Language. Datapath Design. Chang, Ik Joon Kyunghee University

VHDL implementation of 32-bit floating point unit (FPU)

ECE 341 Midterm Exam

Number Systems. Readings: , Problem: Implement simple pocket calculator Need: Display, adders & subtractors, inputs

Computer Organization and Structure. Bing-Yu Chen National Taiwan University

ELCT 501: Digital System Design

DLD VIDYA SAGAR P. potharajuvidyasagar.wordpress.com. Vignana Bharathi Institute of Technology UNIT 3 DLD P VIDYA SAGAR

University of Illinois at Chicago. Lecture Notes # 13

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

Chapter 3: Arithmetic for Computers

COSC 243. Computer Architecture 1. COSC 243 (Computer Architecture) Lecture 6 - Computer Architecture 1 1

Chapter 10 - Computer Arithmetic

Fast Arithmetic. Philipp Koehn. 19 October 2016

Transcription:

DataPath Design

An instruction set processor consist of two important units: Data Processing Unit (DataPath) Program Control Unit

Add & subtract instructions for fixed binary numbers are found in the instruction set of every computer. To implement the add,microoperation with hardware we need registers that hold the data and the digital component that performs the arithmetic addition. The digital circuit that forms the arithmetic sum of 2 bits and a previous carry is called a full adder.

The digital circuit that generates the arithmetic sum of two binary numbers of any length is called a binary adder. The binary adder is constructed with full adder circuits connected in cascade. For Eg: The below diag shows the interconnections of 4 full adders to provide a 4 bit binary adder.

B3 A3 B2 A2 B1 A1 B0 A0 FA C3 FA C2 FA C1 FA C0 C4 S3 S2 S1 S0

By using only AND & OR gates By using XOR, AND & OR gates

First AND= Ci-1, Yi,Xi Second AND = Xi,Ci -1,Yi Third AND =Yi, Xi,Ci-1 Fourth AND = Ci -1, Xi, Yi Fifth AND = Xi, Ci-1 Sixth AND = Yi, Xi Seventh AND = Yi, Ci-1

The increment micro operation adds 1 to a number in a register. This micro operation is easily implemented with a binary counter & this can be accomplished by means of Half Adders. The output carry of one half adder is connected to one of the inputs of the next higher order half adder.

A3 A2 A1 A0 1 x HA y x HA y x HA y x HA y C S C S C S C S C4 S3 S2 S1 S0

The addition & subtraction operations can be combined into one common circuits by including an XOR gate with each full adder. This combinational circuit is known as Binary Adder Subtractor. Here, a mode bit is used to find addition and subtraction is done by the circuit. If the value of mode bit is 0 it means addition is performed and if it s value is 1 it means subtraction is performed.

B3 A3 B2 A2 B1 A1 B0 A0 M FA C3 FA C2 FA C1 FA C0 C4 S3 S2 S1 S0

Overflow is indicated by a flag bit v in operations involving signed numbers, this flag is found in CPU status register. There V is indicated as:

gi=xiyi pi=xi+yi ci=xiyi+xici-1+yici-1 ci=gi+pi(ci-1) co = g0+p0cin c1= g1+p1g0+p1p0cin c2= g2+p2g1+p2p1go+p2p1p0cin c3=g3+p3g2+p3p2g1+p3p2p1g0+p3p2p1p0cin

Fixed point multiplication requires substantially more hardware than the fixed point addition. While first bit is multiplied then we have to shift 0 bit to the left, when second bit is multiplied then there is a shift of 1 bit. Similarly for third, fourth bit and so on. The value of Partial Product is P i+1 =P i + x j 2 i Y 3 So final product is P = x j 2 i Y j=0

James E Robertson Algorithm Booth s Algorithm

Checking the bits of the multiplier one at a time and forming partial products is a sequential operation that requires a sequence of add and shift micro operations. The multiplication of two binary numbers can be done with one micro operation by means of a combinational circuit that forms the product bits all at once. This is done by making use of an array multiplier.

Division is done by 2 methods Restoring Method Non-Restoring Method

Step-1 Initialize the register with Dividend ASHL ADD B +1 Step-2 Check If E=1 or E=0 E=1 Reset Qn SC=SC-1 ASHL EAQ Add B +1 E=0 Leave Q n =0 & Add B Restore the Remainder ASHL ADD B +1 goto step-4 SC=SC-1 goto step-4 Step- 4 For Termination When SC=0 Neglect E, Remainder in A, Quotient in Q

Dividend=01110 Divisor= 10001 Quotient=11010 Remainder=00110 Dividend=30 Divisor=3 size=4 Quotient=1010 Remainder=0000 Dividend =15 Divisor=2 size=4 Quotient=0111 Remainder=0001 Dividend=38 Divisor=5 size=3 bit Quotient=111 Remainder=011

Step-1 Initialize the register with Dividend ASHL ADD M +1 If S=0 Reset Q[0] If Count=n-1 then goto step-4 Else Count=count+1 SHL SAQ ADD M +1 then goto either step 2 or step-3 If S=1 Set Q[0] If Count=n-1 then goto step-4

Else Count=count+1 SHL SAQ ADD M then goto either step 2 or step-3 Step-4 if s=1 then Add M Quotient in Q Remainder in R

Dividend=1100001 Divisor=1010 Size=4 bits Dividend=30 Divisor=3 Size=4 Dividend = 40 Divisor=2 Size=5 Dividend = 25 Divisor=4 Size=4 Dividend =15 Divisor=2 Size=4

The various circuit that are used to execute data processing instructions are usually combined in a single circuit called ALU. There are 2 types of ALU are: Combinational ALU Sequential ALU

Here the output of the whole circuit comes form:

In the above circuit When M=0 then arithmetic operation performs. When M=1 then logic operation is performed.

A sequential ALU uses flip-flops. Sequential circuits compute their output based on the input and the state and the updation of state is based on clock. Whereas combinational logic circuits implement Boolean functions it means their functions is only based on their input and they are not based on clocks.

A sequential circuit has inputs and outputs. A sequential logic circuit uses a clock. There is a box inside the circuit called state and this box contains flip-flops and this flipflop basically store a k bit number for representing the current state. Here, the output is computed based on the input and state.

The state may be updated at each positive clock edge. When there is not a positive clock edge, the state remains unchanged. The information needed to update to the state comes from the current state and the input which is fed through combinational logic and fed back into the state box, telling the state box how to update itself.

A Symbol

A Logic Diagram

Let (X m,x ) E be the floating point representation of a number X which has numerical value X M B XE. Where X m is the mantissa and the exponent X E are fixed point numbers. The four basic arithmetic operations for floating point numbers are: X+Y = (X m 2 X E Y E +Y M ) 2 Y E X-Y = (X m 2 X E Y E -Y M ) 2 Y E X Y = (X m Y M ) 2 X E +Y E X / Y = (X m / Y M ) 2 X E -Y E

The floating point operation has 4 main steps: Compare The Exponent Align The Mantissas Add The Mantissas Normalize The Result The Floating point addition and subtraction has 3 main steps: Compute Y E -X E Shift X M by Y E -X E places to the right to obtain X M 2X E -Y E. Compute (X m 2 X E Y E +/-Y M ) 2 Y E

The first step of the algorithm is equalization of the exponent which is done by subtracting them and aligning the mantissa by shifting one of them until the difference between the exponent has been reduced to 0. The aligned mantissas are added. Finally the result is normalized, if it is necessary by again shifting the mantissa and making a compensating change in the exponent.

Note: The left most bit position of E indicates the sign of the exponent if it is 0 then the exponent is negative if it is 1 then it is positive. Load E1, E2, AC & DR Compare E=E1-E2 If E<0 Then Ac:=right-shift(Ac), E:=E+1 If E>0 Then DR:= right-shift(dr), E:=E-1 If E=0 Then AC:=AC+DR, E:= max(e1, E2)

X = 0 01111111 Y = 0 10000111 10000000000 0010101101000.. In the above example the number has 32 bit floating point format of IEEE standard 754. In this format each number N has 23 bit fractional part with a hidden bit and an 8 bit exponent E in excess-127 code.