1. Please search for the following:
• Computer Arithmetic
1. The Arithmetic and Logic Unit
An arithmetic-logic unit is the part of a central processing unit that carries out
arithmetic and logic operations on the operands in computer instruction words.
In some processors, the ALU is divided into two units: an arithmetic unit (AU) and a logic
unit (LU). Some processors contain more than one AU -- for example, one for fixed-point
operations and another for floating-point operations.
In computer systems, floating-point computations are sometimes done by a floating-
point unit (FPU) on a separate chip called a numeric coprocessor.
[1] Hanna, K. T. (2021b, August 9). arithmetic-logic unit (ALU). WhatIs.
https://www.techtarget.com/whatis/definition/arithmetic-logic-unit-ALU
2. Integer Representation
1. Sign-Magnitude Representation
• This is one of the simplest ways to represent integers in binary. In this system:
o Sign bit: The leftmost bit represents the sign, where 0 is for positive numbers, and 1
is for negative numbers.
o Magnitude bits: The remaining bits represent the absolute value (magnitude) of the
number.
Example (8-bit representation):
o +5 in sign-magnitude would be: 00000101
o -5 in sign-magnitude would be: 10000101
2. Twos Complement Representation
• This is the most common way to represent signed integers in binary. It resolves some
problems with sign-magnitude, such as having two representations for zero.
• In this system:
o The leftmost bit still represents the sign (0 for positive, 1 for negative), but negative
numbers are represented by inverting all bits of the positive number and then adding
1.
Example (8-bit representation):