EEM336 - 01 - Introduction To The Microprocessor and Computer
EEM336 - 01 - Introduction To The Microprocessor and Computer
Introduction
Overview of Intel microprocessors. Discussion of history of computers. Function of the microprocessor. Terms and jargon (computerese).
EEM336 Microprocessors I
Chapter Objectives
Upon completion of this chapter, you will be able to:
Converse by using appropriate computer terminology such as bit, byte, data, real memory system, protected mode memory system, Windows, DOS, I/O. Detail history of the computer and list applications performed by computer systems. Provide an overview of the various 80X86 and Pentium family members.
EEM336 Microprocessors I
Chapter Objectives
Upon completion of this chapter, you will be able to:
(cont.)
Draw the block diagram of a computer system and explain the purpose of each block. Describe the function of the microprocessor and detail its basic operation. Define the contents of the memory system in the personal computer.
EEM336 Microprocessors I
Chapter Objectives
Upon completion of this chapter, you will be able to:
(cont.)
Convert between binary, decimal, and hexadecimal numbers. Differentiate and represent numeric and alphabetic information as integers, floatingpoint, BCD, and ASCII data.
EEM336 Microprocessors I
11 A HISTORICAL BACKGROUND
Events leading to development of the microprocessor. 80X86, Pentium, Pentium Pro, Pentium III, Pentium 4, and Core2 microprocessors. While not essential to understand the microprocessor, furnishes:
interesting reading historical perspective of fast-paced evolution
EEM336 Microprocessors I
In 1642, mathematician Blaise Pascal invented a calculator constructed of gears and wheels. When moved one complete revolution, a second gear advances one place.
same principle used in automobile odometer
Basis of all mechanical calculators. PASCAL programming language is named in honor of Blaise Pascal.
EEM336 Microprocessors I
EEM336 Microprocessors I
EEM336 Microprocessors I
1948, Development of the transistor 1958, Invention of the integrated circuit (IC) 1960s, Digital integrated circuits 1971, The first microprocessor by Intel
Introduction to the Microprocessor and Computer 11
EEM336 Microprocessors I
Programming Advancements
Once programmable machines developed, programs and programming languages began to appear. As early practice of rewiring circuits proved too cumbersome, computer languages began to appear in order to control the computer. The first, machine language, was constructed of ones and zeros using binary codes.
stored in the computer memory system as groups of instructions called a program
EEM336 Microprocessors I
12
Mathematician John von Neumann, first modern person to develop a system to accept instructions and store them in memory. Computers are often called von Neumann machines in his honor.
EEM336 Microprocessors I
13
Assembly language was then used to simplify entering binary code. Assembler allows programmer to use mnemonic codes
such as ADD for addition
EEM336 Microprocessors I
14
Since early days of programming, additional languages have appeared. Some common modern programming languages are BASIC, PASCAL, C/C++, C#, Java, and ADA.
BASIC and PASCAL languages both designed as teaching languages, but escaped the classroom.
EEM336 Microprocessors I
15
Scientific community uses primarily C/C++. Recent survey of embedded system developers showed C was used by 60%.
30% used assembly language remainder used BASIC and JAVA
These languages allow programmer almost complete control over the programming environment and computer system.
especially C/C++
EEM336 Microprocessors I
16
Assembly also interspersed with C/C++ to perform machine control functions efficiently.
some newer parallel instructions found on Pentium and Core2 microprocessors only programmable in assembly language
EEM336 Microprocessors I
17
Reminder
A bit is a binary digit with a value of one or zero 4-bit-wide memory location is often called a nibble 8-bit-wide memory location is called a byte A word is a collection of 2 bytes (or 16 bits) 1 KB = 1024 Bytes = 210 Bytes(1 KB = 1024 bytes) 1 MB = 1024 KB = 220 Bytes 1 GB = 230 Bytes, 1 TB = 240 Bytes B is used for byte and b is used for bit
8 Mbps = 8 Megabits per second (ADSL speed)
EEM336 Microprocessors I
18
EEM336 Microprocessors I
19
EEM336 Microprocessors I
20
10
1974, Motorola 6800 1974, The first personal computer 1977, Intel 8085
769,230 instructions per second (1.3 s per instr.) internal clack generator and system controller
EEM336 Microprocessors I
21
EEM336 Microprocessors I
22
11
EEM336 Microprocessors I
23
EEM336 Microprocessors I
24
12
Next Microprocessors
Pentium Pro Pentium II Pentium III Pentium IV Core2 Quad Core 64-bit microprocessors
Introduction to the Microprocessor and Computer 25
EEM336 Microprocessors I
Some Definitions
EEM336 Microprocessors I
26
13
Integrated Circuit
a.k.a. IC, microcircuit, microchip, silicon chip, or chip Integrated Circuit is a miniaturized electronic circuit (consisting mainly of semiconductor devices, as well as passive components) that has been manufactured in the surface of a thin substrate of semiconductor material.
EEM336 Microprocessors I
27
Microprocessor
A microprocessor is a programmable digital electronic component that incorporates the functions of a central processing unit (CPU) on a single semiconducting integrated circuit (IC). 8-bit, 16-bit, 32-bit, and 64-bit microprocessor: refers to number of bits manipulated in one operation. It requires external memory to execute programs. It cannot directly interface to I/O devices, peripheral chips are needed.
EEM336 Microprocessors I Introduction to the Microprocessor and Computer 28
14
EEM336 Microprocessors I
30
15
Figure 16 shows block diagram of the personal computer. Applies to any computer system, from early mainframe computers to the latest systems. Diagram composed of three blocks interconnected by buses.
a bus is the set of common connections that carry the same type of information
EEM336 Microprocessors I
31
EEM336 Microprocessors I
32
16
EEM336 Microprocessors I
33
EEM336 Microprocessors I
34
17
Type of microprocessor present determines whether an extended memory system exists. First 1M byte of memory often called the real or conventional memory system.
Intel microprocessors designed to function in this area using real mode operation
EEM336 Microprocessors I
35
The TPA
The transient program area (TPA) holds the DOS (disk operating system) operating system; other programs that control the computer system.
the TPA is a DOS concept and not really applicable in Windows also stores any currently active or inactive DOS application programs length of the TPA is 640K bytes
EEM336 Microprocessors I
36
18
Figure 18 The memory map of the TPA in a personal computer. (Note that this map will vary between systems.)
DOS memory map shows how areas of TPA are used for system programs, data and drivers.
also shows a large area of memory available for application programs hexadecimal number to left of each area represents the memory addresses that begin and end each data area
EEM336 Microprocessors I Introduction to the Microprocessor and Computer 37
19
First area of system space contains video display RAM and video control programs on ROM or flash memory.
area starts at location A0000H and extends to C7FFFH size/amount of memory depends on type of video display adapter attached
EEM336 Microprocessors I
39
Windows Systems
Modern computers use a different memory map with Windows than DOS memory maps. The Windows memory map in Figure 110 has two main areas; a TPA and system area. The difference between it and the DOS memory map are sizes and locations of these areas.
EEM336 Microprocessors I
40
20
TPA is first 2G bytes from locations 00000000H to 7FFFFFFFH. Every Windows program can use up to 2G bytes of memory located at linear addresses 00000000H through 7FFFFFFFH. System area is last 2G bytes from 80000000H to FFFFFFFFH.
EEM336 Microprocessors I Introduction to the Microprocessor and Computer 41
I/O Space
I/O devices allow the microprocessor to communicate with the outside world. I/O (input/output) space in a computer system extends from I/O port 0000H to port FFFFH.
I/O port address is similar to a memory address instead of memory, it addresses an I/O device
Figure 111 shows the I/O map found in many personal computer systems.
EEM336 Microprocessors I
42
21
Access to most I/O devices should always be made through Windows, DOS, or BIOS function calls. The map shown is provided as a guide to illustrate the I/O space in the system.
EEM336 Microprocessors I
43
The area below I/O location 0400H is considered reserved for system devices Area available for expansion extends from I/O port 0400H through FFFFH. Generally, 0000H - 00FFH addresses main board components; 0100H - 03FFH handles devices located on plug-in cards or also on the main board. The limitation of I/O addresses between 0000 and 03FFH comes from original standards specified by IBM for the PC standard.
EEM336 Microprocessors I Introduction to the Microprocessor and Computer 44
22
The Microprocessor
Called the CPU (central processing unit). The controlling element in a computer system. Controls memory and I/O through connections called buses.
buses select an I/O or memory device, transfer data between I/O devices or memory and the microprocessor, control I/O and memory systems
Memory and I/O controlled via instructions stored in memory, executed by the microprocessor.
EEM336 Microprocessors I Introduction to the Microprocessor and Computer 45
Power of the microprocessor is capability to execute billions of millions of instructions per second from a program or software (group of instructions) stored in the memory system.
stored programs make the microprocessor and computer system very powerful devices
EEM336 Microprocessors I Introduction to the Microprocessor and Computer 46
23
Another powerful feature is the ability to make simple decisions based upon numerical facts.
a microprocessor can decide if a number is zero, positive, and so forth
These decisions allow the microprocessor to modify the program flow, so programs appear to think through these simple decisions.
EEM336 Microprocessors I
47
Buses
A common group of wires that interconnect components in a computer system. Transfer address, data, & control information between microprocessor, memory and I/O. Three buses exist for this transfer of information: address, data, and control. Figure 112 shows how these buses interconnect various system components.
EEM336 Microprocessors I
48
24
Figure 112 The block diagram of a computer system showing the address, data, and control bus structure.
EEM336 Microprocessors I
49
The address bus requests a memory location from the memory or an I/O location from the I/O devices.
if I/O is addressed, the address bus contains a 16-bit I/O address from 0000H through FFFFH. if memory is addressed, the bus contains a memory address, varying in width by type of microprocessor.
64-bit extensions to Pentium provide 40 address pins, allowing up to 1T byte of memory to be accessed.
EEM336 Microprocessors I Introduction to the Microprocessor and Computer 50
25
The data bus transfers information between the microprocessor and its memory and I/O address space. Data transfers vary in size, from 8 bits wide to 64 bits wide in various Intel microprocessors.
8088 has an 8-bit data bus that transfers 8 bits of data at a time 8086, 80286, 80386SL, 80386SX, and 80386EX transfer 16 bits of data 80386DX, 80486SX, and 80486DX, 32 bits Pentium through Core2 microprocessors transfer 64 bits of data
EEM336 Microprocessors I Introduction to the Microprocessor and Computer 51
Control bus lines select and cause memory or I/O to perform a read or write operation. In most computer systems, there are four control bus connections: MRDC (memory read control) MWTC (memory write control) IORC (I/O read control) IOWC (I/O write control). overbar indicates the control signal is activelow; (active when logic zero appears on control line)
EEM336 Microprocessors I Introduction to the Microprocessor and Computer 52
26
The microprocessor reads a memory location by sending the memory an address through the address bus. Next, it sends a memory read control signal to cause the memory to read data. Data read from memory are passed to the microprocessor through the data bus. Whenever a memory write, I/O write, or I/O read occurs, the same sequence ensues.
EEM336 Microprocessors I
53
13 NUMBER SYSTEMS
Use of a microprocessor requires working knowledge of numbering systems.
binary, decimal, and hexadecimal
This section provides a background for these numbering systems. Conversions are described.
decimal and binary decimal and hexadecimal binary and hexadecimal
EEM336 Microprocessors I
54
27
Digits
Before converting numbers between bases, digits of a number system must be understood. First digit in any numbering system is always zero. A decimal (base 10) number is constructed with 10 digits: 0 through 9. A base 8 (octal) number; 8 digits: 0 through 7. A base 2 (binary) number; 2 digits: 0 and 1.
EEM336 Microprocessors I Introduction to the Microprocessor and Computer 55
If the base exceeds 10, additional digits use letters of the alphabet, beginning with an A.
a base 12 number contains 10 digits: 0 through 9, followed by A for 10 and B for 11
Common systems used with computers are decimal, binary, and hexadecimal (base 16).
many years ago octal numbers were popular
EEM336 Microprocessors I
56
28
Positional Notation
Once digits are understood, larger numbers are constructed using positional notation.
position to the left of the units position is the tens position left of tens is the hundreds position, and so forth
Exponential powers of positions are critical for understanding numbers in other systems.
EEM336 Microprocessors I Introduction to the Microprocessor and Computer
57
Position to the left of the radix (number base) point is always the units position in system.
called a decimal point only in the decimal system position to left of the binary point always 20, or 1 position left of the octal point is 80, or 1
Any number raised to its zero power is always one (1), or the units position.
EEM336 Microprocessors I Introduction to the Microprocessor and Computer 58
29
Position to the left of the units position always the number base raised to the first power.
in a decimal system, this is 101, or 10 binary system, it is 21, or 2 11 decimal has a different value from 11 binary
In the decimal system, positions right of the decimal point have negative powers.
first digit to the right of the decimal point has a value of 101, or 0.1.
In the binary system, the first digit to the right of the binary point has a value of 21, or 0.5. Principles applying to decimal numbers also generally apply to those in any other system. To convert a binary number to decimal, add weights of each digit to form its decimal equivalent.
EEM336 Microprocessors I Introduction to the Microprocessor and Computer 60
30
EEM336 Microprocessors I
61
Conversion to Decimal
Conversions from decimal to other number systems more difficult to accomplish. To convert the whole number portion of a number to decimal, divide by 1 radix. To convert the fractional portion, multiply by the radix.
EEM336 Microprocessors I
62
31
Continue division until the quotient is a zero. The result is written as 10102 from the bottom to the top.
EEM336 Microprocessors I Introduction to the Microprocessor and Computer 64
32
EEM336 Microprocessors I
65
EEM336 Microprocessors I
66
33
67
Binary-Coded Hexadecimal
Binary-coded hexadecimal (BCH) is a hexadecimal number written each digit is represented by a 4-bit binary number. BCH code allows a binary version of a hexadecimal number to be written in a form easily converted between BCH and hexadecimal. Hexadecimal represented by converting digits to BCH code with a space between each digit.
EEM336 Microprocessors I
68
34
Complements
At times, data are stored in complement form to represent negative numbers. Two systems used to represent negative data:
radix radix 1 complement (earliest)
EEM336 Microprocessors I
69
EEM336 Microprocessors I
70
35
If used with a printer, most significant bits are 0 for alphanumeric printing; 1 for graphics. In PC, an extended ASCII character set is selected by placing 1 in the leftmost bit.
EEM336 Microprocessors I Introduction to the Microprocessor and Computer 71
Extended characters can vary from one printer to another. ASCII control characters perform control functions in a computer system.
clear screen, backspace, line feed, etc.
36
Many Windows-based applications use the Unicode system to store alphanumeric data.
stores each character as 16-bit data
Codes 0000H00FFH are the same as standard ASCII code. Remaining codes, 0100HFFFFH, store all special characters from many character sets. Allows software for Windows to be used in many countries around the world. For complete information on Unicode, visit: http://www.unicode.org
EEM336 Microprocessors I Introduction to the Microprocessor and Computer 73
EEM336 Microprocessors I
74
37
EEM336 Microprocessors I
75
Byte-Sized Data
Stored as unsigned and signed integers. Difference in these forms is the weight of the leftmost bit position.
value 128 for the unsigned integer minus 128 for the signed integer
In signed integer format, the leftmost bit represents the sign bit of the number.
also a weight of minus 128
EEM336 Microprocessors I
76
38
Figure 114 The unsigned and signed bytes illustrating the weights of each binary-bit position.
EEM336 Microprocessors I
77
Unsigned integers range 00H to FFH (0255) Signed integers from 128 to 0 to + 127. Negative signed numbers represented in this way are stored in the twos complement form. Evaluating a signed number by using weights of each bit position is much easier than the act of twos complementing a number to find its value.
especially true in the world of calculators designed for programmers
EEM336 Microprocessors I
78
39
Word-Sized Data
A word (16-bits) is formed with two bytes of data. The least significant byte always stored in the lowest-numbered memory location. Most significant byte is stored in the highest. This method of storing a number is called the little endian format.
EEM336 Microprocessors I
79
Figure 115 The storage format for a 16-bit word in (a) a register and (b) two bytes of memory.
EEM336 Microprocessors I
80
40
Figure 116 The storage format for a 32-bit word in (a) a register and (b) 4 bytes of memory.
EEM336 Microprocessors I
81
Alternate method is called the big endian format. Numbers are stored with the lowest location containing the most significant data. Not used with Intel microprocessors. The big endian format is used with the Motorola family of microprocessors.
EEM336 Microprocessors I
82
41
Doubleword-Sized Data
Doubleword-sized data requires four bytes of memory because it is a 32-bit number.
appears as a product after a multiplication also as a dividend before a division
EEM336 Microprocessors I
83
Real Numbers
Since many high-level languages use Intel microprocessors, real numbers are often encountered. A real, or a floating-point number contains two parts:
a mantissa, significand, or fraction an exponent.
42
Figure 117 The floating-point numbers in (a) single-precision using a bias of 7FH and (b) double-precision using a bias of 3FFH.
EEM336 Microprocessors I
85
The assembler can be used to define real numbers in single- & double-precision forms:
use the DD directive for single-precision 32-bit numbers use define quadword(s), or DQ to define 64-bit double-precision real numbers
EEM336 Microprocessors I
86
43
SUMMARY
Mechanical computer age began with the advent of the abacus in 500 B.C. This first mechanical calculator remained unchanged until 1642, when Blaise Pascal improved it. An early mechanical computer system was the Analytical Engine developed by Charles Babbage in 1823.
EEM336 Microprocessors I
87
SUMMARY
(cont.)
The first electronic calculating machine was developed during World War II by Konrad Zuse, an early pioneer of digital electronics. The Z3 was used in aircraft and missile design for the German war effort. The first electronic computer, which used vacuum tubes, was placed into operation in 1943 to break secret German military codes.
EEM336 Microprocessors I
88
44
SUMMARY
(cont.)
The first electronic computer system, the Colossus, was invented by Alan Turing. Its only problem was that the program was fixed and could not be changed. The first general-purpose, programmable electronic computer system was developed in 1946 at the University of Pennsylvania. This first modern computer was called the ENIAC (Electronics Numerical Integrator and Calculator).
EEM336 Microprocessors I Introduction to the Microprocessor and Computer 89
SUMMARY
(cont.)
The world's first microprocessor, the Intel 4004, was a 4-bit microprocessor-a programmable controller on a chip-that was meager by today's standards. It addressed a mere 4096 4-bit memory locations. Its instruction set contained only 45 different instructions.
EEM336 Microprocessors I
90
45
SUMMARY
(cont.)
Microprocessors that are common today include the 8086/8088, which were the first 16-bit microprocessors. Following these early 16-bit machines were the 80286, 80386, 80486, Pentium, Pentium Pro, Pentium II, Pentium III, Pentium 4, and Core2 processors. The architecture has changed from 16 bits to 32 bits and, with the Itanium, to 64 bits.
EEM336 Microprocessors I
91
SUMMARY
(cont.)
With each newer version, improvements followed that increased the processor's speed and performance. From all indications, this process of speed and performance improvement will continue. Performance increases may not always come from an increased clock frequency.
EEM336 Microprocessors I
92
46
SUMMARY
(cont.)
DOS-based personal computers contain memory systems that include three main areas: TPA (transient program area), system area, and extended memory. The TPA hold: application programs, the operating system, and drivers. The system area contains memory used for video display cards, disk drives, and the BIOS ROM.
EEM336 Microprocessors I
93
SUMMARY
(cont.)
The extended memory area is only available to the 80286 through the Core2 microprocessor in an AT-style or ATX-style personal computer system. The Windows-based personal computers contain memory systems that include two main areas: TPA and systems area.
EEM336 Microprocessors I
94
47
SUMMARY
(cont.)
All versions of the 8086 through the Core2 microprocessors address 64K bytes of I/O address space. These I/O ports are numbered from 0000H to FFFFH with I/O ports 0000H-03FFH reserved for use by the personal computer system. The PCI bus allows ports 0400H-FFFFH.
EEM336 Microprocessors I
95
SUMMARY
(cont.)
The operating system in early personal computers was either MSDOS (Microsoft disk operating system) or PCDOS (personal computer disk operating system from IBM). The operating system performs the task of operating or controlling the computer system, along with its I/O devices. Modern computers use Microsoft Windows and similar OS in place of DOS as an operating system.
EEM336 Microprocessors I Introduction to the Microprocessor and Computer 96
48
SUMMARY
(cont.)
The microprocessor is the controlling element in a computer system. The micro-processor performs data transfers, does simple arithmetic and logic operations, and makes simple decisions. The microprocessor executes programs stored in the memory system to perform complex operations in short periods of time.
EEM336 Microprocessors I
97
SUMMARY
(cont.)
All computer systems contain three buses to control memory and I/O. The address bus is used to request a memory location or I/O device. The data bus transfers data between the microprocessor and its memory and I/O spaces. The control bus controls the memory and I/O, and requests reading or writing of data.
EEM336 Microprocessors I Introduction to the Microprocessor and Computer 98
49
SUMMARY
(cont.)
Numbers are converted from any number base to decimal by noting the weights of each position. The weight of the position to the left of the radix point is always the units position in any number system. The position to the left of the units position is always the radix times one. Succeeding positions are determined by multiplying by the radix.
EEM336 Microprocessors I Introduction to the Microprocessor and Computer 99
SUMMARY
(cont.)
The weight of the position to the right of the radix point is always deter-mined by dividing by the radix. Conversion from a whole decimal number to any other base is accomplished by dividing by the radix. Conversion from a fractional decimal number is accomplished by multiplying by the radix.
EEM336 Microprocessors I
100
50
SUMMARY
(cont.)
Hexadecimal data are represented in hexadecimal form or in a code called binary-coded hexadecimal (BCH). A binary-coded hexadecimal number is one that is written with a 4-bit binary number that represents each hexadecimal digit. The ASCII code is used to store alphabetic or numeric data.
EEM336 Microprocessors I
101
SUMMARY
(cont.)
The ASCII code is a 7-bit code; it can have an eighth bit that is used to extend the character set from 128 codes to 256 codes. The carriage return (Enter) code returns the print head or cursor to the left margin. The line feed code moves the cursor or print head down one line. Most modern applications use Unicode, which contains ASCII at codes 0000H00FFH.
EEM336 Microprocessors I Introduction to the Microprocessor and Computer 102
51
SUMMARY
(cont.)
Binary-coded decimal (BCD) data are sometimes used in a computer system to store decimal data. These data are stored either in packed (two digits per byte) or unpacked (one digit per byte) form. Binary data are stored as a byte (8 bits), word (16 bits), or doubleword (32 bits) in a computer system. These data may be unsigned or signed.
EEM336 Microprocessors I Introduction to the Microprocessor and Computer 103
SUMMARY
(cont.)
Signed negative data are always stored in the two's complement form. Data that are wider than 8 bits are always stored using the little endian format. In 32-bit Visual C++ these data are represented with char (8 bits), short (16 bits) and int (32 bits).
EEM336 Microprocessors I
104
52
SUMMARY
Floating-point data are used in computer systems to store whole, mixed, and fractional numbers. A floating-point number is composed of a sign, a mantissa, and an exponent.
EEM336 Microprocessors I
105
The Intel Microprocessors: 8086/8088, 80186/80188, 80286, 80386, 80486 Pentium, Pentium Pro Processor, Pentium II, Pentium, 4, and Core2 with 64-bit Extensions Architecture, Programming, and Interfacing, Eighth Edition Barry B. Brey Copyright 2009 by Pearson Education, Inc. Upper Saddle River, New Jersey 07458 All rights reserved.
EEM336 Microprocessors I
106
53