You are on page 1of 86

Digital Design 2

Microprocessors

Instructor: Nguyen Hoang Dung, PhD


© DHBK 2005 2/Chapter1

Your instructor

• Name: Nguyen Hoang Dung

• Department of Electronics and Computer Engineering

 Office: C9-401
 Email: nhdungset@gmail.com

• Research:
 Ultra high speed video camera, Embedded system, Digital design by using FPGA

• Education:
 Course 40, Electronics and Telecommunications, HUT (1997)

 Master in Electronics and Telecommunications (2002),


 Master thesis: Research on the techniques for Voice transmission over Internet
Protocols (VOIP).
 Doctor in Electronics in KinKi Univ. Osaka, Japan in 2011
 Doctor thesis: Evaluation of 16-Mfps 165-Kpixel high sensitivity CCD image
sensor and its applications
© DHBK 2005 3/Chapter1

Course contents
1. Introduction to microprocessor systems
2. The Intel 8088/8086 microprocessors
3. Assembly programming for 8086
4. Memory and I/O Interfacing
5. Interrupt
6. Direct memory access (DMA)
7. Real life microprocessors
© DHBK 2005 4/Chapter1

References
• Slides
• Textbook: Barry B. Brey, The Intel Microprocessors:
8086/8088, 80186/80188, 80286, 80386, 80486, Pentium and
Pentium Pro Processor: Architecture, Programming, and
Interfacing, Fourth Edition, Prentice Hall, 1997.
• Acknowledgement: Special thanks to Professor Rudy
Lauwereins for sharing his slides.
© DHBK 2005 5/Chapter1

Course objective
• After completing this course, students will
 Understand the architecutures and working principles of
microprocessors and microprocessor systems.
 Be able to program microprocessors using assembly
 Be able to select the appropriate microprocessor for a specific
application.
 Understand different microprocessors in real life.
 Be able to design a micro-controller based system.
© DHBK 2005 6/Chapter1

Course evaluation
• Design project (30%)
 Design a AVR microcontroller based system.
 This project is compulsory
• Midterm exam and homework (30%)
 Homework must be completed and handed in on time. Late
submission will result grade 0 for that homework.
 1 midterm exam
• Final exam (40%)
© DHBK 2005 7/Chapter1

Chapter 1
Introduction to microprocessor systems
1.1 Computer history
1.2 Microprocessor classification
1.3 Number systems (re-visited)
1.4 Structrure and working principle of microprocessor
systems
© DHBK 2005 8/Chapter1

Chapter 1
Introduction to microprocessor systems
1.1 Computer history
 Generation -1: The early days (…-1642)
 Generation 0: Mechanical (1642-1945)
 Generation 1: Vacuum tubes (1945-1955)
 Generation 2: Discrete transistors (1955-1965)
 Generation 3: Integrated circuits (1965-1980)
 Generation 4: VLSI (1980-?)
1.2 Microprocessor classification
1.3 Number systems (re-visited)
1.4 Structrure and working principle of microprocessor
systems
© DHBK 2005 9/Chapter1

Chapter 1
Introduction to microprocessor systems
1.1 Computer history
 Generation -1: The early days (…-1642)
 Generation 0: Mechanical (1642-1945)
 Generation 1: Vacuum tubes (1945-1955)
 Generation 2: Discrete transistors (1955-1965)
 Generation 3: Integrated circuits (1965-1980)
 Generation 4: VLSI (1980-?)
1.2 Microprocessor classification
1.3 Number systems (re-visited)
1.4 Structrure and working principle of microprocessor
systems
10/Chapter1

Generation -1: The early days


© DHBK 2005

(…-1642)
• Early counting tables, named abaci, not only formalized this
counting method but also introduced the concept of
positional notation that we use today.
11/Chapter1

Generation -1: The early days


© DHBK 2005

(…-1642)
• In the twelfth century
Muhammad ibn Musa
Al'Khowarizmi developed
the concept of a written
process to be followed to
achieve some goal, and
published this in a book:
hence the word algorithm
12/Chapter1

Generation -1: The early days


© DHBK 2005

(…-1642)
• Codex Madrid - Leonardo Da Vinci (1500)
 Drawing of a mechanical calculator...
© DHBK 2005 13/Chapter1

