Transcript Physics 121

Physics 413
Chapter 1
Computer Architecture
• What is a Digital Computer ? A computer is
essentially a fast electronic calculating machine.
• What is a program ? A program is a set of very
simple instructions that a computer can
understand. Examples of simple instructions are
ADD two numbers, Is X > Y?, COPY A into the
memory.
• What is Machine Language ? The set of
exceedingly simple and primitive instructions that
a computer can understand is called the
Instruction Set or Machine Language.
Architecture and Organization
• Computer Architecture deals with the design
of those components of a computer that are
accessible to a programmer. For instance, the
Motorola 6800 does not have a MUL
instruction but the Pentium does.
• Computer Organization deals with the
implementation of the architecture and may
be transparent to the programmer. For
instance, precisely how is MUL implemented
in the hardware?
Levels of Abstraction
• L5
High-level Language (C++, Java)
• L4
Assembly Language
• L3
Operating System
• L2
Instruction Set Architecture (ISA)
• L1
Microarchitecture Level
• L0
Digital Logic Level
•
Transistors
A Brief History of Computers
• First Generation - Vacuum Tubes - 1945-1955
ENIAC (Electronic Numerical Integrator and
Computer) had 18,000 Vacuum Tubes, 1500
relays and weighed 30 tons
• Second
Generation - Transistors - 1955-65 - PDP -8
(DEC)
• Third Generation - IC - 1965-80 - IBM 360
• Fourth Generation - 1980- ?
VLSI - Pentium4 -PowerPC (G4) - SPARC
Intel and Motorola/IBM Microprocessors
CPU
Year
4004 1971
8088 1979
P4
2000
6800 1974
G4
1999
Data/Address
4/8
8 / 20
64 / 32
8 / 16
64 / 32
Clock
108 kHz
8 MHz
3 GHz
1 MHz
800 MHz
Transistors
2,300
30,000
42 M
6000
10.5 M
CISC Complex Instruction Set Computers (6800)
RISC Reduced Instruction Set Computers (G4)
CISC + RISC ( Pentium 4 )
EPIC Explicitly Parallel Instruction Computing
Intel + HP
Itanium (www.dell.com)
Moore’s Law
The number of transistors on a chip doubles
every 18 months
Example: From 1992 -1995 memory chip size
quadrupled from 16M to 64 M
All about microprocessors
• ROM is where the program that initializes the PC is
stored.
• RAM access is fast
• ADDRESS BUS carries the address of RAM, ROM,
and other peripherals
• 6800 has 16 address lines, A0 through A15
• DATA BUS carries data back and forth between the
microprocessor and RAM, ROM, and other
peripherals. The 6800 has a data bus that is 8 bits
wide.
What is a von Neumann Machine?
• von Neumann was a world-renowned
mathematician. In 1952 he pointed out the
primitive architecture of the ENIAC which had
to be programmed by moving jumpers and
cables and used 10 switches to represent the
digits 0-9. von Neumann’s machine used
binary digits 0-1 and stored program and data
in memory. The ALU had an accumulator.
Today’s computers are essentially von
Neumann machines.
What is a Virtual Machine?
A Virtual Machine is a software implementation for
which no direct hardware implementation exists.
This is really a buzz word. All high-level languages
and assembly languages are “ virtual machines” !
The term “Java Virtual Machine” is being bandied
about a lot these days. It is simply a Java
Program. Ultimately, all “virtual machines” have to
be implemented in hardware to get “real results”!
Memory
• Big Endian: 4 bytes arranged as:0123 (32-bit
word)
• Little Endian: 4 bytes arranged 3210 (32-bit
word)
• DRAM Organization
• nxn matrix structure is popular for large
memory sizes
• RAS - Row Address Strobe
• CAS - Column Address Strobe
• RAS - CAS strategy reduces the number of
pins but slows down access because two
addressing cycles are required
• SRAM Fast for cache
ROM
• ROM
• PROM
• EPROM - UV erasable
• EEPROM - Electrically erasable byte at a time
• FLASH - electrical block erasable - digital
film - more like RAM!
Hamming Code
• Detecting errors is easy (attach a parity bit)
• Correcting errors is complex and requires
Hamming code with several parity bits
• Hamming distance between two code words is the
number of single bit errors required to convert one
code word to another. Example: 1101 and 1110 are
a distance 2 apart
• n = m + r where r = parity bits, m = bits in the
original data and n = total number of bits
transmitted
2r >= m+r+1
• Example: For 8-bit code one needs 4 parity bits for
a total of 12 bits
• Parity bits are bits 1, 2, 4, 8 etc (P1, P2, P4, P8 )
•
•
•
•
•
•
•
•
3 = 1+2
5 = 1+4
6 = 2+4
7 = 1+2+4
9 = 1+8
10 =2+8
11 = 1+2+8
12 = 4+8
P1
P2
P4
P8
checks
checks
checks
checks
bits
bits
bits
bits
3, 5, 7, 9, 11
3,6,7,10,11
5,6,7,12
9,10,11,12
Problemo du Jour ...
• Example We need to send 11101001. What 12-bit
Hamming word should we send?
Solution de Problemo du Jour …
101111001001
IEEE – 754 Floating Point Format (32-bit)
• 1 sign bit 8 exponent bits 23 significand bits
• sign bit is 0 for positive numbers and 1 for negative
numbers
• exponent is in “excess-127” format so an exponent
of +4 will be written as +131 and an exponent of –9
will be written as +118. Hence exponents can
range from -127 to +128 (written as 0 through 255)
•
• The “normalized” significand must be in the form
1.xxxxx…. Hence only the xxxxx part is actually
written in the 23 bits and “1.” is understood
Convert 10.125 to IEEE-754 format
• 10.125 (decimal) = +1010 .001000
•
= +1 .010001000 x 23 (normalized)
• Our sign bit = 0
• Our exponent = 3 or 130 (excess 127) = 10000010
• Our significand = 0100010000 . . . ( 13 more zeros!)
• Putting it all together we get . . .
• 10.125 = 0100000100100010 . . . (16 more zeros)
•
= 41220000 (hex)