0% found this document useful (0 votes)
14 views3 pages

Syl 4

Uploaded by

Kamarul Ariffin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views3 pages

Syl 4

Uploaded by

Kamarul Ariffin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Computer Arithmetic

Overview

This teaching note covers the fundamentals of computer arithmetic, focusing on how numbers
are represented and manipulated in digital systems. Topics include number representation,
hardware for addition and subtraction, multiplication, floating-point arithmetic, and division.
The goal is to provide students with a comprehensive understanding of how arithmetic
operations are performed in computers and the underlying hardware mechanisms.

Objectives

1. Understand Number Representation: Learn how numbers are represented in different


formats in computer systems.
2. Explore Addition and Subtraction Hardware: Understand the hardware mechanisms for
performing addition and subtraction.
3. Learn About Multiplication: Study the algorithms and hardware used for multiplication.
4. Understand Floating-Point Arithmetic: Explore how real numbers are represented and
processed using floating-point arithmetic.
5. Study Division: Learn the methods and hardware used for performing division
operations.

1. Number Representation

 Binary Representation:
o Binary Numbers: Use base-2 notation (0s and 1s) to represent numbers.
o Sign-Magnitude Representation: A method where the most significant bit
represents the sign of the number (0 for positive, 1 for negative) and the
remaining bits represent the magnitude.
 Two's Complement Representation:
o Definition: A method for representing signed integers where negative numbers
are represented by inverting the bits of the positive number and adding 1.
o Advantages: Simplifies arithmetic operations and avoids separate handling for
positive and negative numbers.
 Fixed-Point Representation:
o Definition: Represents numbers with a fixed number of digits after the decimal
point.
o Applications: Used in systems where precision is required but a floating-point
representation is unnecessary.
 Floating-Point Representation:
o IEEE 754 Standard: Standard format for representing real numbers, consisting of
a sign bit, exponent, and mantissa (or significand).
o Normalization: Ensures the most significant digit of the mantissa is non-zero,
optimizing precision.

2. Addition and Subtraction Hardware

 Binary Addition:
o Half Adder: A circuit that adds two single-bit numbers and provides a sum and a
carry-out.
o Full Adder: A circuit that adds three bits (two significant bits and a carry-in) and
provides a sum and a carry-out.
o Ripple Carry Adder: A series of full adders connected to add multi-bit numbers,
with carry propagation from one stage to the next.
 Binary Subtraction:
o Subtraction by Addition: Uses two's complement representation for subtraction
(i.e., add the minuend and the two's complement of the subtrahend).
o Borrowing Mechanism: Handles borrowing in multi-bit subtraction similar to
carrying in addition.
 Circuit Design:
o Adder-Subtractor Circuits: Circuits that can perform both addition and
subtraction, typically using a control signal to select the operation.

3. Multiplication

 Binary Multiplication:
o Shift and Add Algorithm: A method for multiplying binary numbers by shifting
and adding partial products.
o Booth’s Algorithm: An efficient multiplication algorithm that handles both
positive and negative operands.
 Hardware Implementation:
o Multipliers: Dedicated hardware components for performing binary
multiplication, often using arrays of adders and shift registers.
o Array Multiplier: A circuit that uses a grid of adders to perform multiplication in
parallel, improving speed.
4. Floating-Point Arithmetic

 Representation:
o Sign Bit: Indicates the sign of the number.
o Exponent: Encodes the magnitude of the number’s scale.
o Mantissa (Significand): Represents the significant digits of the number.
 Normalization:
o Process: Adjust the exponent and mantissa so that the mantissa is within a
specified range (typically between 1 and 2 for binary floating-point).
 Arithmetic Operations:
o Addition and Subtraction: Align exponents, perform addition or subtraction on
mantissas, and normalize the result.
o Multiplication: Multiply mantissas and add exponents, then normalize the result.
o Division: Divide mantissas and subtract exponents, then normalize the result.
 Precision and Rounding:
o Precision: The number of significant digits in the floating-point representation.
o Rounding: Techniques used to handle cases where results cannot be exactly
represented (e.g., round to nearest, truncate).

5. Division

 Binary Division:
o Restoring Division Algorithm: A method that restores the remainder after each
subtraction step and shifts the quotient.
o Non-Restoring Division Algorithm: An optimized version that does not restore
the remainder, improving efficiency.
 Hardware Implementation:
o Divider Circuits: Specialized hardware that performs binary division, often using
a combination of subtraction and shifting.
 Division in Floating-Point Arithmetic:
o Process: Similar to integer division but with additional considerations for aligning
exponents and handling normalization.

You might also like