Professional Documents
Culture Documents
Lacture 2
Lacture 2
Lacture 2
manalalareqi@su.edu.ye
There is no
end carry.
Signed‐magnitude representation.
• If the binary number is signed, then the leftmost bit
represents the sign and the rest of the bits represent
the number.
• If the binary number is assumed to be unsigned, then
the leftmost bit is the most significant bit of the
number.
• Note that all negative numbers have a 1 in the
leftmost bit position; that is the way we distinguish
them from the positive numbers.
DL, Lecture2 Eng. manal A.al-Areqi
Signed Binary Numbers…………. Cont’
• The binary
combinations 1010
through 1111 are not
used and have no
meaning in BCD.
• It is important to
realize that BCD
numbers are decimal
numbers and not
binary numbers,
although they use bits
in their representation.
DL, Lecture2 Eng. manal A.al-Areqi
Other Binary Codes
Weighted codes
• BCD and the 2421 code.
Ex1,
Ex2, The bit combination 1101, when weighted by the respective digits
2421, gives the decimal equivalent of 2 * 1 + 4 * 1 + 2 * 0 + 1 * 1 = 7.
Assigning both positive and negative weights codes
• The 8, 4, -2, -1 code
Ex3, The bit combination 0110 is calculated from
Unweighted codes 8 * 0 + 4 * 1 + (-2) * 1 + (-1) * 0 = 2.
• Excess‐3,which each coded combination is obtained from the
corresponding binary value plus 3.
Ex4, Decimal 395 is represented in the excess‐3 code as 0110 1100 1000
DL, Lecture2 Eng. manal A.al-Areqi
Gray Code