Chapter 1
Introduction to microprocessor systems
1.1 Computer history
 Generation -1: The early days (…-1642)
 Generation 0: Mechanical (1642-1945)
 Generation 1: Vacuum tubes (1945-1955)
 Generation 2: Discrete transistors (1955-1965)
 Generation 3: Integrated circuits (1965-1980)
 Generation 4: VLSI (1980-?)
1.2 Microprocessor classification
1.3 Number systems (re-visited)
1.4 Structrure and working principle of microprocessor
systems
Generation 0: Mechanical
© DHBK 2005 14/Chapter1

(1642-1945)
• Blaise Pascal, son of a tax collector, created in 1642 an
adding machine with automatic carries from one position to
the next
• Addition was achieved by the underlying gears turning as
each digit was dialed in, the cumulative total being displayed
in a window above the "keyboard”: hardwired algorithm
15/Chapter1

Generation 0: Mechanical
© DHBK 2005

(1642-1945)
• Charles Babbage
recognized in 1822 that
most navigation tables
contained lots of errors
leading to the loss of
ships.
• He applies to the British
Government for
assistance, and receives
the first government grant
for computer research
16/Chapter1

Generation 0: Mechanical
© DHBK 2005

(1642-1945)
17/Chapter1

Generation 0: Mechanical
© DHBK 2005

(1642-1945)
• Babbage designs the Difference Engine for computing the
entries in navigation tables: an application specific hard-coded
machine
18/Chapter1

Generation 0: Mechanical
© DHBK 2005

(1642-1945)
• Ada Augusta King, Countess
of Lovelace, becomes the
first programmer in 1842, by
writing a program for the
Analytical Engine,
Babbage’s second and this
time programmable device
19/Chapter1

Generation 0: Mechanical
© DHBK 2005

(1642-1945)
• The increasing population in the US, and the demands of
Congress to ask more questions in each census, was making
the processing of the data a longer and longer process.
• It was anticipated that the 1890 census data would not be
processed before the 1900 census was due unless something
was done to improve the processing methodology.
• Herman Hollerith won the competition for the delivery of data
processing equipment to assist in the processing of the data
from the 1890 US Census
• The company he founded, Hollerith Tabulating Company,
eventually became one of the three that composed the
Calculating-Tabulating-Recording (C-T-R) company in 1914,
and eventually was renamed IBM in 1924.
20/Chapter1

Generation 0: Mechanical
© DHBK 2005

(1642-1945)
21/Chapter1

Generation 0: Mechanical
© DHBK 2005

(1642-1945)
• Joseph-Marie Jacquard invented in 1801 an automatic loom
using punched cards for the control of the patterns in the
fabrics
• Algorithm in software on punched cards: general purpose
machine
22/Chapter1

Generation 0: Mechanical
© DHBK 2005

(1642-1945)
• Konrad Zuse, in Berlin, Germany, developed in 1935 his Z-1
computer in his parent's living room, a relay computer, using
binary arithmetic.
• Instruction cycle time: 6 seconds (0.17 Hz)
23/Chapter1

Generation 0: Mechanical
© DHBK 2005

(1642-1945)
• The first large scale, automatic, general purpose,
electromechanical calculator was the Harvard Mark I (AKA
IBM Automatic Sequence Control Calculator [ASCC])
conceived by Howard Aiken in the late 1930’s
• The ASCC was not a stored program machine but instead was
driven by a paper tape containing the instructions.
24/Chapter1

Generation 0: Mechanical
© DHBK 2005

(1642-1945)
• Grace Murray Hopper found the first computer bug beaten to
death in the jaws of a relay. She glued it into the logbook of
the computer and thereafter when the machine stops
(frequently) she told Howard Aiken that they are "debugging"
the computer.

Numbered pages
for USA patents

Lab book!!
© DHBK 2005 25/Chapter1

Chapter 1
Introduction to microprocessor systems
1.1 Computer history
 Generation -1: The early days (…-1642)
 Generation 0: Mechanical (1642-1945)
 Generation 1: Vacuum tubes (1945-1955)
 Generation 2: Discrete transistors (1955-1965)
 Generation 3: Integrated circuits (1965-1980)
 Generation 4: VLSI (1980-?)
1.2 Microprocessor classification
1.3 Number systems (re-visited)
1.4 Structrure and working principle of microprocessor
systems
26/Chapter1

