The PC uses 2’s complement representation. [See
's_complement
]
Forming complements are useful for subtraction without borrowing from another
column and is preferred in computer computation.
Subtraction can be then done by a computer as addition.
Assuming the left most bit is the sign bit (0 = positive and 1 = negative)
1's complement of 0100 0111 is found by subtracting each digit by 1
= 1011 1000
or (
Change all 1's to 0's and all 0's to 1's
)
2's complement of 1100 0111 is found by subtracting it from 1 0000 0000
= 1011 1001 or (
1's complement adds one
)
Advantages of 2's complements:
1.
1's complements would have two zeros:
0000 0000 1111 1111
while
2's complements has only one.
2.
2' complement numbers can be moved to larger word size more easily.
(Just copy the sign bit to all the bits in the left.
Floating Point Representation
How about larger numbers? We will occasionally need to represent much larger numbers
in the computer.
We could use even longer bit-strings.
2
64
= 1.8446744
10
19
.
This form is called (normalized) scientific notation.
We give an exponent and a single digital with fraction before the decimal point.
For example, 93.4 = 9.34
10
1
.
.0000000732 = 7.32
10
-8
.
This method enables us to write very large or small numbers easily in a standard
format.
Usually we limit the number of digits we use for the number.
We lose some accuracy (or “precision”).

CIS 190 -
Systems Hardware Concepts
Course notes on Representing Data in Memory
University of the Fraser Valley
Page
9 of
12
We do at least get to approximate very large numbers.
In the computer we can use a bit string to represent very large or small numbers in
this manner.
We call it floating point notation.
We usually give an integer exponent, and a fractional part with no leading zeros.
123.456 would become .123456
10
3
.
We could use a 32-bit string then to represent either
Non-negative integers from 0 to 4,294,967,295, or
Positive and negative integers
from -2,147,483,648 to + 2,147,483,647, or
Floating point numbers.
The 32-bit string only has meaning when we know how to interpret it.
Why should we know these things?
We need to be familiar with binary and hex numbers in order to examine
implementation details.
It helps to know how a computer stores data.
We now know what sort of information might be transmitted across
communication lines.
We can now be concerned with the meaning of the information being successfully
passed, rather than its representation.
For example, imagine communication between two computers that use different ways of
representing characters and numbers.
Computer A sends ASCII characters and 2’s complement numbers to computer B,
which uses EBCDIC and 1’s complement numbers.
The communication has failed to pass the meaning of the data, instead passing
only a particular representation of the data.