Descargar como pdf o txt
Descargar como pdf o txt
Está en la página 1de 79

http://creativecommons.org/licenses/by-nc-nd/2.

5/mx/

Arquitectura y
programación de
computadoras
Eugenio Jacobo Hernández Valdelamar
Notas del curso
Sesiones 1 a 3
v.1.0 2008
Introducción

Durante 2008 tuve la oportunidad de impartir esta materia en la FAR. Es un


tema extenso que decidí intentar cubrir integralmente con teoría e
información de electrónica, matemática discreta, computación e
informática. Durante el curso incluso se usaron algunas herramientas de
simulación de electrónica digital, y otras tantas.
Lo más importante es que los participantes comprendan como funcionan
las computadoras y darles la oportunidad de hacer algo que les permita
entender su funcionamiento, aplicaciones y su integración en nuestro
entorno; de otra manera estarán condenados a seguir siendo usuarios.

E J Hernández Valdelamar, marzo 2011.


Sesión 1

 Computadoras: una primera


aproximación a su estructura y
componentes.
¿Qué hacemos
todos los días?
Solucionar problemas
Manos a la obra:
Herramientas
Herramientas de
medición
Herramientas de cálculo
Máquinas calculadoras
Computadoras ->herramientas
para la solución de problemas

Entrada Procesamiento Salida


Componentes básicos de
hardware
Teclado
Unidades de disco Unidades de disco
Cintas Cintas
Mouse Registros Impresoras
Lectores de código instrucciones RAM Monitores
de barras

Unidad central
Dispositivos Memoria Dispositivos
de
de entrada principal de salida
procesamiento

Bus
Un camino para entender como
funcionan las computadoras

Como niños chiquitos, desarmar y armar cosas es muy ilustrativo; sin


embargo, el armado de una PC hoy día solo implica el ensamblaje de
componentes. Se gana en habilidad técnica.
Un camino más seguro:
máquinas virtuales

System Process
virtual machine virtual machine

VM
Investigación
 ¿Qué es arquitectura?
 En el contexto de la informática:
 ¿Qué es…?
 Arquitectura de computadoras
 Arquitectura de información
 Arquitectura de software
 ¿Cómo hacer una máquina sumadora?
 ¿Quién fue Alan Turing? ¿Qué hizo?
Referencias

 http://www.mhuffman.com/notes/imagcomp
/imagcomp.html
 http://www.naturalprogramming.com/IC8/
 http://en.wikipedia.org/wiki/Turing_machine
_gallery
 http://en.wikipedia.org/wiki/Turing_machine
Sesión 2

 Computación: ser o no ser


 Creando el computo
 Software y hardware
 Aritmética, lógica y electrónica
 ALUs
 FPUs
Computación
 El término computador se refería a un ser humano
que realizaba cálculos.
 Los primeros investigadores en lo que después se
convertiría las ciencias de la computación, estaban
interesados en la cuestión de la computabilidad: qué
cosas pueden ser computadas por un ser humano que
simplemente siga una lista de instrucciones con lápiz y
papel, durante el tiempo que sea necesario, con
ingenuidad y sin conocimiento previo del problema.
 Parte de la motivación para este trabajo era el
desarrollar máquinas que computaran, y que pudieran
automatizar el tedioso y lleno de errores trabajo de la
computación humana.
Una diferencia sutil
 Describir que se requiere que la máquina
haga.
 Diseño de programas
 Describir cómo funciona la máquina.
 Diseño de circuitos

 ¿Sabemos “hablar” en ambos lenguajes?


 ¿Qué se produce más: hardware o software?
Un término para unificar
todos: sistema
Comprendiendo y
representando sistemas
Hardware
 Hardware es un
termino general
que se refiere a los
artefactos físicos
de una tecnología.
 Se refiere a los
componentes
físicos de un
sistema de
computo, en la
forma de hardware
de computo.
Principios fundamentales
 Transmisión de información digital
 Todo sistema requiere mover información
