Baixe o app para aproveitar ainda mais
Prévia do material em texto
Utilizando K dígitos binários, determine quantos números não negativos podem ser representados em sinal-magnitude. . o bit mais a esquerda é usado para representar o sinal. Assim, o valor absoluto é representado por K-1 bits. . combinar 0s e 1s em k-1 posições é : 2k-1 Converter os seguintes valores decimais: +119 para sinal-magnitude com 8 bits 119 2 1 59 2 1 29 2 1 14 2 0 7 2 1 3 2 119 = 11101112 1 bit para sinal 01110111 OBS: bit de sinal é o bit mais a esquerda 0 – positivo 1 - negativo 1 1 2 1 0 -77 para sinal-magnitude com 16 bits 77 2 1 38 2 0 19 2 1 9 2 1 4 2 0 2 2 77 = 10011012 Com 16 bits: +77 = 00000000010011012 1 bit para sinal negativo -77 = 10000000010011012 0 1 2 1 0 -143 para complemento de dois com 12 bits 143 2 1 71 2 1 35 2 1 17 2 1 8 2 0 4 2 143 = 100011112 Com 12 bits: +143 = 0000100011112 (inverter o +143 e somar 1) -143 1111011100002 + 1 = 111101110001 -143 = 1111011100012 0 2 2 0 1 2 1 0 227 para complemento de dois com 16 bits 227 2 1 113 2 1 56 2 0 28 2 0 14 2 0 7 2 227 = 111000112 Com 16 bits: +227 = 00000000111000112 1 3 2 1 1 2 1 0 Converter de decimal para binário 329 = 1010010012 329 2 1 164 2 0 82 2 0 41 2 1 20 2 0 10 2 0 5 2 1 2 2 0 1 2 1 0 581 = 10010001012 581 2 1 290 2 0 145 2 1 72 2 0 36 2 0 18 2 0 9 2 1 4 2 0 2 2 0 1 2 1 0 69 = 10001012 69 2 1 34 2 0 17 2 1 8 2 0 4 2 0 2 2 0 1 2 1 0 Converter de binário para decimal 11011101010 1*210 + 1*29 + 0*28 + 1*27 + 1*26 + 1*25 + 0*24 + 1*23 + 0*22 + 1*21 + 0*20 = 1024 + 512 + 0 + 128 + 64 + 32 + 0 + 8 + 0 + 2 + 0 = 1770 11101100010 1*210 + 1*29 + 1*28 + 0*27 + 1*26 + 1*25 + 0*24 + 0*23 + 0*22 + 1*21 + 0*20 = 1024 + 512 + 256 + 64 + 32 + 2 = 1890 100000000110 1*211 + 0*210 + 0*29 + 0*28 + 0*27 + 0*26 + 0*25 + 0*24 + 0*23 + 1*22 + 1*21 + 0*20 = 2048 + 4 + 2 = 2054 Converter da base 10 para base 8 177 = 2618 177 8 1 22 8 6 2 8 2 0 821 = 14688 821 8 5 102 8 6 12 8 4 1 8 1 0 27 = 338 27 8 3 3 8 3 0 Converter da base 8 para a base 10 705 7*82 + 0*81 + 5*80 = 448 + 0 + 5 = 45310 201 2*82 + 0*81 + 1*80 = 128 + 0 + 1 = 129 452 4+82 + 5*81 + 2*80 = 256 + 40 + 2 = 298 Converter 22310 = ?16 223 16 15 (F) 13 16 13 (D) 0 33B16 = ?10 3*162 + 3*161 + B(11)*160 = 768 + 48 + 11 = 827 Complete: decimal binário octal hexadecimal 37 100101 45 25 205 11001101 315 CD 238 11101110 356 EE 6732 1101001001100 15114 1A4C Código Hamming. Seja a palavra, 01000111, calcular: Palavra a ser enviada D8 D7 D6 D5 D4 D3 D2 D1 0 1 0 0 0 1 1 1 12 1100 Dado8R1 = D1 XOR D2 XOR D4 XOR D5 XOR D7 = 1 XOR 1 XOR 0 XOR 0 XOR 1 = 1 R2 = D1 XOR D3 XOR D4 XOR D6 XOR D7 = 1 XOR 1 XOR 0 XOR 0 XOR 1 = 1 R3 = D2 XOR D3 XOR D4 XOR D8 = 1 XOR 1 XOR 0 XOR 0 = 0 R4 = D5 XOR D6 XOR D7 XOR D8 = 0 XOR 0 XOR 1 XOR 0 = 1 11 1011 Dado7 10 1010 Dado6 9 1001 Dado5 8 1000 Redundância4 7 0111 Dado4 6 0110 Dado3 5 0101 Dado2 4 0100 Redundância3 3 0011 Dado1 2 0010 Redundância2 1 0001 Redundância1 Palavra a ser enviada D8 D7 D6 D5 R4 D4 D3 D2 R3 D1 R2 R1 0 1 0 0 1 0 1 1 0 1 1 1 Alterar o bit D3 R1 = D1 XOR D2 XOR D4 XOR D5 XOR D7 = 1 XOR 1 XOR 0 XOR 0 XOR 1 = 1 R2 = D1 XOR D3 XOR D4 XOR D6 XOR D7 = 1 XOR 0 XOR 0 XOR 0 XOR 1 = 0 R3 = D2 XOR D3 XOR D4 XOR D8 = 1 XOR 0 XOR 0 XOR 0 = 1 R4 = D5 XOR D6 XOR D7 XOR D8 = 0 XOR 0 XOR 1 XOR 0 = 1 R4 R3 R2 R1 Redundância recebida 1 0 1 1 Nova redundância 1 1 0 1 XOR 0 1 1 0Posição 06 – corresponde ao D3 Alterar o bit R3 R1 = D1 XOR D2 XOR D4 XOR D5 XOR D7 = 1 XOR 1 XOR 0 XOR 0 XOR 1 = 1 R2 = D1 XOR D3 XOR D4 XOR D6 XOR D7 = 1 XOR 1 XOR 0 XOR 0 XOR 1 = 1 R3 = D2 XOR D3 XOR D4 XOR D8 = 1 XOR 1 XOR 0 XOR 0 = 0 R4 = D5 XOR D6 XOR D7 XOR D8 = 0 XOR 0 XOR 1 XOR 0 = 1 R4 R3 R2 R1 Redundância recebida 1 0 1 1 Nova redundância 1 0 1 1Não existe posição 0. Assim, conclui-se que o código Hamming não funciona quando o erro acontece em um bit de redundância XOR 0 0 0 0
Compartilhar