Generation 1: Vacuum tubes


© DHBK 2005

(1945-1955)
• Work on ENIAC was
started in 1943 by
John Mauchly (left)
and J. Presper
Eckert
© DHBK 2005 27/Chapter1

Generation 1: Vacuum tubes

• 18000 vacuum tubes, 1500 relays, 30 ton, 140 kW, 20 registers of 10


decimal digits
• “In the future computers will weigh at most 1.5 ton” (Popular
Mechanics, 1949)
© DHBK 2005 28/Chapter1

Generation 1: Vacuum tubes

• Programmed via 6000 multi-choice switches and tons of wires


© DHBK 2005 29/Chapter1

Generation 1: Vacuum tubes


• In 1946, John von Neumann invented the stored program
machine: the program was not anymore stored in switches
and wires or on punched paper, but in program memory
• He designed a computer architecture consisting of a
controller, an ALU with accumulator and a program/data
memory, and was the first to use binary arithmetic instead of
decimal arithmetic
• Today’s computers still have this von Neumann architecture
• He lay the foundation for the “von Neumann bottleneck”, i.e.
the bottleneck between the memory and the rest of the
computer; all newer designs have been focussing on
removing this bottleneck
© DHBK 2005 30/Chapter1

Generation 1: Vacuum tubes


• In 1948, the first stored program machine was operational at
the University of Manchester: the Manchester Mark I
© DHBK 2005 31/Chapter1

Generation 1: Vacuum tubes


• In 1951, the Whirlwind computer was the first to employ
magnetic core memories, a principle that is popping up
recently again (MRAM), but then in integrated form
© DHBK 2005 32/Chapter1

Generation 1: Vacuum tubes


• A magnetic core, storing 256 bits
© DHBK 2005 33/Chapter1

Generation 1: Vacuum tubes


• John von Neumann in 1952 with his new machine
© DHBK 2005 34/Chapter1

Generation 1: Vacuum tubes


• In 1954, John Backus of IBM developed of a programming
language allows users to express their problems in commonly
understood mathematical formulae: FORTRAN
• The first FORTRAN compiler consisted of 2000 punched cards
(2000 lines of - undocumented -code)
• Still most scientific programs are written in FORTRAN
© DHBK 2005 35/Chapter1

Chapter 1
Introduction to microprocessor systems
1.1 Computer history
 Generation -1: The early days (…-1642)
 Generation 0: Mechanical (1642-1945)
 Generation 1: Vacuum tubes (1945-1955)
 Generation 2: Discrete transistors (1955-1965)
 Generation 3: Integrated circuits (1965-1980)
 Generation 4: VLSI (1980-?)
1.2 Microprocessor classification
1.3 Number systems (re-visited)
1.4 Structrure and working principle of microprocessor
systems
36/Chapter1

Generation 2: Discrete transistors


© DHBK 2005

(1955-1965)
• William Shockley, John Bardeen, and Walter Brattain invent
in 1947 the "transfer resistance" device, later to be known as
the transistor
37/Chapter1

Generation 2: Discrete transistors


© DHBK 2005

(1955-1965)
• In 1955, IBM unveiled its IBM704, a mainframe computer using
discrete transistors, connected to several dumb terminals
• The idea of central computer centers with distributed data input
and output was born
• First machine with floating point logic (5 kFlops, clock: 300 kHz)
© DHBK 2005 38/Chapter1

Chapter 1
Introduction to microprocessor systems
1.1 Computer history
 Generation -1: The early days (…-1642)
 Generation 0: Mechanical (1642-1945)
 Generation 1: Vacuum tubes (1945-1955)
 Generation 2: Discrete transistors (1955-1965)
 Generation 3: Integrated circuits (1965-1980)
 Generation 4: VLSI (1980-?)
1.2 Microprocessor classification
1.3 Number systems (re-visited)
1.4 Structrure and working principle of microprocessor
systems
39/Chapter1

Generation 3: Integrated circuits


© DHBK 2005

(1965-1980)
• In 1958, Jack St. Clair Kilby of Texas Instruments (Nobel
prize physics, 2000) conceived and proved his idea of
integrating one transistor with resistors and capacitors on a
single semiconductor chip (size: half paper clip), which is a
monolithic IC: a phase shift oscillator.
40/Chapter1

Generation 3: Integrated circuits


© DHBK 2005