digital de un punto del sistema a otro.
 Code transfer
 Binary bus transfer
 Digital communications
 Data communications
 En resumen: un código binario se desplaza
de un lugar a otro.
Comunicación de datos

 Sistema de comunicación de datos


 Fuente o transmisor
 Canal o ruta de transmisión
 Receptor
 Un bit es representado por un valor voltaje.
Transmisión de datos
 Transmisión paralela de datos
 Se usa en comunicaciones a corta
distancia entre equipos digitales.
 Mueve datos usando múltiples líneas
(una por bit).
 Transmisión serial de datos
 Se usa en distancias mayores a 25
pies.
 Una línea de transmisión.
 Los datos se transmiten en series.
 Requiere de mecanismos de
sincronización (reloj) o códigos para
operaciones asíncronas.
Codificación/decodificación
de datos
 Conversión de códigos
 1. Conversion of signals, or groups of
signals, in one code into corresponding
signals, or groups of signals, in another
code.
 2. A process for converting a code of some
predetermined bit structure, such as 5, 7, or
14 bits per character interval, to another
code with the same or a different number of
bits per character interval.
Códigos
Circuitos de lógica
combinatoria
 Combinational Logic circuits are only determined by their current
input state as they have no feedback, and any changes to the
signals being applied to their inputs will immediately have an
effect at the output. In other words, if the input condition changes
state so too does the output as combinational circuits have No
Memory.
 Combinational Logic circuits are made up from basic logic AND,
OR or NOT gates that are "combined" or connected together to
produce more complicated switching circuits.
 As combinational logic circuits are made up from individual logic
gates they can also be considered as "decision making circuits"
and combinational logic is about combining logic gates together to
process two or more signals in order to produce at least one
output signal according to the logical function of each logic gate.
El “API” de los circuitos
de lógica combinatoria
Ejemplo:
Controlando 4 focos

2
F(a,b)
Decodificación binaria
Decodificación de
direcciones de memoria

The decoder requires 3 address lines, (A0 to A2) to 128x8 = 1024 bytes
select each one of the 8 chips (the lower part of the
address), while the remaining 7 address lines (A3 to A9)
select the correct memory location on that chip (the
upper part of the address).
Ejemplo: despliegue de
un numero
Todo está en los códigos
Comparador
Componentes básicos de
hardware

Teclado
Unidades de disco Unidades de disco
Cintas Cintas
Mouse Registros Impresoras
Lectores de código instrucciones RAM Monitores
de barras

Unidad central
Dispositivos Memoria Dispositivos
de
de entrada principal de salida
procesamiento

Bus
¿Cómo hacer un sumador
de 2 bits en hardware?

Y ….¿luego?

Donde X e Y son
los sumandos, C
el acarreo y S la
suma
Expresiones lógicas a
partir de tablas

Suma canónica de productos Producto canónico de sumas


Search for the 1s Luke Feel the 0s Luke

S = ~XY + X~Y S = (~X+~Y) (X+Y)


Calculen ustedes C

y…¿luego?
Producto=AND Suma=OR

Medio sumador
A simple 2-bit ALU that does XOR, AND, OR, and addition
ALU 4 bits
Configuraciones ALU
Registros
RAM

Acumulador Registro a Pila de Registro y


registro registros memoria
Ej. Calculadora
MIPS Ej. CISC
Intel IA-32 ISA
(x86 processors)
Investigación

 Simulador de ALU.
 Investigar las principales operaciones y
capacidades de una ALU.
 Realizar un programa capaz de replicar las
principales operaciones.
 No considere por el momento las relaciones
de control con el resto del CPU
Referencias
 Design and Implementation of a 4-bit ALU
http://www.seas.upenn.edu/~ese201/lab/LabALU/ALU.ht
ml
 http://www.camiresearch.com/Data_Com_Basics/data_co
m_tutorial.html
 http://www.electronics-
tutorials.ws/combination/comb_4.html
 http://azul2.bnct.ipn.mx/~clogicos/practicas_de_laboratori
