nievas martin 9/04/20 - martin nievas
TRANSCRIPT
![Page 1: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/1.jpg)
Sistemas de numeraciónNievas Martin
9/04/20
![Page 2: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/2.jpg)
Sistemas de numeración
● D&D Apéndice C (pág. 923)→ Apéndice C (pág. 923)
● CS Capítulo 2 (pág. 67)→ Apéndice C (pág. 923)
![Page 3: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/3.jpg)
NumeraciónTeorema Fundamental de la Numeración
Cualquier número natural N puede expresarse, de manera única, en la forma:
N=ann+a(n−1)X
(n−1)+...+a2X
2+a1 X
1+a0 X
0
Donde:x: número natural denominado base tal que x > 1
![Page 4: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/4.jpg)
Símbolos = {0,1,2,3,4,5,6,7,8,9}x = 10
Sistema Decimal
![Page 5: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/5.jpg)
Sistema Decimal
Ejemplo:
146 = 1.10² + 4.10¹ + 6.10⁰
4320 = 4.10³ + 3.10² + 2.10¹ + 0.10⁰
![Page 6: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/6.jpg)
Sistema Binario
Símbolos = {0,1}x = 2
![Page 7: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/7.jpg)
Sistema Binario
Ejemplo:
111=1.22+1.21+1.20=7(10)
1001(2)=1.23+0.22
+0.21+1.20
=9(10)
![Page 8: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/8.jpg)
Sistema Hexadecimal
Símbolos = {0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F}x = 16
![Page 9: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/9.jpg)
Sistema Hexadecimal
A 6(16)=10.161+6.160
=166(10)
1CE(16)=1.162+12.161
+14.160=462(10)
![Page 10: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/10.jpg)
Sistema Octal
Símbolos = {0,1,2,3,4,5,6,7}x = 8
![Page 11: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/11.jpg)
Sistema Octal
23(8)=2.81+3.80
=19(10)
30(8)=3.81+0.80
=24(10)
![Page 12: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/12.jpg)
Conversión decimal-binario
10 2
10 5 2
0 4 2 2
1 2 1
0
10 = 1010 ₂
![Page 13: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/13.jpg)
Conversión decimal-binario
23 2
22 11 2
1 10 5 2
1 4 2 2
1 2 1
0
23 = 10111 ₂
![Page 14: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/14.jpg)
Conversión decimal-Hexadecimal
3412 16
3408 213 16
4 208 13
5
3412 = D54₁₆
![Page 15: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/15.jpg)
Conversión decimal-binario/binario-hexadecimal
43 2
42 21 2
1 20 10 2
1 10 5 2
0 4 2 2
1 2 1
0
43 = 101011 ₂
![Page 16: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/16.jpg)
Conversión decimal-binario/binario-hexadecimal
43 = 0010 1011 ₂
43 2
42 21 2
1 20 10 2
1 10 5 2
0 4 2 2
1 2 1
0
![Page 17: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/17.jpg)
Conversión decimal-binario/binario-hexadecimal
43 = 0010 1011 ₂
0010 = 21011 = 11
43 = 2B ₁₀ = 2B₁₆ ₁₆
43 2
42 21 2
1 20 10 2
1 10 5 2
0 4 2 2
1 2 1
0
![Page 18: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/18.jpg)
NúmerosComo sumar
0x4 + 0x1
0x4 = 0100
0x1 = 0001
0x5 0101
0xAA + 0x11
0xAA = 10101010
0x11 = 00010001
10111011
![Page 19: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/19.jpg)
NúmerosAcarreo
0xAB + 0x11
0xAA = 10101011
0x11 = 00010001
![Page 20: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/20.jpg)
NúmerosAcarreo
0xAB + 0x11
0xAA = 10101011
0x11 = 00010001
![Page 21: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/21.jpg)
NúmerosAcarreo
0xAB + 0x11
1
0xAA = 10101011
0x11 = 00010001
0
0x1 = 0001
0x2 = 0010
![Page 22: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/22.jpg)
NúmerosAcarreo
0xAB + 0x11
0xAA = 10101011
0x11 = 00010001
10111100
![Page 23: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/23.jpg)
NúmerosConsultas?
Y los números negativos?
![Page 24: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/24.jpg)
NúmerosNúmeros negativos
0x6 – 0x6 = 0x0
0x6 = 0110
-0x6 = ????
![Page 25: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/25.jpg)
NúmerosNúmeros negativos
0x6 – 0x6 = 0x0
0x6 = 0110
-0x6 = 1010
![Page 26: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/26.jpg)
NúmerosNúmeros negativos
0x6 – 0x6 = 0x0
0x6 = 0110
-0x6 = 1010
10000
![Page 27: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/27.jpg)
NúmerosNúmeros negativos
0x6 – 0x6 = 0x0
0x6 = 0110
-0x6 = 1010
10000
![Page 28: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/28.jpg)
NúmerosNúmeros negativos
![Page 29: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/29.jpg)
NúmerosNúmeros negativos – complemento a 2
0x6 = 0110 ←
![Page 30: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/30.jpg)
NúmerosNúmeros negativos – complemento a 2
0x6 = 0110
0
![Page 31: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/31.jpg)
NúmerosNúmeros negativos – complemento a 2
0x6 = 0110
10
![Page 32: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/32.jpg)
NúmerosNúmeros negativos – complemento a 2
0x6 = 0110
010
![Page 33: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/33.jpg)
NúmerosNúmeros negativos – complemento a 2
0x6 = 0110
1010
![Page 34: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/34.jpg)
NúmerosNúmeros negativos – complemento a 2
0x6 = 0110
-0x6 = 1010
![Page 35: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/35.jpg)
NúmerosNúmeros negativos – complemento a 2
-0x2 = 1110
-0xAA = 01010110
-0xFA = 00000110
![Page 36: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/36.jpg)
NúmerosComplemento a 2
4 bits
>
![Page 37: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/37.jpg)
NúmerosComplemento a 2
4 bits
> 0111
![Page 38: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/38.jpg)
NúmerosComplemento a 2
4 bits
> 0111 = 0x7
![Page 39: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/39.jpg)
NúmerosComplemento a 2
4 bits
> 0111 = 0x7
< 1000 = -0x8
![Page 40: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/40.jpg)
NúmerosComplemento a 2
4 bits
> 0111 = 0x7
< 1000 = -0x8
1000
![Page 41: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/41.jpg)
NúmerosComplemento a 2
4 bits
> 0111 = 0x7
< 1000 = -0x8
1000
![Page 42: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/42.jpg)
NúmerosComplemento a 2
4 bits
> 0111 = 0x7
< 1000 = -0x8
1000 ←
![Page 43: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/43.jpg)
NúmerosComplemento a 2
4 bits
> 0111 = 0x7
< 1000 = -0x8
1000 ←
1000 = 0x8
![Page 44: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/44.jpg)
NúmerosComplemento a 2
4 bits
> 0111 = 0x7
< 1000 = -0x8
1000 ←
1000 = 0x8
0x8 = 1000
-0x8 = 1000
![Page 45: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/45.jpg)
NúmerosComplemento a 2
4 bits
> 0111 = 0x7
< 1000 = -0x8
1000 ←
1000 = 0x8
0x8 = 1000
-0x8 = 1000
=10000
![Page 46: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/46.jpg)
NúmerosComplemento a 2
0x8 = 1000
![Page 47: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/47.jpg)
NúmerosComplemento a 2
0x8 = 1000
~ 0111
![Page 48: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/48.jpg)
NúmerosComplemento a 2
0x8 = 1000
~ 0111
+ 0001
![Page 49: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/49.jpg)
NúmerosComplemento a 2
0x8 = 1000
~ 0111
+ 0001
1000
![Page 50: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/50.jpg)
EjerciciosGuía de ejercicio
![Page 51: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/51.jpg)
Operaciones Booleanas
&
0 0 0
0 1 0
1 0 0
1 1 1
~
0 1
1 0
|
0 0 0
0 1 1
1 0 1
1 1 1
^
0 0 0
0 1 1
1 0 1
1 1 0
ANDAND OR XORNOT ANDAND OR XORNOT
Multiplica Suma Solo 1 cuando Son diferentes
Invierte
![Page 52: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/52.jpg)
Operaciones BooleanasEjemplos:
0 1 1 0
& 1 1 0 0
0 1 0 0
0 1 1 0
| 1 1 0 0
1 1 1 0
0 1 1 0
^ 1 1 0 0
1 0 1 0
~ 1 1 0 0
0 0 1 1
![Page 53: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/53.jpg)
Desplazamiento Lógico
Operación Valor 1 Valor 2
número [01100011] [10010101]
X << 4 [00110000] [01010000]
X >>4 [00000110] [00001001]
![Page 54: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/54.jpg)
NúmerosNúmeros decimales
ann+a(n−1)X
(n−1)+...+a2X
2+a1 X
1+a0X
0+a−1X
−1+...
![Page 55: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/55.jpg)
0.12=0.21+1.2−1
=0,5
0.012=0.21+0.2−1
+1.2−2=0,25
NúmerosNúmeros decimales
![Page 56: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/56.jpg)
Númerosfloat simple y doble precisión
![Page 57: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/57.jpg)
Float – IEEE754float precisión simple
(−1)s x1.m x2(e−bias)
S Signo→ Apéndice C (pág. 923)m Mantisa→ Apéndice C (pág. 923)e Exponente→ Apéndice C (pág. 923)
![Page 58: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/58.jpg)
Float – IEEE754Ejemplo: decimal a float
1) Convertir a binario y determinar signo
2) Normalizar
3) Calcular el exponente
4) Escribir el resultado
![Page 59: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/59.jpg)
Float – IEEE754Ejemplo: decimal a float
1) Convertir a binario y determinar signo
266 100001010→ Apéndice C (pág. 923)
0,75 0,11→ Apéndice C (pág. 923)
Signo
+ 0→ Apéndice C (pág. 923)
- 1→ Apéndice C (pág. 923)
![Page 60: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/60.jpg)
Float – IEEE754Ejemplo: decimal a float
2) Normalizar
100001010,11
1,0000101011
3)Calcular exponente
8 lugares 8+127 = 135→ 8+127 = 135
135 = 10000111
![Page 61: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/61.jpg)
Float – IEEE754Ejemplo: decimal a float
4) Escribir el resultado
signo: 0
normalizado: 1,0000101011
exponente: 10000111
Número:
0 10000111 00001010110000000000000
s exp mantisa
![Page 62: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/62.jpg)
Float – IEEE754Ejemplo: float a decimal
Partiendo de un float queremos llegar al dec
01000011100001010110000000000000
![Page 63: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/63.jpg)
Float – IEEE754Ejemplo: float a decimal
Partiendo de un float queremos llegar al dec
01000011100001010110000000000000
![Page 64: Nievas Martin 9/04/20 - Martin Nievas](https://reader036.vdocumento.com/reader036/viewer/2022070810/62c615deb59f9312e157ea0c/html5/thumbnails/64.jpg)
Float – IEEE754Ejemplo: float a decimal
Partiendo de un float queremos llegar al dec
0 signo (+)→ 8+127 = 135
10000111 exp→ 8+127 = 135
00001010110000000000000 mantisa→ 8+127 = 135