DOC PREVIEW
UA ECE 274A - Lecture Notes

This preview shows page 1-2-3 out of 10 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 10 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 10 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 10 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 10 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

1ECE 274 - Digital LogicLecture 13 Lecture 13 - Chapter 5.5 to 5.8 Multiplication Other Number Representations ASCII2ECE 274 - Digital Logic Shift Left and Shift Right Operations for Unsigned Numbers Unsigned binary numbers Shift Left Operation (<<) effectively multiplies value by 2 I << 2 = I * 2 Shift Right Operation (>>) effectively divides value by 2 I >> 2 = I / 200012= 11000102= 21001002= 41010002= 81000112= 31001102= 61011002= 12103ECE 274 - Digital LogicShift Left and Shift Right Operations for Signed Numbers What about signed binary numbers? We can use shift left (<<) and shift right (>>) operations, but we must preserve the sign If we shift right, replicate the sign bit in the leftmost bit (sign extend) If we shift left, normal operation of rightmost bits with 0s 0110002= 24100011002= 12100001102= 6100000112= 3101010002= -24101101002= -12101110102= -6101111012= -3104ECE 274 - Digital Logic General Multiplication General Multiplication Start with unsigned numbers How do we perform multiplication by hand?000000next bit in multiplier is 0 (0011), 0110 * 1 = 0110pp30110right most bit in multiplier is 1 (0011), 0110 * 1 = 0110pp101100next bit in multiplier is 1 (0011), 0110 * 1 = 0110pp2each row is a partial product01100011multiplicandmultiplierxx0000000next bit in multiplier is 0 (0011), 0110 * 1 = 0110pp4++productproduct is the sum of all partial products00100105ECE 274 - Digital Logic General Multiplication Another Example Notice that product is 8-bits Notice that multiplying multiplicand by 1/0 is same as ANDing with 1/0111010111110111000000001110000(14)(11)(154)x+10011010111011110AND6ECE 274 - Digital Logic General Multiplication Generalized representation of multiplication by hand7ECE 274 - Digital LogicMultiplier – Array Style Array Style Multiplier design Array of AND gatesABP*Block symbola0a1a2a3b0b1b2b3pp1pp2pp3pp4p7..p0+ (5-bit)+ (6-bit)+ (7-bit)0000000008ECE 274 - Digital Logic Multiplying Signed Numbers Multiplication of signed numbers Scenario 1: (+A) * (+B)to represent the +14 and +11, we need an extra bitpartial products computed the samenew partial product larger by 1 bit (avoid possible overflow)011100101100011100011100(+14)(+11)(+154)x0010011010++++001010100001010100010011010000000000011100000000000000multiplicandmultiplierxproductSigned Binary (5-bits) = 01110Unsigned Binary = 1110Decimal Value = 14Signed Binary (6-bits) = 001110Signed Binary (7-bits) = 0001110Using sign extension we replicate sign bit into leftmost bits9ECE 274 - Digital Logic Multiplying Signed Numbers Multiplication of signed numbers Scenario 1: (+A) * (+B) Scenario 2: (-A) * (+B)multiplicandmultiplierxproductpartial products computed the samenew partial product larger by 1 bit (avoid possible overflow)100100101111100101100100(-14)(+11)(-154)x1101100110++++110101101110101001101100000000000001100100000000000000Signed Binary (5-bits) = 10010Unsigned Binary = n/aDecimal Value = -14Signed Binary (6-bits) = 110010Signed Binary (7-bits) = 1110010Using sign extension we replicate sign bit into leftmost bitsto represent the -14 and +11, we need an extra bit10ECE 274 - Digital Logic Multiplying Signed Numbers Multiplication of signed numbers Scenario 1: (+A) * (+B) Scenario 2: (-A) * (+B)  Scenario 3: (+A) * (-B) Scenario 4: (-A) * (-B)multiplicandmultiplierxproductConvert each term into it’s two’s complementScenario 3: (-A) * (+B)Scenario 4: (+A) * (+B)Won’t change result, back to scenario 1 & 211ECE 274 - Digital Logic Fixed Point Number Representation Fixed point number consists of a integer and fraction part Position of radix (decimal point) is assumed to be fixed234.56 = (2 * 102) + (3 * 101) + (4 * 100) + (5 * 10-1) + (6 * 10-2)= (2 * 100) + (3 * 10) + (4 * 1) + (5 * 1/10) + (6 * 1/100)234.561021011005610-110-242312ECE 274 - Digital Logic Fixed Point Number Representation of Binary Numbers Fixed point number for binary is similar100.11 = (1 * 22) + (0 * 21) + (0 * 20) + (1 * 2-1) + (1 * 2-2)= (1 * 4) + (0 * 2) + (0 * 1) + (1 * 1/2) + (1 * 1/4)= 4.7510100.11222120112-12-201013ECE 274 - Digital Logic Converting Fixed Point Decimals to Binary Decimal to binary conversion Integer portion remains same Fractional portion can be converted using multiply method 2.6521202-12-22-32-410.65 * 2 = 1.30Integer value placed in 2-1position, next consider fractional part00.30 * 2 = 0.60Integer value placed in 2-2position , next consider fractional part10.60 * 2 = 1.20Integer value placed in 2-3position , next consider fractional part00.20 * 2 = 0.40Integer value placed in 2-4position , next consider fractional part01same as before2-52-600.40 * 2 = 0.80Integer value placed in 2-5position, next consider fraction part10.80 * 2 = 1.60Integer value placed in 2-6position, only have 6-bits to represent fractional part so we are done14ECE 274 - Digital Logic Converting Fixed Point Decimals to Binary Did it work?10.101001 = (0 * 21) + (1 * 20) + (0 * 2-1) + (1 * 2-2) + (1 * 2-3) + (0 * 2-4) + (1 * 2-5) + (1 * 2-6) 2.652120102-12-2012-32-4102-502-61= (1 * 2) + (0 * 1) + (1 * 1/2) + (1 * 1/4) + (1 * 1/8) + (0 * 1/16) + (1 * 1/32) + (1 * 1/64)= 2 + 0.5 + 0.125 + 0.0156 = 2.640610not the most accurate way to store numbers15ECE 274 - Digital Logic Floating Point Number Representation Floating Point Numbers234.56 = (2 * 102) + (3 * 101) + (4 * 100) + (5 * 10-1) + (6 * 10-2)= (2 * 100) + (3 * 10) + (4 * 1) + (5 * 1/10) + (6 * 1/100)234.56 * 10431021011005610-110-2423ExponentMantissaRadixMantissa indicates significant numbers – we know how to represent thisRadix + exponent indicates where/how much to move the decimal16ECE 274 - Digital Logic Single Precision/Double Precision Float Point Number Standard Floating point binary numbers IEEE (Institute of Electrical and Electronics Engineers) has produced a standard Single precision (32 bit) floating point numbers Double precision (64 bit) floating point numbers32-bitsSign bit0 denotes “+”1 denotes “-”8-bit exponentexcess – 127 format (radix =2)23-bit mantissa234.56 * 1043ExponentMantissaRadixS E M17ECE 274 - Digital Logic Single Precision Floating Point Number - Exponent Exponent is in excess-127 format (or “biased with 127”) E = actual value + 127 Makes manipulating numbers easier Reserved values E = 0 (0000 0000) indicates exact zero E = 255 (1111 1111) indicates infinity Normal range of E


View Full Document

UA ECE 274A - Lecture Notes

Download Lecture Notes
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lecture Notes and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture Notes 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?