o/practica_4.htm
 http://en.wikibooks.org/wiki/Microprocessor_Design/ALU
 http://www.electronics-tutorials.ws/logic/logic_1.html
Sesión 3

 Memoria
 Unidad central de procesamiento
Memoria
Memoria de almacenamiento
temporal y permanente
Siguiendo la pista del uso
de memoria

POST BIOS Load OS


¿Por qué las computadoras requieren
tantos tipos de memoria?

Bit size
Info que puede
procesarse
simultáneamente

50-70 nano segs

Depende del ancho


y velocidad del bus

+ -
Costo de la memoria ($/megabyte)
Velocidad
El cache
una caché[1] es un conjunto de datos duplicados de otros originales, con la propiedad de que los datos originales son costosos
de acceder, normalmente en tiempo, respecto a la copia en la caché. Cuando se accede por primera vez a un dato, se hace una
copia en el caché; los accesos siguientes se realizan a dicha copia, haciendo que el tiempo de acceso medio al dato sea menor.

Una memoria caché es una memoria en la que se almacena una


serie de datos para su rápido acceso
En el interior de la memoria:
en un principio, el capacitor
La RAM: el cubo con
truco
Práctica: Retroalimentación
y memoria
Memristor: el 4º circuito
fundamental
El nombre es una palabra compuesta de memory resistor (resistencia-memoria).

Un memristor efectivamente almacena información porque el nivel de su resistencia


eléctrica cambia cuando es aplicada la corriente. Donde una resistencia típica
proporciona un nivel estable de resistencia, un memristor puede tener un alto nivel
de resistencia que puede ser interpretado en una computadora en términos de
datos como un "1", y un bajo nivel que puede ser interpretado como un "0". Así,
controlando la corriente, los datos pueden ser guardados y reescritos.
Unidad central de
procesamiento
La unidad central de
procesamiento
La unidad de control
 The control unit of the CPU contains circuitry
that uses electrical signals to direct the entire
computer system to carry out, or execute,
stored program instructions. Like an orchestra
leader, the control unit does not execute
program instructions; rather, it directs other
parts of the system to do so. The control unit
must communicate with both the
arithmetic/logic unit and memory.
La unidad aritmético
lógica
 The arithmetic/logic unit (ALU) contains the
electronic circuitry that executes all arithmetic
and logical operations.
The arithmetic/logic unit can perform four kinds
of arithmetic operations, or mathematical
calculations: addition, subtraction,
multiplication, and division. As its name
implies, the arithmetic/logic unit also performs
logical operations. A logical operation is usually
a comparison. The unit can compare numbers,
letters, or special characters.
Registros
 Registers are temporary storage areas for instructions or data. They are not a part
of memory; rather they are special additional storage locations that offer the
advantage of speed. Registers work under the direction of the control unit to
accept, hold, and transfer instructions or data and perform arithmetic or logical
comparisons at high speed. The control unit uses a data storage register the way a
store owner uses a cash register-as a temporary, convenient place to store what is
used in transactions.
Computers usually assign special roles to certain registers, including these
registers:

 An accumulator, which collects the result of computations.


 An address register, which keeps track of where a given instruction or piece of
data is stored in memory. Each storage location in memory is identified by an
address, just as each house on a street has an address.
 A storage register, which temporarily holds data taken from or about to be sent to
memory.
 A general-purpose register, which is used for several functions.
Ciclo de máquina
 The Machine Cycle
 Fetch -get an instruction
from Main Memory
 Decode -translate it into
computer commands
 Execute -actually process
the command
 Store -write the result to
Main Memory
Instrucciones de un lenguaje de
programación a lenguaje de
máquina, listas para el fetch
5+6=?
 For example, to add the numbers 5 and 6 and show the answer on the
