Docsity

Arithmetic and Logic Unit-Assembly Language, Microprocessors and Computer Architecture-Lecture Slides, Slides of Computer Architecture and Organization

Toggle sidebar
bg1
Arithmetic & Logic Unit
zDoes the calculations
zEverything else in the computer is there to
service this unit
zHandles integers
zMay handle floating point (real) numbers
zMay be separate FPU (maths co-
processor)
zMay be on chip separate FPU (486DX +)
docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b

Partial preview of the text

Download Arithmetic and Logic Unit-Assembly Language, Microprocessors and Computer Architecture-Lecture Slides and more Slides Computer Architecture and Organization in PDF only on Docsity!

Arithmetic & Logic Unit z

Does the calculations z Everything else in the computer is there toservice this unit z Handles integers z May handle floating point (real) numbers z May be separate FPU (maths co-processor) z May be on chip separate FPU (486DX +)

ALU Inputs and Outputs

Sign-Magnitude z

Left most bit is sign bit z 0 means positive z 1 means negative z

z

z Problems z Need to consider both sign and magnitude inarithmetic z Two representations of zero (+0 and -0)

Two’s Compliment z

z

z

z

z

z

z

Geometric Depiction of TwosComplement Integers

Negation Special Case 1 z

z Bitwise not

z Add 1 to LSB

z Result

z Overflow is ignored, so: z

Range of Numbers z

8 bit 2s compliment z +127 = 01111111 = 2 7

  • z -128 = 10000000 = - 7 z 16 bit 2s compliment z +32767 = 011111111 11111111 = 2 (^15)
  • 1 z -32768 = 100000000 00000000 = - 15

Conversion Between Lengths z

Positive number pack with leading zeros z +18 = 00010010 z +18 = 00000000 00010010 z Negative numbers pack with leading ones z -18 = 10010010 z -18 = 11111111 10010010 z i.e. pack with MSB (sign bit)

Hardware for Addition andSubtraction

Multiplication z

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

Flowchart for UnsignedBinary Multiplication

Unsigned Binary Multiplication

Multiplying Negative Numbers z

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

Booth’s Algorithm