Unit No 3�Computer Arithmetic
Arithmetic and logic Unit
Different operation as carried out by ALU can be categorized as follows –
Advantages of ALU�
Disadvantages of ALU�
Introduction of arithmetic co-processor:-
What is a coprocessor ?�
How does coprocessor work ?
Coprocessor Architecture�
Properties of Coprocessor :�
Advantages�
Disadvantages�
Applications�
Difference between Processor and Coprocessor�
Processor | Coprocessor |
The processor is the main processing unit in the computer that executes different arithmetic, logic & control operations based on the instructions. | The coprocessor is a special processor that gives support to the main processor.
|
The processor takes care of all the main works
| The coprocessor takes care of some other things only like graphics & arithmetic calculations. |
It handles logical operations & mathematical calculations and generates control signals to other components for synchronizing the tasks. | It performs signal processing, mathematical operations, networking & cryptography based on the type. |
The processor maintains the entire computer’s proper functioning. | This processor helps in increasing the performance of the system and offloads severe tasks from the CPU. |
INTEGER REPRESENTATION
UNSIGNED SIGNED
SIGN MAGNITUDE
Used to represent both positive and negative numbers
There are 3 methods:
UNSIGNED INTEGER –
An unsigned integer is a number that does not have a sign bit, meaning:
It can store only non-negative values (0 and positive numbers)
All bits are used to represent the magnitude (value)
No. of bits | Range |
8 | 0 to 255 |
16 | 0 to 65535 |
Ex: Store 5 bit in 8-bit memory location
Change the given decimal number into binary i.e. 5 = 101
Make it a 8-bit number i.e. 5 = 00000101
SIGN MAGNITUDE REPRESENTATION –
In this representation, the MSB (MOST SIGNIFICANT BIT) is used as a sign bit to indicate the sign of the integer.�The remaining 7 bits represent the magnitude (absolute value).�In the signed magnitude both positive as well as negative values are used.
Ex: For 5 –�In binary form it can be written as +5 = 101
An 8 bit representation is shown as – 00000101�(MSB → sign bit, remaining bits → absolute value)
For -5 –�Binary form of 5 is 101
An 8 bit representation can be shown as – 10000101
+ 1
11110100
What is Floating Point Representation?�
The Floating point representation is a way to the encode numbers in a format that can handle very large and very small values. It is based on scientific notation where numbers are represented as a fraction and an exponent. In computing, this representation allows for trade-off between range and precision.
Format: A floating point number is typically represented as:
Value=Sign × Significand × BaseExponent
where:
Need for Floating Point Representation
The Floating point representation is crucial because:
Number System and Data Representation
Table – Precision Representation
Precision | Base | Sign | Exponent | Significant |
Single precision | 2 | 1 | 8 | 23+1 |
Double precision | 2 | 1 | 11 | 52+1 |
Single Precision Format�
The single precision format has 23 bits for significant (1 represents implied bit, details below), 8 bits for exponent and 1 bit for sign.
For example, the rational number 9÷2 can be converted to single precision float format as following,
9(10) ÷ 2(10) = 4.5(10) = 100.1(2)
�
Double Precision Format�
The double precision format has 52 bits for significant (1 represents implied bit), 11 bits for exponent and 1 bit for sign. All other definitions are same for double precision format, except for the size of various components.
Advantages
Disadvantages
Applications