screen requires the following steps:
 1. Fetch instruction:"Get number at address 123456"
 2.Decode instruction.
 3.Execute:ALU finds the number. (which happens to be 5)
 4.Store:The number 5 is stored in a temporary spot in Main Memory.
 5 - 8 Repeat steps for another number (= 6)
 9.Fetch instruction:"Add those two numbers“
 10.Decode instruction.
 11.Execute:ALU adds the numbers.
 12.Store:The answer is stored in a temporary spot.
 13.Fetch instruction:"Display answer on screen.“
 14.Decode instruction.
 15.Execute:Display answer on screen.
Ejecución de
instrucciones
 The control unit fetches (gets) the
instruction from memory.
 The control unit decodes the instruction
(decides what it means) and directs that
the necessary data be moved from
memory to the arithmetic/logic unit.
These first two steps together are called
instruction time, or I-time.
 The arithmetic/logic unit executes the
arithmetic or logical instruction. That is,
the ALU is given control and performs
the actual operation on the data.
 Thc arithmetic/logic unit stores the result
of this operation in memory or in a
register. Steps 3 and 4 together are
called execution time, or E-time.

 The control unit eventually directs


memory to release the result to an
output device or a secondary storage
device. The combination of I-time and E-
time is called the machine cycle.
Velocidad
 The immense speed of the computer
enables it to do millions of such steps in
a second.
 In fact, MIPS, standing for millions of
instructions per second, is one way to
measure computer speeds.
IA-32
Pipeline
 is a series of stages, where some work is done at
each stage. The work is not finished until it has
passed through all stages.

 "A significant aspect of our civilization is the division of


labor. Major engineering achievements are based on
subdividing the total work into individual tasks which
can be handled despite their inter-dependencies.
 "Overlap and pipelining are essentially operation
management techniques based on job sub-
divisions under a precedence constraint."
¿Quién lava la ropa?
Tipos de pipelines

 Instructional pipeline
 where different stages of an instruction fetch
and execution are handled in a pipeline.
 Arithmetic pipeline
 where different stages of an arithmetic
operation are handled along the stages of a
pipeline.
Pipelining
 A technique used in advanced microprocessors where
the microprocessor begins executing a second
instruction before the first has been completed.
 That is, several instructions are in the pipeline
simultaneously, each at a different processing stage.
 Pipelining allows us to break up the task of executing a
single instruction into multiple steps. By breaking it up
into multiple steps, the cycle time will be limited not by
the total time for all the steps, but rather by the longest
step.
 In fact, pipelining is something that comes naturally to
people in other parts of life.
Procesador Pipeline
 "A pipeline processor consists
of a sequence of processing
circuits, called segments or
stages, through which a
stream of operands can be
passed.
 "Partial processing of the
operands takes place in each
segment.
 "... a fully processed result is
obtained only after an
operand set has passed
through the entire pipeline."
Pipeline de 8 etapas
Pipeline PowerPC G5
Investigación 3
 ¿Cuánta memoria consume un SO?
 ¿Cuánta memoria consume una aplicación?
 Qué sucede cuando el pipeline sufre retrasos
 ¿Cuanta energía consumen las computadoras?
 Escritorio
 Portátiles
 ¿Cuánta energía consumen otros dispositivo con
capacidades de cómputo?
 Teléfonos celulares
 Asistentes personales
 GPS
Referencias (UP)
 http://homepage.cs.uri.edu/faculty/wolfe/book/Readings/Reading04.htm
 http://en.wikipedia.org/wiki/Instruction_cycle
 http://www.jegsworks.com/Lessons/lesson4/lesson4-4.htm
 WinDLX http
://www.cc.ndsu.nodak.edu/instruct/tareski/ee774f96/notes/windlx/
 http://plato.stanford.edu/entries/turing-machine/
 http://rds.yahoo.com/_ylt=A9G_bDlIgeJIDekAhuGjzbkF
/SIG=127npm0pu/EXP=1222890184/**http
%3A//www.cise.ufl.edu/~mssz/CompOrg/CDA-
pipe.html
Referencias (memoria)
 http://computer.howstuffworks.com/comp
uter-memory.htm
 http://www.ladyada.net/learn/proj1/blinky.
html

También podría gustarte