Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computer Organization and Architecture Tutorial 6 Kenneth Lee.

Similar presentations


Presentation on theme: "Computer Organization and Architecture Tutorial 6 Kenneth Lee."— Presentation transcript:

1 Computer Organization and Architecture Tutorial 6 Kenneth Lee

2

3 For example: 2 bits 2s complement: bits 2s complement: Addition of two 2-bit 2s complements generate a 2-bit result Means 3+1=4 or -1+1=0 Multiplication of two 2-bit in 2s complements generate a 4-bit result 11 X In unsigned integer, it means 3x1=3; but in 2s complement, it means (-1)x(+1)=+3. It is due to the unsigned integer and 2s complement have different extension pattern 11 X

4

5 Biased representation example: 4-bit biased representation: 4-bit binary unsigned integer is from 0000 (0) ~ 1111 (15) Bias = 2 k-1 – 1 = 2 3 – 1 = 7 4-bit biased representation is from (0 – 7) ~ (15 – 7) The smallest is 0000 and the largest is 1111 The same with unsigned integer

6 Examples: Positive overflow ( …+ 2 -n = 1-2 -n )

7 Examples: Exponent overflow For 4-bit exponent in biased representation, the range is -7 ~ +8, so the largest exponent is +8 Examples: significant overflow = 1.00

8 a.e is in 0~X with bias q, so the exponent is in –q~X-q the largest positive significant is 1-b -p (e.g. if b is 2 and significant is 3 digits, the largest positive is (0.111) 2 ; if b is 10 and significant is 3 digits, the largest positive is (0.999) 10 ) so the largest positive value is (1-b -p )x(b X-q ) the smallest positive significant is b -p (e.g. if b is 2 and significant is 3 digits, the largest positive is (0.001) 2 ; if b is 10 and significant is 3 digits, the largest positive is (0.001) 10 ) so the smallest positive value is b -p x(b -q ) b. For the normalized floating-point numbers, the difference with above is that the first bit can not be 0, so the largest value will keep the same. But the smallest positive value will be b -1 (e.g. if b is 2 and significant is 3 digits, the largest positive is (0.1) 2 ; if b is 10 and significant is 3 digits, the largest positive is (0.1) 10 ) so the smallest positive significant is b -1 x(b -q )

9 c. Minus means the sign is 1 (-1.5) 10 = (-1.1) 2 x2 0 so E is 0 and its biased representation is ( ) (0.5) 10 = (0.1) 2 so the significant is d. 384 = = 1.1x2 8 = 1.1x So E is 8 and its biased representation is = 135 = The significant is 0.1 and represented as e. 1/16 = (0.0001) 2 = 1.0x2 -4 So E is -4 and its biased representation is =123= The significant is 0.0 and represented as f.Minus means the sign is 1 1/32 = = 1.0x2 -5 So E is -5 and its biased representation is =122= The significant is 0.0 and represented as

10 signBiased exponentFraction (Significant) 1 bit 11 bits 52 bits The exponent value is in 1~2046 (0 and 2047 are kept for special use) The bias is 1023 so the biased exponent is in -1022~+1023 So the largest positive is ( )x2 1023, the smallest positive is

11

12 9.27 Show how the following additions are performed. a x x 10 2 b x x 10 -2

13 9.27 Show how the following additions are performed. a x x b x – x 10 -1

14

15 B.1 Construct a truth table for following expressions:

16

17 B.2 simplify the following expressions according to the commutative law Commutative law: A+B = B+A; AB = BA

18 B.4 Apply DeMorgen’s theorem

19 B.4 Simplify the following expressions

20 B.5 Construct the operation XOR from Boolean AND, OR, and NOT ABXOR

21 B.6 Given a NOR gate and NOT gates, draw a three input AND function

22 B.7 Write the Boolean expression for a four-input NAND gate


Download ppt "Computer Organization and Architecture Tutorial 6 Kenneth Lee."

Similar presentations


Ads by Google