This preview shows pages 1–9. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: Microcomputer Systems 1 Implementation Considerations Data Representations & Arithmetic FixedPoint Numbers and Arithmetic February 11, 2012 Veton Kpuska 3 FixedPoint There are several different binary number systems. Most notable: 1. Sign Magnitude 2. Ones Complement 3. Twos Complement Example of 4bit signed numbers in three different formats February 11, 2012 Veton Kpuska 4 Binary Representations of 4bit Signed Numbers Decimal Value Sign Magnitude Ones Complement Twos Complement +7 111 111 111 +6 110 110 110 +5 101 101 101 +4 100 100 100 +3 011 011 011 +2 010 010 010 +1 001 001 001 +0 000 000 0000 1 000 1 1111 1 001 1 110 1 1112 1 010 1 101 1 1103 1 011 1 100 1 1014 1 100 1 011 1 1005 1 101 1 010 1 0116 1 110 1 001 1 0107 1 111 1 000 1 0018 1 000 February 11, 2012 Veton Kpuska 5 FixedPoint Representations Integers vs. Fractional Numbers Representations Notation: Qm.n Format: m Number of bits to the left of the radix point n number of bits to the right of the radix point Let N total number of bits N=m+n+1 Signed, and Nbit signed number in Qm.n format with MSB as sign bit (b N1 ) N=m+n Unsigned February 11, 2012 Veton Kpuska 6 Examples Q16.0 Format is Full unsigned integer number representation Q15.0 Format is Full signed integer number representation Q15.1 Format represents unsigned 16 bit integer value Q14.1 Format represents signed 15 bit integer value Q0.16 (or Q.16 or simply Q16) is a 16 bit format that for unsigned number that uses 16 bits for the fractional value. Q0.15(or Q.15 or simply Q15) is a 15 bit format that for signed number that uses 16 bits for the fractional value. Fractional Representations (e.g., Q1.15) have the advantage over the Full format representations that results of the multiplication are always smaller than either of the numbers QX.0 or QY.1 Formats must check for overflow and handle it Q0.X or Q1.Y Formats may lead to underflow but no special handling is required. February 11, 2012 Veton Kpuska 7 FixedPoint Representations Integers vs. Fractional Numbers Representations Numbers represented as 16/32 bits: 2 16 =65,536 or 2 32 =4,294,967,296 bit patterns. 1. Unsigned Integer Format Stored Value: 16bit: 0..65,536 or 32bit: 0..4,294,967,296 1. Signed Integer Format Stored Value: 16bit: 32,768..32,767 or 32bit: 2,147,483,648..2,147,483647 1. Unsigned Fractional Format Stored Value: 16bit: 0..1 (65,536 levels) or 32bit: 0..1 (4,294,967,296 levels) 1. Signed Fractional Format Stored Value: 16bit: 1..1 (65,536 levels) or 32bit: 1..1 (4,294,967,296 levels) February 11, 2012 Veton Kpuska...
View Full
Document
 Spring '11
 Staff

Click to edit the document details