Computer Organization and Assembly Language: Lecture 5 & 6 Computer Arithmetic Integer Representation, Integer Arithmetic
Computer Organization and Assembly Language: Lecture 5 & 6 Computer Arithmetic Integer Representation, Integer Arithmetic
Computer Organization and Assembly Language: Lecture 5 & 6 Computer Arithmetic Integer Representation, Integer Arithmetic
Lecture 5 & 6
Computer Arithmetic
Integer Representation, Integer Arithmetic
Course Instructor: Engr. Aisha Danish
Arithmetic & Logic Unit
Does the calculations
Everything else in the computer is there to service
this unit
Handles integers
May handle floating point (real) numbers
May be separate FPU (maths co-processor)
May be on chip separate FPU (486DX +)
ALU Inputs and Outputs
Integer Representation
Only have 0 & 1 to represent everything
Positive numbers stored in binary
e.g. 41=00101001
No minus sign
No period
Sign-Magnitude
Two’s compliment
Sign-Magnitude
The simplest form of representation that employs a
sign bit is the sign-magnitude representation
In an n-bit word, the rightmost n-1 bits hold the
magnitude of the integer
+18 = 00010010
-18 = 10010010
Sign-Magnitude
Problems
Need to consider both sign and magnitude in arithmetic
Two representations of zero (+0 and -0)
00001101 Quotient