(1965-1980)
• The world of computing changed radically on April 7, 1964
when IBM announced System/360, the first IBM family of
compatible machines.
41/Chapter1

Generation 3: Integrated circuits


© DHBK 2005

(1965-1980)
• While some companies were
developing bigger and faster
machines, Digital Equipment
Corporation introduced the
PDP-8 in 1965, the first TRUE
minicomputer.
• The PDP-8 had a minuscule
instruction set and a
primitive micro-language,
and excellent interface
capability. Thus the PDP-8
became used extensively as
a process control system
© DHBK 2005 42/Chapter1

Chapter 1
Introduction to microprocessor systems
1.1 Computer history
 Generation -1: The early days (…-1642)
 Generation 0: Mechanical (1642-1945)
 Generation 1: Vacuum tubes (1945-1955)
 Generation 2: Discrete transistors (1955-1965)
 Generation 3: Integrated circuits (1965-1980)
 Generation 4: VLSI (1980-?)
1.2 Microprocessor classification
1.3 Number systems (re-visited)
1.4 Structrure and working principle of microprocessor
systems
© DHBK 2005 43/Chapter1

Generation 4: VLSI (1980-?)


• In 1971, Ted Hoff produced the Intel 4004 in response to the
request from a Japanese company (Busicom) to create a chip
for a calculator. It is the first microprocessor, i.e. the first
processor-on-a-chip (2400 TOR)
© DHBK 2005 44/Chapter1

Generation 4: VLSI (1980-?)


• Developers Edward Roberts, William Yates and Jim Bybee spent 1973-1974
to develop the MITS Altair 8800, the first personal computer.
• Priced $375, it contained 256 bytes of memory, but had no keyboard, no
display, and no auxiliary storage device.
• Later, Bill Gates and Paul Allen wrote their first product for the Altair -- a
BASIC compiler
© DHBK 2005 45/Chapter1

Generation 4: VLSI (1980-?)

• IBM entered the field in 1981 with the IBM "PC"


and supported by the DOS operating system
developed under an agreement that gave Microsoft
all the profits in exchange for the development
costs having been borne by Microsoft.
© DHBK 2005 46/Chapter1

Generation 4: VLSI (1980-?)


• In 1984, Xerox PARC (Palo Alto Research Center) presented
the Alto, a desktop workstation with a novel user interface:
windows, icons, mouse

First mouse
© DHBK 2005 47/Chapter1

Generation 4: VLSI (1980-?)


• In 1986, the Cray-XMP supercomputer with 4 processors
reached a peak performance of 840 MFlops. It was water-
cooled.
© DHBK 2005 48/Chapter1

Generation 4: VLSI (1980-?)


• The same performance has been reached in a PC by a single
chip, the Pentium III, in Q1 2000
© DHBK 2005 49/Chapter1

Generation 4: VLSI (1980-?)

Source: Intel
© DHBK 2005 50/Chapter1

Generation 4: VLSI (1980-?)

Source: Intel
© DHBK 2005 51/Chapter1

Generation 4: VLSI (1980-?)

Source Intel
© DHBK 2005 52/Chapter1

Generation 4: VLSI (1980-?)

Moore’s law: number of transistors doubles every 18 months


(Gordon Moore, founder Intel Corp.)
© DHBK 2005 53/Chapter1

Chapter 1
Introduction to microprocessor systems
1.1 History of computers
1.2 Microprocessor classification
1.3 Number systems (re-visited)
1.4 Structrure and working principle of microprocessor
systems
© DHBK 2005 54/Chapter1

1.2 Microprocessor classification


© DHBK 2005 55/Chapter1

1.2 Microprocessor classification

• BMW > 100 processors


• A US citizen has on averagee ~ 75 processors

*Intelligent Transportation *Cabin Air


System (ITS)       
Quality
*Lighting
*Safety Systems

*Engine
Performance and
Emission Control
(Traction Control)

*Suspension *Digital Car


*Steering Controls*Entertainment
and
Braking Control
*Gear Box Radio
© DHBK 2005 56/Chapter1

1.2 Microprocessor classification


Classification according to cost:

Type Giá (USD) Example application


