NORTH CAROLINA STATE UNIVERSITY
DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING
ECE 212 FUNDAMENTALS OF LOGIC DESIGN
Representation of Negative NumbersWe will present three systems used for representing negative integers. They are:
We will use 4-bit numbers to illustrate these systems, however, the student should be able to represent n-bit numbers using any of these systems.
In all three systems, the leftmost bit is the sign bit.
If the sign bit is 0, then the number is positive.
If the sign bit is 1, then the number is negative.
The leftmost bit is the sign and the remaining bits are the magnitude
of the number.
Subtraction is simply addition of negative numbers, therfore, we
need only discuss addition in detail.
Case 1: The sign of the two operands is the same.
Simply add the two magnitudes and the sign of the result is the sign
of the two operands.
Examples:
Subtract the number with smaller magnitude number from the one with larger magnitude.
The sign of the result is the sign of the number with the larger magnitude.
Examples:
Observation: Any adder circuit for sign and magnitude numbers must include
a subtractor and a comparator.
Positive numbers are the same as in sign and magnitude representation.
For 4-bit numbers, -2 = = 1101.
Subtraction is simply addition of negative numbers, therfore, we
need only discuss addition in detail.
Case 1: The sign of the two operands is the same.
Simply add the numbers.
Examples:
Simply add the numbers.
Examples:
Observation: Subtraction in one's complement requires an adder
and circuitry that adds one when there is a carry.
(End around carry condition.)
Positive numbers are the same as in sign and magnitude representation.
For 4-bit numbers, -2 = = 1110.
Subtraction is simply addition of negative numbers, therfore, we
need only discuss addition in detail.
Case 1: The sign of the two operands is the same.
Simply add the numbers.
Examples:
Simply add the numbers.
Examples:
Observation: Subtraction in two's complement requires an adder only.
Overflow occurs during addition of two numbers when the sign of the two operands
is the same and the sign of the result is different.
Case 1: If we add two positive numbers and get a negative result, overflow has occurred.
Examples (Two's complement):
Sign and Magnitude (Signed Magnitude)
Addition and Subtraction using Sign and Magnitude numbers.
Case 2: The sign of the two operands is different.
One's Complement
Negative numbers are the bitwise complement of the positive number.
Considering 4-bit binary numbers,
Considering 4-bit binary numbers,
Considering 4-bit binary numbers,
Considering n-bit binary numbers,
Addition and Subtraction using One's Complement numbers.
If there is a carry, then add one to the result.
(End around carry condition.)
Case 2: The sign of the two operands is different.
If there is a carry, then add one to the result.
(End around carry condition.)
Two's Complement
Negative numbers are the bitwise complement of the positive number + 1.
Considering 4-bit binary numbers,
Considering 4-bit binary numbers,
Considering 4-bit binary numbers,
Considering n-bit binary numbers,
Addition and Subtraction using Two's Complement numbers.
Ignore the carry out!!.
Case 2: The sign of the two operands is different.
Ignore the carry out.
Case 2: If we add two negative numbers and get a positive result, overflow has occurred.

Christopher Cornelius Doss
Tue Nov 11 23:23:59 EST 1997