eee410_lecture13

# Eee410_lecture13 - EEE 410 Microprocessors I Fall 05/06 Lecture Notes 13 Outline of the Lecture Signed Numbers and Signed Number Operations SIGNED

This preview shows pages 1–2. Sign up to view the full content.

1 EEE 410 – Microprocessors I Fall 05/06 – Lecture Notes # 13 Outline of the Lecture Signed Numbers and Signed Number Operations S IGNED N UMBER A RITHMETIC O PERATIONS ¾ Until now we have seen unsigned numbers where entire 8-bit or 16-bit operand was used for the magnitude. ¾ In order to represent positive and negative numbers signed numbers have been introduced. The representation of signed numbers: The MSB is set aside for the sign (+ or –) and the rest of the bits are used for the magnitude. The sign is represented by 0 for positive (+) numbers and 1 for (–) negative numbers. Signed byte operands: D7 D6 D5 D4 D3 D2 D1 D0 sign If D7=0 the operand is positive If D7=1 it is negative. Positive Numbers: The range of positive numbers that can be represented as a signed byte operand is 0 to +127. Ex: 0 0000 0000 Note: If a positive number is larger than +1 0000 0001 +127, a word-size operand must be +5 0000 0101 used. :: ::::::::::::::: +127 0111 1111 Negative Numbers: For negative signed numbers D7=1, but the magnitude operand is represented in 2’s complement. Although the assembler does the conversion, it is important to understand how the conversion works. To convert to negative number representation (2’s complement) follow the steps: 1. Write the magnitude of the number in 8-bit binary (no sign) 2. Invert each bit 3. Add 1 to it Ex: Show how the computer would represent –5 1. 0000 0101 5 in 8-bit binary 2. 1111 1010 invert each bit 3. 1111 1011 add 1 (hex = FBH) This is the signed number representation of –5 in 2’s complement. Ex: Show how the computer would represent –34H

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 05/26/2011 for the course EEE 410 taught by Professor Hasandemirel during the Spring '10 term at Eastern Mediterranean University.

### Page1 / 4

Eee410_lecture13 - EEE 410 Microprocessors I Fall 05/06 Lecture Notes 13 Outline of the Lecture Signed Numbers and Signed Number Operations SIGNED

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online