Disposable system 1 Greeting cards
Embedded system 10 Watches, cars,
appliances
Game computer 100 Home video games
Personal computer 1K Desktop computer
Server 10K Network server
Collection of 100K Departmental
workstations supercomputer
Mainframe 1M Batch processing in
bank
Supercomputer 10M Weather forecasting
© DHBK 2005 57/Chapter1

1.2 Microprocessor classification


• Classification according to purpose:
 General Purpose Microprocessor
 DSP (Digital Signal Processor)
 Microcontroller
 ASIP (Application Specific Integrated Processor)
© DHBK 2005 58/Chapter1

1.2 Microprocessor classification


• Classification according to instruction set:
 CISC (complex Instruction Set computer):
 Many instructions
 Complex hardware
 Instructions have different lengths and can be executed in many clock cycles.
 E.g: Intel x86, AMD
 RISC (reduced instruction Set computer):
 Few instructions
 Each instruction has a fixed length and is executed in one or two clock cycle.
 Simple hardware, many registeres
 Higher clock frequency and low power consumption
 E.g. ARM, PowerPC
© DHBK 2005 59/Chapter1

1.2 Microprocessor classification


Von Neumann vs. Harvard
© DHBK 2005 60/Chapter1

Chapter 1
Introduction to microprocessor systems
1.1 Computer history
1.2 Microprocessor classification
1.3 Number systems (re-visited)
 Decimal, Binary, Octal, Hexadecimal
 Addition, subtraction, multiplication, division
 Negative numbers
 Integer, fixed point, fractional, floating point, BCD, ASCII
1.4 Structrure and working principle of microprocessor
systems
© DHBK 2005 61/Chapter1

Decimal
• 1234.56710=
 1•1000+2•100+3•10+4•1+5•0.1+6•0.01+7•0.001
 1•103+2•102+3•101+4•100+5•10-1+6•10-2+7•10-3
 r = radix (r = 10), d=digit (0  d  9), m = #digits before
radix point (decimal point), n = #digits after decimal point

m 1
D d
i n
i r i

1/61
© DHBK 2005 62/Chapter1

Binary
• 1011.0112=
 1•8+0•4+1•2+1•1+0•0.5+1•0.25+1•0.125
 1•23+0•22+1•21+1•20+0•2-1+1•2-2+1•2-3
 r = radix (r = 2), d = digit (0  d  1), m = #digits before
radix point (binary point), n = #digits after radix point

m 1
B d
i n
i 2 i

1/62
© DHBK 2005 63/Chapter1

Octal
• 7654.328=
 7•512+6•64+5•8+4•1+3•0.125+2•0.015625
 7•83+6•82+5•81+4•80+3•8-1+2•8-2
 r = radix (r = 8), d = digit (0  d  7), m = #digits before
radix point (octal point), n = #digits after radix point

m 1
O d
i n
i 8 i

1/63
© DHBK 2005 64/Chapter1

Hexadecimal
• FEDC.7616=
 15•4096+14•256+13•16+12•1+7•1/16+6•1/256
 15•163+14•162+13•161+12•160+7•16-1+6•16-2
 r = radix (r = 16), d = digit (0  d  F), m = #digits before
radix point (hexadecimal point), n = #digits after radix
point
m 1
H d
i  n
i  16 i

1/64
© DHBK 2005 65/Chapter1

Binary addition
• Decimal addition
carry 010

x 8273

y 562

sum 8835

• Binary addition

carry 0011111

x 10011011

y 1010111

sum 11110010

1/65
© DHBK 2005 66/Chapter1

Binary multiplication

1110

1101

1110

0000
1110

1110

10110110

• Multiplication by repeated add & shift: number of


cycles = number of bits of multiplier
• Can be implemented in a faster way
1/66
© DHBK 2005 67/Chapter1

Binary division

10111010 1110
1110
1101
1001010
1110
10010
0000
10010
1110
100

• Division by repeated subtract & shift: number of


cycles = number of bits of result
• Mostly done this way
1/67
© DHBK 2005 68/Chapter1

Sign-Magnitude representation
• Each number consists of two parts : sign and
magnitude
• Decimal example: +12310 (by convention also ‘123’)
and -12310
• Binary: sign represented by MSB; ‘0’ = positive, ‘1’ =
negative
• Binary example: 011002 = +1210 en 101002 = -1210
• A sign-magnitude integer with n bits lies between -
(2n-1-1) and +(2n-1-1) with two representations for 0:
000...0 en 100...0
• Generic representation of a sign-magnitude
integer: B = <s,m>

