Baixe o app para aproveitar ainda mais
Prévia do material em texto
Exemplo 1. Represente os números neste sistema F(10,3,2,2)? Solução: 𝛽 = 10 (𝑏𝑎𝑠𝑒) 𝑡 = 3 𝑑𝑖𝑔𝑖𝑡𝑜𝑠 𝑑𝑎 𝑚𝑎𝑛𝑡𝑖𝑠𝑠𝑎 −2 ≤ 𝑒 ≤ 2; [−2,−1,0,1,2] ± 𝟎. 𝒅𝟏 𝒅𝟐 𝒅𝟑 ∙ 𝜷𝒆 x1 = 7495.83 = 0.749583 ∙ 104 (overflow) (obs. a virgula andou 4 casas decimas da direita para esquerda.) Arredondamento: 0.750 ∙ 104 Truncamento: 0.749 ∙ 104 x2 = − 0.0003 = − 0.300 ∙ 10−3 (underflow) (obs. a virgula andou 3 casas decimas da esquerda para direita.) 1. Considere o sistema F(10, 4, 4, 4). Represente neste sistema os números. x1 = 4321.24 x2 = − 0.0013523 x3 = 125.64 x4 = 57481.23 x5 = 0.00034 Solução: 𝛽 = 10; 𝑡 = 4 (𝑑𝑖𝑔𝑖𝑡𝑜𝑠 𝑑𝑎 𝑚𝑎𝑛𝑡𝑖𝑠𝑠𝑎); −4 ≤ 𝑒 ≤ 4 ± 0. 𝑑1 𝑑2 𝑑3 𝑑4 ∙ 𝛽𝑒 , sendo: 𝑑1 ≠ 0 x1 = 0.432124 ∙ 104 ⇒ x1 = 0.4321 ∙ 104 x2 = − 0.13523 ∙ 10−2 ⇒ x2 = − 0.1352 ∙ 10−2 x3 = 0.12564 ∙ 103 ⇒ x3 = 0.1256 ∙ 103 x4 = 0.5748123 ∙ 105 (overflow) x5 = 0.3400 ∙ 10−3 Obs.: o numero de x4 = 0,5748123 ∙ 105 , não pode ser representado no sistema, pois o expoente é maior que 4, causando overflow) 2. F(10,3,1,3). Represente neste sistema os números do exercício 1. Solução: 𝛽 = 10; 𝑡 = 3 (𝑑𝑖𝑔𝑖𝑡𝑜𝑠 𝑑𝑎 𝑚𝑎𝑛𝑡𝑖𝑠𝑠𝑎); −1 ≤ 𝑒 ≤ 3 ± 0. 𝑑1 𝑑2 𝑑3 ∙ 𝛽𝑒 , sendo: 𝑑1 ≠ 0 x1 = 0.432124 ∙ 104 ⇒ x1 = 0.432 ∙ 104 (overflow) x2 = − 0.13523 ∙ 10−2 ⇒ x2 = − 0.135 ∙ 10−2 (underflow) x3 = 0.12564 ∙ 103 ⇒ x3 = 0.125 ∙ 103 x4 = 0.5748123 ∙ 105 (overflow) x5 = 0.340 ∙ 10−3 (underflow) 3. F(10,4,3,4). Represente neste sistema os números. Caso não tenha representação exata fazer o devido arredondamento: Solução: 𝛽 = 10; 𝑡 = 3 (𝑑𝑖𝑔𝑖𝑡𝑜𝑠 𝑑𝑎 𝑚𝑎𝑛𝑡𝑖𝑠𝑠𝑎); −3 ≤ 𝑒 ≤ 4 ± 0. 𝑑1 𝑑2 𝑑3 𝑑4 ∙ 𝛽𝑒 , sendo: 𝑑1 ≠ 0 x1 = 1234.56 ⇒ 0.1234𝟓𝟔 ∙ 104 ⇒ x1 = 0.1235 ∙ 104 x2 = − 0.00054962 ⇒ −0.5496𝟐 ∙ 10−3 ⇒ x2 = − 0.5496 ∙ 10−3 x3 = 0.9995 ⇒ 0.9995 ∙ 100 x4 = 123456.7 ⇒ 0.1234𝟓𝟔𝟕 ∙ 106 ⇒ 0.1235 ∙ 106(overflow) x5 = −0.0000001 ⇒ −0.1000 ∙ 10−6 (underflow) 4. F(2,10,8,8). Represente os números abaixo, no sistema de ponto flutuante. Caso o n ⁰ não tenha representação exata fazer o devido arredondamento: Solução: a) 34(10) → (2) : 100010(2) b) 43(10) → (2) : 101011(2) = 0.1000100000 ∙ 26 = 0.1010110000 ∙ 26 c) 29.2 (10) → (2) : 11101.00110...(2) d) 54(10) → (2) : 110110(2) = 0.1110100110... ∙ 25 = 0.1101100000 ∙ 26 29 + 0.2 0.2 x 2 = 0.4 0.4 x 2 = 0.8 0.8 x 2 = 𝟏.6 0.6 x 2 = 𝟏.2 0.2 x 2 = 0.4 ⋮ ⋮ e) 44.25(10) → (2) : 101100.010(2) f) 23.0625(10) → (2) : 10111.00010(2) = 0.1011000100 ∙ 26 = 0.1011100010 ∙ 25 44 + 0.25 23 + 0.0625 0.25 x 2 = 0.5 0.0625 x 2 = 0.125 0.5 x 2 = 𝟏.0 0.125 x 2 = 0.25 0.0 x 2 = 𝟎.0 0.25 x 2 = 0.5 0.5 x 2 = 1.0 0.0 x 2 = 0.0 e) 6.325(10) → (2) : 110.0101001...(2) = 0.1100101001... ∙ 23 6 + 0.325 0.325 x 2 = 0.65 0.65 x 2 = 𝟏.3 0.3 x 2 = 𝟎.6 0.6 x 2 = 1.2 0.2 x 2 = 0.4 0.4 x 2 = 0.8 0.8 x 2 = 1.6 ⋮ ⋮ 5. F(10,10,6,6) Representar os números, em base binária, no sistema de ponto flutuante. Arredondar, se necessário: Solução: a) 11011 (2): 1 ∙ 24 + 1 ∙ 23 + 0 ∙ 22 + 1 ∙ 21 + 1 ∙ 20 = 16 + 8 + 2 + 1 = 𝟐𝟕(10) = 𝟎. 𝟐𝟕𝟎𝟎𝟎𝟎𝟎𝟎𝟎𝟎 ∙ 𝟏𝟎𝟐 b) 11111.000111(2): 1 ∙ 24 + 1 ∙ 23 +1 ∙ 22 1 ∙ 21 + 1 ∙ 20= 16 + 8 + 4 + 2 + 1 = 28 + 3 = 𝟑𝟏 0 ∙ 1 21 + 0 ∙ 1 22 + 0 ∙ 1 23 + 1 ∙ 1 24 + 1 ∙ 1 25 + 1 ∙ 1 26 = 1 16 + 1 32 + 1 64 = 4 + 2 + 1 64 = 7 64 = 𝟎. 𝟏𝟎𝟗𝟑𝟕𝟓 = 31.109375(10) = 0.3110937500 ∙ 𝟏𝟎𝟐 Cont. 5) c) 0.00001101(2): = 0 ∙ 1 21 + 0 ∙ 1 22 + 0 ∙ 1 23 + 0 ∙ 1 24 + 1 ∙ 1 25 + 1 ∙ 1 26 + 0 ∙ 1 27 + 1 ∙ 1 28 = 1 32 + 1 64 + 1 256 = 8+4+1 256 = 13 256 = 𝟎. 𝟎𝟓𝟎𝟕𝟖𝟏𝟐𝟓(10) ⇒ 𝟎. 𝟓𝟎𝟕𝟖𝟏𝟐𝟓𝟎𝟎𝟎 ∙ 𝟏𝟎−𝟏 d) -11000.001(2) : = 1 ∙ 24 + 1 ∙ 23 + 0 ∙ 22 + 0 ∙ 21 + 0 ∙ 20= 16 + 8 = 𝟐𝟒 = 0 ∙ 1 21 + 0 ∙ 1 22 + 1 ∙ 1 23 = 1 8 = 𝟎. 𝟏𝟐𝟓 ⇒ −𝟐𝟒. 𝟏𝟐𝟓 (10) = −𝟎. 𝟐𝟒𝟏𝟐𝟓𝟎𝟎𝟎𝟎𝟎 ∙ 𝟏𝟎𝟐 e) -0.011001(2): = 0 ∙ 1 21 + 1 ∙ 1 22 + 1 ∙ 1 23 + 0 ∙ 1 24 + 0 ∙ 1 25 + 1 ∙ 1 26 = 1 4 + 1 8 + 1 64 = = 16+8+1 64 = 25 64 = −𝟎. 𝟑𝟗𝟎𝟔𝟐𝟓(10) ⇒ −𝟎. 𝟑𝟗𝟎𝟔𝟐𝟓𝟎𝟎𝟎𝟎 ∙ 𝟏𝟎𝟎 6) x1 = 33 (4) → (5): x2 = 0.132 (4) → (5): = 3 ∙ 41 + 3 ∙ 40 = 12 + 3 = 𝟏𝟓 (10) = 1 ∙ 1 41 + 3 ∙ 1 42 + 2 ∙ 1 43 = = 1 4 + 3 16 + 1 32 = 8+6+1 32 = 15 32 = = 𝟎. 𝟒𝟔𝟖𝟕𝟓(10) = 0.46875 𝑥 5 = 2.34375 = 0.34375 𝑥 5 = 1.71875 = 0.71875 𝑥 5 = 3.59375 = 0.59375 𝑥 5 = 2.96875 = 0.926875 𝑥 5 = 4.84375 ⋮ ⋮ 33(4) = 15(10) = 30(5) = 𝟎. 𝟐𝟏𝟑𝟐𝟒… (5) Cont. 6) x3 = 32.013 (4) → (5): = 3 ∙ 41 + 2 ∙ 40 = 12 + 2 = 𝟏𝟒 = 0 ∙ 1 41 + 1 ∙ 1 42 + 3 ∙ 1 43 = 1 16 + 3 64 = 4+3 64 = 7 64 = 𝟎. 𝟏𝟎𝟗𝟑𝟕𝟓 = 14.109375(10) = 24. 02331… (5) = 0.109375 𝑥 5 = 0.546875 = 0.546875 𝑥 5 = 2.734375= 0.734375 𝑥 5 = 3.671875 = 0.671875 𝑥 5 = 3.359375 = 0.359375 𝑥 5 = 1.796875 ⋮ ⋮ = 𝟐𝟒. 𝟎𝟐𝟑𝟑𝟏… (5) 7) F (2,7,4,4). Qual representa melhor 2.8(10) : 2 + 0.8 (10) x1 = 0.1011001 ∙ 22 x2 = 0.1011010 ∙ 22 = 0.8 𝑥 2 = 𝟏. 6 = 0.6 𝑥 2 = 𝟏. 2 = 0.2 𝑥 2 = 𝟎. 4 = 0.4 𝑥 2 = 𝟎. 8 = 0.8 𝑥 2 = 𝟏. 6 = 0.6 𝑥 2 = 𝟏. 2 ⋮ ⋮ = 𝟏𝟎. 𝟏𝟏𝟎𝟎𝟏𝟏… (2) = 𝟎. 𝟏𝟎𝟏𝟏𝟎𝟎𝟏… ∙ 𝟐𝟐 x1 representa melhor o 2.8(10) = 0.1011001 ∙ 22 Para x2: 𝐸𝑅 = 0.1011001 ∙ 22 − 0.1011010 ∙ 22 0.1011010 ∙ 22 = 𝟎. 𝟎𝟎𝟎𝟎𝟎𝟖𝟗𝟎𝟏 𝐸𝑃 = 𝐸𝑅 𝑥 100 ⇒ 𝑬𝑷 = 𝟎. 𝟎𝟎𝟎𝟖𝟗𝟎𝟏 % 8) F(3,3,1,2). Exiba todos os números representáveis nesse sistema: Solução: ± (0. 𝑑1 𝑑2 𝑑3) ∙ 𝛽𝑒 𝛽 = [0,1,2] Sinal d1 d2 d3 expoente zero 2 x 2 x 3 x 3 x 4 + 1 = 144 + 1 = 145 9) F( 2,10,10,10): Existem algum com representação exata: 𝑥1 = 13.44 (5) = 8.96(10) = 1 ∙ 51 + 3 ∙ 50 = 5 + 3 = 𝟖 = 4 ∙ 1 51 + 4 ∙ 1 52 = 4 5 + 4 25 = 20+4 64 = 24 25 = 𝟎. 𝟗𝟔 = 0.96 𝑥 2 = 1.92 = 0.92 𝑥 2 = 1.84 = 0.84 𝑥 2 = 1.68 = 0.68 𝑥 2 = 1.36 = 0.36 𝑥 2 = 0.72 = 0.72 𝑥 2 = 1.44 ⋮ ⋮ = 𝟏𝟎𝟎𝟎. 𝟏𝟏𝟏𝟏𝟎𝟏… (2) = 𝟎. 𝟏𝟎𝟎𝟎𝟏𝟏𝟏𝟏𝟎𝟏… ∙ 𝟐𝟒 Cont. a) não tem representação exata no sistema em questão. b) 122.35(6) : 50.638888888(10) = 1 ∙ 62 + 2 ∙ 61 + 2 ∙ 60 = 36 + 12 + 2 = 𝟓𝟎 = 3 ∙ 1 61 + 5 ∙ 1 62 = 3 6 + 5 36 = 18+5 36 = 23 36 = 𝟎. 𝟔𝟑𝟖𝟖𝟖𝟖𝟖𝟖𝟖 não tem representação exata no sistema em questão. = 0.638888888 𝑥 2 = 𝟏. 277777776 = 0.277777776 𝑥 2 = 𝟎. 555555552 = 0.555555552 𝑥 2 = 𝟏. 111111104 = 0.111111104 𝑥 2 = 𝟎. 222222208 ⋮ ⋮ = 𝟏𝟏𝟎𝟎𝟏𝟎. 𝟏𝟎𝟏𝟎… (2) = 𝟎. 𝟏𝟏𝟎𝟎𝟏𝟎𝟏𝟎𝟏𝟎 … ∙ 𝟐𝟔 Cont. 9) c) 31.202(4) : 13.51325(10) = 3 ∙ 41 + 1 ∙ 40 = 12 + 1 = 𝟏𝟑 = 2 ∙ 1 41 + 0 ∙ 1 42 +2 ∙ 1 43 = 1 2 + 1 32 = 16+1 32 = 17 32 = 𝟎. 𝟓𝟑𝟏𝟐𝟓 = 0.53125 𝑥 2 = 𝟏. 0625 = 0.0625 𝑥 2 = 𝟎. 125 = 0.125 𝑥 2 = 𝟎. 25 = 0.25 𝑥 2 = 𝟎. 5 = 0.5 𝑥 2 = 𝟏. 0 = 0.0 x 2 = 0.0 = 𝟏𝟏𝟎𝟏. 𝟏𝟎𝟎𝟎𝟏𝟎 (2) = 𝟎. 𝟏𝟏𝟎𝟏𝟎𝟎𝟎𝟏𝟎 ∙ 𝟐𝟒 13) F(10,3,-4,4). Realize as seguintes operações: a) 0.37 ∙ 10−1 + 0.13 ∙ 102 0.00037 ∙ 102 + 0.13000 ∙ 102 0.13037 ∙ 𝟏𝟎𝟐 → 𝟎. 𝟏𝟑𝟎 ∙ 𝟏𝟎𝟐 b) 0.150 ∙ 102 − 0.625 ∙ 100 0.15000 ∙ 102 −0.00625 ∙ 102 0.14375 ∙ 𝟏𝟎𝟐 → 𝟎. 𝟏𝟒𝟑 ∙ 𝟏𝟎𝟐 c) 0.475 ∙ 100 x 0.300 ∙ 101 0.475 x 0.300 ∙ 100+1 0.1425 ∙ 𝟏𝟎𝟏 → 𝟎. 𝟏𝟒𝟐 ∙ 𝟏𝟎𝟏 d) (0.250 ∙ 102 + 0.920 ∙ 10−1) ÷ 0.400 ∙ 101 (0.250 ∙ 102 + 0.000920 ∙ 102) ÷ 0.400 ∙ 101 0.2500920 ∙ 102 ÷ 0.400 ∙ 101 0.6273 ∙ 𝟏𝟎𝟏 → 𝟎. 𝟔𝟐𝟕 ∙ 𝟏𝟎𝟏 e) 𝐸𝐴 = 𝑥 − 𝑥 ; 𝐸𝑅 = 𝐸𝐴 𝑥 ; 𝐸𝑃 = 𝐸𝑅 𝑥 100 Para a) 𝑥 = 0.13037 ∙ 102 e 𝑥 = 0.130 ∙ 102 𝐸𝐴 = 0.13037 ∙ 102 − 0.130 ∙ 102 = 𝟎. 𝟎𝟎𝟎𝟑𝟕 ∙ 𝟏𝟎𝟐 𝐸𝑅 = 0.00037 ∙ 102 0.130 ∙ 102 = 𝟎. 𝟐𝟖𝟒𝟔𝟏𝟓𝟑𝟖𝟒𝟔 ∙ 𝟏𝟎−𝟐 𝐸𝑃 = 𝟎. 𝟐𝟖𝟒𝟔𝟏𝟓𝟑𝟖𝟒𝟔 % Para b) 𝑥 = 0.14375 ∙ 102 e 𝑥 = 0.143 ∙ 102 𝐸𝐴 = 0.14375 ∙ 102 − 0.143 ∙ 102 = 𝟎. 𝟎𝟎𝟎75 ∙ 𝟏𝟎𝟐 𝐸𝑅 = 0.00075 ∙ 102 0.143 ∙ 102 = 𝟎. 𝟓𝟐𝟒𝟒𝟕𝟓𝟓𝟐𝟐𝟒𝟓 ∙ 𝟏𝟎−𝟐 𝐸𝑃 = 𝟎. 𝟓𝟐𝟒𝟒𝟕𝟓𝟓𝟐𝟒 % Para c) 𝑥 = 0.1425 ∙ 101 e 𝑥 = 0.142 ∙ 101 𝐸𝐴 = 0.1425 ∙ 101 − 0.142 ∙ 101 = 𝟎. 𝟎𝟎𝟎𝟓 ∙ 𝟏𝟎𝟏 𝐸𝑅 = 0.0005 ∙ 101 0.142 ∙ 101 = 𝟎. 𝟑𝟓𝟐𝟏𝟏𝟐𝟔𝟕𝟑𝟏 ∙ 𝟏𝟎−𝟐 𝐸𝑃 = 𝟎. 𝟑𝟓𝟐𝟏𝟏𝟐𝟔𝟕𝟔 % Para d) 𝑥 = 0.6273 ∙ 101 e 𝑥 = 0.627 ∙ 101 𝐸𝐴 = 0.6273 ∙ 101 − 0.627 ∙ 101 = 𝟎. 𝟎𝟎𝟎𝟑 ∙ 𝟏𝟎𝟏 𝐸𝑅 = 0.0003 ∙ 101 0.627 ∙ 101 = 𝟎. 𝟒𝟕𝟖𝟒𝟔𝟖𝟖𝟗𝟗𝟓 ∙ 𝟏𝟎−𝟑 𝐸𝑃 = 𝟎. 𝟎𝟒𝟕𝟖𝟒𝟔𝟖𝟖𝟗 % 14) Sistema de representação de uma maquina 16 bits, no qual o primeiro digito é do sinal do número, os 10 seguintes são a mantissa, o decimo primeiro é o sinal da característica e os quatro últimos são da característica. a) 34.375 (10) : 34 + 0.375 0 – Positivo e 1 - Negativo = 0.375 𝑥 2 = 𝟎. 75 = 0.75 𝑥 2 = 𝟏. 5 = 0.5 𝑥 2 = 𝟏. 0 = 0.0 𝑥 2 = 𝟎. 0 = 𝟏𝟎𝟎𝟎𝟏𝟎. 𝟎𝟏𝟏𝟎 (2) = 𝟎. 𝟏𝟎𝟎𝟎𝟏𝟎𝟎𝟏𝟏𝟎 ∙ 𝟐𝟔 = 𝟎. 𝟏𝟎𝟎𝟎𝟏𝟎𝟎𝟏𝟏𝟎 ∙ 𝟐𝟏𝟏𝟎 0 1 0 0 0 1 0 0 1 1 0 0 0 1 1 0 Cont 14). c) −15.4 (10) : −15 + 0.4 0 – Positivo e 1 - Negativo = 0. 𝑥 2 = 𝟎. 8 = 0.8 𝑥 2 = 𝟏. 6 = 0.6 𝑥 2 = 𝟏. 2 = 0.2 𝑥 2 = 𝟎. 4 = 0.4 𝑥 2 = 𝟎. 8 = 0.8 𝑥 2 = 𝟏. 6 ⋮ ⋮ = −𝟏𝟏𝟏𝟏. 𝟎𝟏𝟏𝟎𝟎𝟏… (2) = − 𝟎. 𝟏𝟏𝟏𝟏𝟎𝟏𝟏𝟎𝟎𝟏… ∙ 𝟐𝟒 = − 𝟎.𝟏𝟏𝟏𝟏𝟎𝟏𝟏𝟎𝟎𝟏… ∙ 𝟐𝟏𝟎𝟎 1 1 1 1 1 0 1 1 0 0 1 0 0 1 0 0
Compartilhar