Motorola M68000 User's Guide Page 23

  • Download
  • Add to my manuals
  • Print
  • Page
    / 256
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 22
Mumber 5ystems 9
To convert from hex to binary we merely write the equivalent of each
hex digit in binary. To convert 6E3Cie to binary we would write:
6 e 3 c
0110 1110 0011 1100
and our binary equivalent is IIOIIIOOOIIIIOO2. We can go from binary
to hex in the same manner. IIIIOOOOIOIO2 is F0Ai6.
Arithmetic in Binary and Hexadecimal
We can perform the normal arithmetic operations of addition, sub
traction, multiplication, and division in any number base. Addition and
subtraction are simple if we remember that a carry or borrow may be
required. If the sum of two digits equals or exceeds the number base, a
carry is generated. The value used as the carry or borrow is equal to the
number base. For example, if we add two binary numbers together, we
generate a carry if the sum of the bits in one binary position and a pos
sible carry from the next lowest position is greater than or equal to two.
Adding 11001012 to OIIIIOI2 gives us:
1100101
+ 0111101
10100010
Let’s try adding 72A816 to IF08i6.
72A8
+ 1F08
91B0
Subtraction is only slightly more difficult. If the individual digits
cannot be subtracted from one another, we need to borrow from the
next higher digit position. In other words, if the minuend (top digit) is
less than the subtrahend (bottom digit) we need a borrow. In binary the
value borrowed is always two. This borrow is added to the minuend, the
subtraction is then performed on the two digits. To adjust for the borrow,
just as we had to adjust for a carry, we must add one to the subtrahend
in the next higher digit position. For example, in binary
n i l 1001
- 0110 - 0110
1001 0011
Page view 22
1 2 ... 18 19 20 21 22 23 24 25 26 27 28 ... 255 256

Comments to this Manuals

No comments