1/68
69/Chapter1

Sign-Magnitude addition and


© DHBK 2005

subtraction
Start Start
subtraction addition

s2=s’2

no s1=s2 yes

no yes
m1>m2

no m1<m2 yes

mr=0 mr=m2-m1 mr=m1-m2 mr=m1+m2


sr=0 sr=s2 sr=s1 sr=s1

End
1/69
70/Chapter1

Sign-Magnitude addition and


© DHBK 2005

subtraction
• Multiplication and division are repeated
add/subtract & shift and can hence be carried out
with such an adder/subtractor
• Sign-magnitude representation leads to slow,
expensive adder/subtractor due to repeated
comparison and test of sign and magnitude
• This is why we represent numbers mostly using
two’s complement notation

1/70
© DHBK 2005 71/Chapter1

Two’s complement notation


• Radix-complement of a number D with m digits is
D* = rm - D
• eg. The 10-complement of 12310 is
103 - 12310 = 87710
• eg. The 2-complement of 11012 is
24 - 1310 = 310 = 00112
• Call D’ the digit complement, then D*=D’+1 (proof in
book); this offers us an easier way of determining
the two’s complement:
• eg. The 2-complement of 11012 is
00102 + 00012 = 00112

1/71
© DHBK 2005 72/Chapter1

Two’s complement notation


• How do we negate a number D, i.o.w. how do we
obtain -D?
• D* = rm - D  D* + D = rm = 0 when we retain only
the m least significant digits 
D* = -D
• eg. D=00112  D*=11002+00012=11012
D+D*=00112+11012=100002=24=0 when we retain
only the m least significant bits; we may hence use
D*=11012 for the binary representation of -D=-310
• What is the negation of D=00002?
D*=11112+00012=100002=00002
There is only 1 notation for ‘zero’
• A 2-complement integer with n bits lies between -
(2n-1) and +(2n-1-1)

1/72
© DHBK 2005 73/Chapter1

Two’s complement notation


Decimal 2-complement Sign-magnitude
-8 1000 -
-7 1001 1111
-6 1010 1110
-5 1011 1101
-4 1100 1100
-3 1101 1011
-2 1110 1010
-1 1111 1001
0 0000 1000 & 0000
1 0001 0001
2 0010 0010
3 0011 0011
4 0100 0100
5 0101 0101
6 0110 0110
7 0111 0111

Negating a 2-complement number requires many more


bit-flips than negating a sign-magnitude number:
1/73 sign-magnitude is less power hungry than 2-complement
74/Chapter1

Two’s complement addition and


© DHBK 2005

subtraction
Start Start
subtraction addition

B2=B’2+1

Br=B1+B2

End

• The negation needed for the subtraction is done by taking the


bit-complement of B2; the addition of the ‘1’ is done by putting
the LSB carry-in of the next addition to 1.
1/74
75/Chapter1

Two’s complement addition and


© DHBK 2005

subtraction
Addition

0010 +2 0010 +2 1110 - 2


0100 +4 1100 - 4 1100 - 4
+ 00000 + 00000 + 11000
0110 +6 1110 - 2 1010 - 6

Subtraction

0010 +2 0010 +2 1110 - 2


1011 (+4)’ 0011 (- 4)’ 0011 (- 4)’
+ 00111 + 00111 + 11111
1110 - 2 0110 +6 0010 +2
Overflow

0111 +7 1001 - 7
0110 +6 1010 - 6
+ 01100 + 10000
1101 - 3 0011 +3
1/75
© DHBK 2005 76/Chapter1

Little endian and big endian


• How is 1234 H stored in 8 bit memory?

FFFFH FFFFH

..... .....

0101H 12H 0101H 34H


0100H 34H 0100H 12H
..... .....
0000H 0000H

little edian big edian


Intel microprocessors Motorola microprocessors
© DHBK 2005 77/Chapter1

Floating point number


• Example: 1,234=1,234*100=0,1234*101=...
• 11,01 B= 1,101*21=0,1101*22=...

mantissa exponent

• Real number: (m, e) , e.g. (0.1101, 2)


 Single precision: 32 bit
 Double precision: 64 bit
© DHBK 2005 78/Chapter1

Floating point number


• IEEE-754 format for single-precision

