Docsity

Computer Architecture: Multiplication in ALU - Lecture Notes, Lecture notes of Microprocessors

Partial preview of the text

Download Computer Architecture: Multiplication in ALU - Lecture Notes and more Lecture notes Microprocessors in PDF only on Docsity!

CSE- 2823

Computer Architecture

Dr. Md. Waliur Rahman Miah

Associate Professor, CSE, DUET

Lecture- 2

ALU- 2

Multiplication

1

Dr. Md. Waliur Rahman Miah Dept of CSE, DUET

  • Fundamentals of the

computer:

  • Basic functional units and elements of a computer,
  • Basic Operational concepts,
  • Bus structures,
  • Performance,
  • Historical perspective;
  • Instruction sets and

addressing modes:

  • Memory locations and addresses,
  • Instructions and instruction sequencing,
  • Types of instruction operations, - Addressing modes, - Assembly language, - I/O operations, - Stacks and queues, - Subroutines;
  • Input /Output Organization:
  • Accessing I/O devices,
  • I/O modules,
  • Programmed I/O,
  • Interrupt-driven I/O,
  • Direct Memory Access,
  • I/O channels and processors; 2 Syllabus – First Part

Dr. Md. Waliur Rahman Miah Dept of CSE, DUET Today’s Topic 4

Arithmetic and logical processing unit

(ALU)

Multiplication

Ref:

Ch-9 Stallings

Ch-3 Hennessy-Petterson

Dr. Md. Waliur Rahman Miah Dept of CSE, DUET Multiplication

  • Complex
  • Work out partial product for each digit
  • Take care with place value (column)
  • Add partial products

Unsigned Binary Multiplication FIGURE 3.3: First version of the multiplication hardware. (Source: Patterson- Pg-184)

Flowchart for Unsigned Binary Multiplication FIGURE 3.4 : The first multiplication algorithm

Dr. Md. Waliur Rahman Miah Dept of CSE, DUET Refined hardware of multiplication FIGURE 3.5 : Refined version of the multiplication hardware.

Dr. Md. Waliur Rahman Miah Dept of CSE, DUET Multiplying Negative Numbers

  • This does not work!
  • Solution 1
    • Convert to positive if required
    • Multiply as above
    • If signs were different, negate answer
  • Solution 2
    • Booth’s algorithm

Example of Booth’s Algorithm- 1 (+ 7 ) X ( + 3 ) = ( + 21 ) Result = ( + 21 )

M Q AQ

Multiplicand = M = +7 = 0111 Multiplier = Q = - 3 = 1101 A Q Q- 1 M Comments 0000 1101 0 0111 Initial Values 1001 1101 0 0111 Q0Q-1 = 10; A <= A-M 1100 1110 1 0111 Right-Shift AQQ-1 preserve sign bit 0011 1110 1 0111 Q0Q-1 = 01; A <= A+M 0001 1111 0 0111 Right-Shift AQQ-1 preserve sign bit 1010 1111 0 0111 Q0Q-1 = 10; A <= A-M 1101 0111 1 0111 Right-Shift AQQ-1 preserve sign bit 1101 0111 1 0111 Q0Q-1 = 11; A <= A (no change) 1110 1011 1 0111 Right-Shift AQQ-1 preserve sign bit Product = AQ = 11101011 = - 21 Example of Booth’s Algorithm- 2 Result = ( - 21 )

Dr. Md. Waliur Rahman Miah Dept of CSE, DUET Reference [1] Patterson, D. A., & Hennessy, J. L. (2014). Computer organization and design: The hardware/software interface (5th ed.). Burlington, MA: Morgan Kaufmann Publishers. [2] William Stallings, (2010), Computer Organization and Architecture,( th Ed), Prentice Hall Upper Saddle River, NJ

[3] Carl Hamacher, Zvonko Vranesic, Safwat Zaky, Naraig Manjikian, (2012), Computer Organization and Embedded Systems ( th Ed), McGraw-Hill, New York, NY

16