Sie sind auf Seite 1von 8

ESCUELA POLITCNICA NACIONAL

FACULTAD DE INGENIERA DE SISTEMAS


INGENIERA EN SISTEMAS INFORMTICOS Y DE COMPUTACIN

ASIGNATURA: FUNDAMENTOS DE CIENCIAS DE LA COMPUTACIN


PROFESOR: ING CESAR ESQUETINI
TIPO DE INSTRUMENTO: EJECUCIN DE CDIGO DE SUMA
FECHA DE APLICACIN: 29/09/2014
CURSO: GR2 504
NOMBRE: ALEXIS ADRIN MIRANDA
DESARROLLO
ESPECIFICACIONES
Tipo de Sistemas: Sistema operativo 32 bits
Compilador: DEV-C++ versin 4.9.9.2

EJECUCIN DE CDIGO DE SUMA


CDIGO
#include<stdio.h>
#include<conio.h>
int main() {
short int A,B,C,D;
A=3;
B=0x54; //Numero Octal
C=0xab; //Numero Hexadecimal
A=B-C;
B=B+C;

C=C-B;
printf("\n Los va de a,b,c son %x %o %o",A,A,C);
A=C;
C=B-A;
D=0x1f;
printf("\n os va de a,b,c son %i %o %x %x",D,C,B,A);
getch();
}
MEMORIA
A
0

B
0

C
0

A=BC
Complemento 2A de C
1

0
1
1

0
1
1

0
1
1

0
1
1

0
1
1

0
1
1

0
1
1

0
0
1

1
1
0

0
0
1

1
1
0

0
0
1

1
1
0

0
0
0

0
1
1

A=B + (-C)
0
1
1

0
1
1

Base Hexadecimal
F
Base Octal

A
1

B=B+C
B
C

0
0
0

0
0
0

0
0
0

0
0
0

0
0
0

0
0
0

0
0
0

0
0
0

0
1
1

1
0
1

0
1
1

1
0
1

0
1
1

1
0
1

0
1
1

0
1
1

B
0

Base Hexadecimal
0

C=C-B
Complemento 2A de B
1

0
1
1

0
1
1

0
1
1

0
1
1

0
1
1

0
1
1

0
1
1

1
0
1

0
0
0

1
0
1

0
0
0

1
0
1

0
0
1

1
0
0

1
1
0

C = C + (-B)
C
-B

0
1
1

0
1
1

C
1

PANTALLA (Primer mensaje)

A=C
A
1

Base Hexadecimal
F

C=BA
Complemento 2A de A

B
-A

1
1
0

0
0
0

0
0
0

0
0
0

0
0
0

0
0
0

0
0
0

0
0
0

0
0
1

1
0
0

1
1
1

1
0
0

1
1
1

1
0
0

1
1
0

1
0
1

1
0
1

Base Octal
0

C
0

D = 0X 1F
D
0

0
0
0
0
D = 31 Base Decimal

16

PANTALLA FINAL

RESOLUCIN DEL SIGUIENTE PROGRAMA


#include<stdio.h>
#include<conio.h>
int main() {
short int A,B,C,D;
A=010;
B=0x1B;
C=-5;
D=17;
A=D-A;
B=B-3;

C=C+D;
printf("\n Los va de a,b,c,d son %d %o %X %x",A,B,C,D);
getch();
}
MEMORIA

A
0

B
0

C = -5
C
0

Complemento 2A de C
1

0
1
1

-C
1

D = 17
D
0

Base Hexadecimal
0

A=DA

Complemento 2A de A

D
-A
1

1
1
0

-A
1

0
1
0

0
1
0

0
1
0

0
1
0

0
1
0

0
1
0

0
1
0

0
1
0

0
1
0

0
1
0

0
1
0

1
1
0

0
1
1

0
0
0

0
0
0

1
0
1

Decimal 9
B=B3
Complemento 2A de 3

B
-3
1

0
1
1

0
1
0

0
1
0

0
1
0

0
1
0

0
1
0

0
1
0

0
1
0

0
1
0

0
1
0

0
1
0

0
1
0

1
1
1

1
1
1

0
1
0

1
0
0

1
1
0

Base Octal
0

C = -C + D
C
D
1

0
0
0

0
0
0

0
0
0

0
0
0

0
0
0

0
0
0

0
0
0

0
0
0

0
0
0

0
0
0

0
0
0

0
1
1

0
0
0

1
0
1

0
0
1

Base Hexadecimal
0

1
1
0

Das könnte Ihnen auch gefallen