31 30 23 22 0

S biased exponent e fraction f of normalized mantissa

1 sign bit: 0 positive, 1 negative


8 bit biased exponent= exponent + 127
24 bit normalized mantissa = 1 hidden bit + 23 bit fraction

Normalized Mantissa lies between 1 and 2 : 1.f

Example: Represent 0.1011 in IEEE-754 format

Sign bit s=0


Normalize mantissa: 0.1011=1.011*2-1
Biased exponent: -1 + 127=126=01111110
IEEE format: 0 01111110 0110000000000000000000
© DHBK 2005 79/Chapter1

Floating point number


• IEEE-754 format for double-precision

63 62 52 51 0

S biased exponent e fraction f of normalized mantissa

1 sign bit: 0 positive, 1 negative


11 bit biased exponent= exponent + 1023
53 bit normalized mantissa = 1 hidden + 52 bit fraction

single precision: (-1)s x 2e-127 x (1.f)2

double precision: (-1)s x 2e-1023 x (1.f)2


© DHBK 2005 80/Chapter1

BCD
• Binary Coded Decimal number

Decimal BCD
digit
0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001

1/80
81/Chapter1

ASCII
© DHBK 2005

• American Standard Code for Information Interchange (7-bit


code)

b3b2b1b0 000 001 010 011 100 101 110 111


0000 NUL DLE SP 0 @ P ‘ p
0001 SOH DC1 ! 1 A Q a q
0010 STX DC2 “ 2 B R b r
0011 ETX DC3 # 3 C S c s
0100 EOT DC4 $ 4 D T d t
0101 ENQ NAK % 5 E U e u
0110 ACK SYN & 6 F V f V
0111 BEL ETB ‘ 7 G W g w
1000 BS CAN ( 8 H X h x
1001 HT EM ) 9 I Y i y
1010 LF SUB * : J Z j z
1011 VT ESC + ; K [ k {
1100 FF FS , < L \ l |
1101 CR GS - = M ] m }
1110 SO RS . > N ^ n ~
1/81 1111 SI US / ? O _ o DEL
© DHBK 2005 82/Chapter1

Chapter 1
Introduction to microprocessor systems
1.1 History of computers
1.2 Microprocessor classification
1.3 Number systems (re-visited)
1.4 Structrure and working principle of microprocessor
systems
© DHBK 2005 83/Chapter1

1.4.1 Microprocessor system

Data bus

Control Bus

I/O I/O
Memory CPU
Interface devices

Monitor
Address Bus
Printers
Mouse
DRAM Intel 80X86 ISA Keyboard
SRAM Motorola 680X EISA Harddisk
ROM PowerPC PCI CD-ROM
EEPROM ... VESA DVD
Flash SCSI ...
USB
...
© DHBK 2005 84/Chapter1

1.4.1 Microprocessor system


• CPU (Central Processing Unit)
 Arithmetic Logical Unit
Perform arithmetic operations Instruction Fetch
 Addition, subtraction, multiplication and division
Perform arithmetic operations Instruction Decode
 And, or, compare..
 Control Unit
Instruction Execution
 Registers
Store data, address and instruction during the execution of the
instructions.
© DHBK 2005 85/Chapter1

1.4.2 Memory, BUS


• Memory
 ROM: non volatile, store data and instruction which control the
starting up of the system
 RAM: volatile, store main data and instruction of the system.
• Data bus
 8, 16, 32, 64 bit

• Address bus
 16, 20, 24, 32, 36 bit
 Addressable memory cells: 2N
 E.g. 8088/8086 has 20 address bits => manageable memroy size:
220 bytes=1Mbytes
© DHBK 2005 86/Chapter1

1.4.2 Memory, BUS


Manufacturer Microprocessor name Data bus Address bus Addressable
width width memory size
Intel 8088 8 20 1M
8086 16 20 1M
80186 16 20 1M
80286 16 24 16 M
80386SX 16 24 16 M
80386DX 32 32 4G
80486DX 32 32 4G
Pentium 64 32 4G
Pentium Pro 64 36 64 G
Pentium I, II, III, IV 64 36 64 G
Motorola 68000 16 24 16 M
68010 16 24 16 M
68020 32 32 4G
68030 32 32 4G
68040 32 32 4G
68060 64 32 4G
PowerPC 64 32 4G

You might also like