computer structure - uc3mocw.uc3m.es/ingenieria-informatica/computer-structure/objetives.pdf ·...

14
Computer Structure Course Objectives Grupo de Arquitectura de Computadores, Comunicaciones y Sistemas Departamento de Informática UNIVERSIDAD CARLOS III DE MADRID Course Objectives

Upload: dangtuong

Post on 07-Apr-2018

221 views

Category:

Documents


6 download

TRANSCRIPT

Page 1: Computer Structure - UC3Mocw.uc3m.es/ingenieria-informatica/computer-structure/objetives.pdf · Course objectives. The main goal of the course is to describe the main components of

Computer Structure

Course Objectives

Grupo de Arquitectura de Computadores, Comunicaciones y SistemasDepartamento de Informática

UNIVERSIDAD CARLOS III DE MADRID

Course Objectives

becweb
Texto escrito a máquina
Félix García Carballeira, Alejandro Calderón Mateos, José Daniel García Sánchez
becweb
UC3M
Page 2: Computer Structure - UC3Mocw.uc3m.es/ingenieria-informatica/computer-structure/objetives.pdf · Course objectives. The main goal of the course is to describe the main components of

Course objectives

� The main goal of the course is to describe the main components of a computer, and the basic behavior of computers

¿ ?

2Computer StructureARCOS

Page 3: Computer Structure - UC3Mocw.uc3m.es/ingenieria-informatica/computer-structure/objetives.pdf · Course objectives. The main goal of the course is to describe the main components of

Understanding how a program is executed

temp = v[k];

v[k] = v[k+1];

v[k+1] = temp;

High Level Language (C)

3Computer StructureARCOS

Page 4: Computer Structure - UC3Mocw.uc3m.es/ingenieria-informatica/computer-structure/objetives.pdf · Course objectives. The main goal of the course is to describe the main components of

Understanding how a program is executed

temp = v[k];

v[k] = v[k+1];

v[k+1] = temp;

High Level Language(C)

0000 1001 1100 0110 1010 1111 0101 10001010 1111 0101 1000 0000 1001 1100 0110 1100 0110 1010 1111 0101 1000 0000 1001 0101 1000 0000 1001 1100 0110 1010 1111

Machine instructions

4Computer StructureARCOS

Page 5: Computer Structure - UC3Mocw.uc3m.es/ingenieria-informatica/computer-structure/objetives.pdf · Course objectives. The main goal of the course is to describe the main components of

Understanding how a program is executed

lw $t0, 0($2)

temp = v[k];

v[k] = v[k+1];

v[k+1] = temp;

High Level Language(C)

lw $t0, 0($2)lw $t1, 4($2)sw $t1, 0($2)sw $t0, 4($2)

0000 1001 1100 0110 1010 1111 0101 10001010 1111 0101 1000 0000 1001 1100 0110 1100 0110 1010 1111 0101 1000 0000 1001 0101 1000 0000 1001 1100 0110 1010 1111

Assembly language

Machine instructions

5Computer StructureARCOS

Page 6: Computer Structure - UC3Mocw.uc3m.es/ingenieria-informatica/computer-structure/objetives.pdf · Course objectives. The main goal of the course is to describe the main components of

Understanding how a program is executed

lw $t0, 0($2)

temp = v[k];

v[k] = v[k+1];

v[k+1] = temp; Compiler

lw $t0, 0($2)lw $t1, 4($2)sw $t1, 0($2)sw $t0, 4($2)

0000 1001 1100 0110 1010 1111 0101 10001010 1111 0101 1000 0000 1001 1100 0110 1100 0110 1010 1111 0101 1000 0000 1001 0101 1000 0000 1001 1100 0110 1010 1111

Assembler

6Computer StructureARCOS

Page 7: Computer Structure - UC3Mocw.uc3m.es/ingenieria-informatica/computer-structure/objetives.pdf · Course objectives. The main goal of the course is to describe the main components of

Example 1

int n;n = 40000;printf("%d \n", n *n );

n = 50000;n = 50000;printf("%d \n", n *n );

� Is this output correct?1600000000 -1794967296

7Computer StructureARCOS

Page 8: Computer Structure - UC3Mocw.uc3m.es/ingenieria-informatica/computer-structure/objetives.pdf · Course objectives. The main goal of the course is to describe the main components of

Example 2

float x, y , z;

x = 1.0e20;y = -1.0e20;z = 3.14;

printf("%f\n", (x + y) + z);printf("%f\n", x + (y + z));

� ¿Is (x+y) + z == x + (y+z)?

8Computer StructureARCOS

Page 9: Computer Structure - UC3Mocw.uc3m.es/ingenieria-informatica/computer-structure/objetives.pdf · Course objectives. The main goal of the course is to describe the main components of

Example 3

� Code 1int a[N][N]for (i=0; i < N; i++)

for (j=0; j < N; j++)sum = sum + a[i][j];

� Code 2int a[N][N]for (j=0; j < N; j++)

for (i=0; i < N; i++)sum = sum + a[i][j];

� Are similar these codes?� Are equal the execution times?

9Computer StructureARCOS

Page 10: Computer Structure - UC3Mocw.uc3m.es/ingenieria-informatica/computer-structure/objetives.pdf · Course objectives. The main goal of the course is to describe the main components of

Example 4

#include <stdio.h>

#define BLOCK_SIZE 512

void main(int argc, char **argv){

int fde, fds;char buffer[BLOCK_SIZE];int n;

fde = open(argv[1], 0);fde = open(argv[1], 0);fds = creat(argv[2], 0666);

while((n = read(fde, buffer, BLOCK_SIZE))> 0)write(fds, buffer, n);

close(fde);close(fds);

return;}

� What happens ifBLOCK_SIZE = 8192?

10Computer StructureARCOS

Page 11: Computer Structure - UC3Mocw.uc3m.es/ingenieria-informatica/computer-structure/objetives.pdf · Course objectives. The main goal of the course is to describe the main components of

Example 5

� Multicore processors

� Who is faster, a dual core or a processor with 4 cores?

11Computer StructureARCOS

Page 12: Computer Structure - UC3Mocw.uc3m.es/ingenieria-informatica/computer-structure/objetives.pdf · Course objectives. The main goal of the course is to describe the main components of

Content

Unit 1. Introduction to computersUnit 2. Data representationUnit 3. Assembly programmingUnit 4. ProcessorUnit 5. Memory systemsUnit 5. Memory systemsUnit 6. Input/Output systems

12Computer StructureARCOS

Page 13: Computer Structure - UC3Mocw.uc3m.es/ingenieria-informatica/computer-structure/objetives.pdf · Course objectives. The main goal of the course is to describe the main components of

Bibliography

� Problemas resueltos de Estructurade ComputadoresF. García, J. Carretero, J. D. GarcíaD. ExpósitoParaninfo, 2009

� Computer Organización and Design.The Hardware/Software InterfaceDavid. A. Patterson, John L. HennessyMorgan Kaufmann, 2009

13Computer StructureARCOS

Page 14: Computer Structure - UC3Mocw.uc3m.es/ingenieria-informatica/computer-structure/objetives.pdf · Course objectives. The main goal of the course is to describe the main components of

Bibliography

� Computer Organization and designW. Stallings, 8th edition 2010Prentice-Hall

ARCOS Computer Structure 14