EasyManua.ls Logo

Atari XL - Page 240

Atari XL
262 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
228
The
Atari
XL
Handbook
01101001
+00010011
01111100
In
the
case
of
binary
addition
we
generate
a
carry
when
adding
1 to 1
(in
columns
1
and
2
in
our
example).
NEGATIVE
BINARY
NUMBERS
You
might
have
wondered
how
the
computer
can
recognise
negative
numbers,
since
it
can
only
tell
the
difference
between
on
and
off.
This
is
achieved
by
a
method
known
as
'two's
complement'
notation,
which
uses
one
bit
of
the
binary
number
(the
most
significant
bit,
often
labelled
bit
7)
as
a
sign
bit.
To
subtract
two
numbers
in
binary,
we form
the
two's
complement
of
the
number
to be
subtracted,
then
add
it
to
the
other
number.
As
an
example
we'll
subtract
50 from
100:
100
01100100
-50
00110010
50
00110010
(the
answer
we
want).
To
perform
the
sum
in
binary,
first
we
find
the
two's
complement
of
50,
by
changing
all
the
Osto
Is
and
all
the
Is
to Os,
then
adding
1.
50
in
binary
is:
Change
Is
to
Os:
Adding
1
gives
its
two's
complement:
00110010
11001101
11001110
Now
add
this
to
the
binary
for 100: