Documente Academic
Documente Profesional
Documente Cultură
Computer Architecture
Computer Organization
Computer Architecture
Device Controllers
Memory mapped I/O
Direct Memory Access (DMA)
Instruction Set
Data transfer operations
Arithmetic / logic operations
Control flow instructions
Computer basics
Smallest thing a computer knows is a bit 0 or 1
(false/true)
CPU knows how to perform and, or, xor
(exclusive or) operations
And returns true if both same
Or returns true if either true
Xor returns true if different
Basics
The number of instructions per seconds is set by
the clock speed, e.g., 500 MHz Pentium III
One clock tick is called a cycle, modern CPUs
can often execute more than one instruction per
cycle
All programs end up as set of instructions to be
executed by the CPU (compilers/linkers or
interpreters do this for you)
Floating point speed is measured in floating
point operations per seconds, or flops
Program Execution
The machine cycle
Stored Program
Mnemonics
It is hard to remember commands as numbers
Use words associated with the numbers
Components: OS
The Operating System (OS)
Controls everything in the way the computer works.
Not Specific to a CPU type but often some OSs are
associated with specific CPUs
G3/4/5 68x series MacOS
Pentium, x86 DOS (Windows)
SPARC Solaris (Unix)
Programming interface to OS
Depending on language used, OS
interface may or may not be important
For Fortran, C, C++ when program is
linked OS routines are needed
How to read from keyboard or file?
How to write to screen or disk?
Storage in memory
Memory may be treated as a linear array of
bytes from 1 to <size of memory>
The OS keeps track of which parts of memory
are being used and which parts are still free for
use by programs and data
Some computers do byte-swapping, i.e., the
bytes are not counted linearly but rather are
switched. The main (but not only) styles are Big
Endian (HP, Sun, Macs) and Little Endian (PC).
Affects ability to transfer binary data (TCP knows
this and will accommodate this up to a certain
degree)
Hard disks
Hard disks contain the
computers file system (allows
access through file names)
Directory structure points to
where files are located (reason
for having less space available
than the size of disk + some
calibration tracks)
Actual content of HD and
directories depend on OS used
(different standards exist, e.g.,
FAT16, FAT32, NTFS for
Windows, EXT2 for Linux
In general, OS can only use
their own file-system
Module type
Max.
Transfer, MB/s
SD RAM, PC100
800
SD RAM, PC133
1064
Rambus, PC800
1600
3200
2128
2664
3200
6400
DUAL DDR2-400
8600
DUAL DDR2-533
10600
Integers
Integer numbers can be represented exactly (up
to the range allowed by the number of bytes)
A 2-byte integer, unsigned 0-65535, signed
32767 (sometimes called short)
A 4-byte integer, unsigned 0-4294967295,
signed 2147483827
(With a 32-bit address bus, can have 4Gbytes of
memoryreason max memory is limited in
computers)
Floating point
Representations vary between machines (often
reason binary files can not be shared)
Example
Note
x 1
x + 20.97
= but =
y 1
y 18.99
Example
Fact: U is unitary is almost the same as
U is a rotation matrix
(almost the same because U might include
reflections).
Fact: For A=UDUT as before, the diagonal
elements of D are the eigenvalues of A and
columns of U are the right eigenvectors of A.
Recall t is an eigenvalue of A iff det(A-tI)=0,
x is the corresponding right eigenvector iff
Ax=tx.
Example
How does A act on x, step-by-step:
Ax=UDUTx=UD(UTx)=U(D(UTx)),
that is, rotate, scale, rotate back.
Define the condition number of A as
(A)=|t|max(A) / |t|min(A)
where |t|max and |t|min are the largest and the smallest in
absolute value eigenvalues of A.
(A) shows how far off the solution to Ax=b may be from
the solution to Ax=b+b (a measure of relative
singularity).
Assignment 2
MATLAB and C code are posted on the web. The MATLAB script is slightly modified in an
attempt to produce a more accurate graph: the C call is referred to several times
using reps counter.
1.
2.
Using the MATLAB script from the class, try to identify the cache size on your
machine. Note that usually a number in MATLAB occupies 8 bytes (double precision
floating point), and that the function requires roughly 2-times the memory needed to
store the x vector (x in the input, x_new in the output). Explain your results. As a
sanity check, you might want to use a CPU info tool.
Condition number I: for the class example, answer the following:
a)
b)
c)
d)
3.
4.
5.
find the matrix spectral decomposition and compute the matrix condition number,
find perturbations b of the right-hand side of the equation with (the Euclidean norm) ||b||=1
that give the largest and the smallest errors in the solution vector; plot each of the two
perturbations, together with their image under UT, under D-1UT and, finally, under A-1,
given the equation for the curve ||b||=1, find its image under A-1 and plot it,
find the explicit expression for the condition number (A- I) for > 0.
Condition number II: given a 2x2 matrix with double-precision entries, what is the
worst condition number this matrix might have? Explain your answer.
Condition number III: for the question 2 of the first assignment, is there any illconditioning (ill-conditioning refers to a matrix having large condition number, hence
often resulting in numerical instability; if you happen to encounter complex
eigenvalues, you are on the wrong track; for the definition in class, matrix must be
symmetric)? Explain your answer.
Bonus question: find all the distinct spectral decompositions of the identity matrix.