Upload
rrobertw
View
220
Download
0
Embed Size (px)
Citation preview
8/15/2019 Microprocessors Ch1. the Architecture of a Microcomputer - HC 2016 v2
http://slidepdf.com/reader/full/microprocessors-ch1-the-architecture-of-a-microcomputer-hc-2016-v2 1/22
Horia Cucu
Speech & Dialogue Research Laboratory Faculty of Electronics, Telecommunications and Information Technology
University POLITEHNICA of Bucharest
8/15/2019 Microprocessors Ch1. the Architecture of a Microcomputer - HC 2016 v2
http://slidepdf.com/reader/full/microprocessors-ch1-the-architecture-of-a-microcomputer-hc-2016-v2 2/22
8/15/2019 Microprocessors Ch1. the Architecture of a Microcomputer - HC 2016 v2
http://slidepdf.com/reader/full/microprocessors-ch1-the-architecture-of-a-microcomputer-hc-2016-v2 3/22
1.1 Definitions
8/15/2019 Microprocessors Ch1. the Architecture of a Microcomputer - HC 2016 v2
http://slidepdf.com/reader/full/microprocessors-ch1-the-architecture-of-a-microcomputer-hc-2016-v2 4/22
Block Diagram of a Microcomputer
03.03.2016 4Microprocessor Architectures
A microcomputer is a general purpose device that can be programmedto carry out a set of arithmetic and/or logical operations.
8/15/2019 Microprocessors Ch1. the Architecture of a Microcomputer - HC 2016 v2
http://slidepdf.com/reader/full/microprocessors-ch1-the-architecture-of-a-microcomputer-hc-2016-v2 5/22
Functional Components
CPU: the hardware block which processes data andcontrols the system
Memory: the hardware block which stores data in asequence of memory locations
I/O devices: hardware blocks that form the interface
between the microcomputer and the external world
Busses: the connections between the above blocks
03.03.2016 5Microprocessor Architectures
8/15/2019 Microprocessors Ch1. the Architecture of a Microcomputer - HC 2016 v2
http://slidepdf.com/reader/full/microprocessors-ch1-the-architecture-of-a-microcomputer-hc-2016-v2 6/22
The von Neumann Principles
Both data and instructions are stored in the memory
The contents of the memory is accessed by location
The microprocessor is the CPU of the microcomputer; its role isto process data and control the system
The instructions are fetched from the memory and executedsequentially by the CPU
I/O ports are used to communicate with other devices
The three hardware blocks are interconnected by the system bus
03.03.2016 6Microprocessor Architectures
8/15/2019 Microprocessors Ch1. the Architecture of a Microcomputer - HC 2016 v2
http://slidepdf.com/reader/full/microprocessors-ch1-the-architecture-of-a-microcomputer-hc-2016-v2 7/22
The Memory – Basic Principles
Memory – sequence of memory locations used to store info Each memory location:
stores an 8-bit number, a byte of data
is identified by a unique number, called address
The memory is accessed and organized by the CPU only
The CPU can choose to create logical subdivisions within thememory (called pages or segments)
The memory map – all memory locations that can beaddressed by the CPU (not necessarily implemented)
The size of the memory map – performance criterion
03.03.2016 7Microprocessor Architectures
8/15/2019 Microprocessors Ch1. the Architecture of a Microcomputer - HC 2016 v2
http://slidepdf.com/reader/full/microprocessors-ch1-the-architecture-of-a-microcomputer-hc-2016-v2 8/22
The Memory – A Closer Look
03.03.2016 8Microprocessor Architectures
8/15/2019 Microprocessors Ch1. the Architecture of a Microcomputer - HC 2016 v2
http://slidepdf.com/reader/full/microprocessors-ch1-the-architecture-of-a-microcomputer-hc-2016-v2 9/22
The Memory – A Closer Look
The size of the memory is directly linked with the addresssize through the following equation:
Example 1: using an address of 2 bits, one can form 4 different addresses:
00, 01, 10, and 11, for up to 4 different memory locations consequently, a memory with an address of 2 bits will
comprise 4 memory locations (4 bytes).
Example 2: using a 20-bit address, one can form 220 different addresses,
corresponding to 220 different memory locations
consequently, a memory with a 20-bit address will comprise220 memory locations (1 MB).
03.03.2016 9Microprocessor Architectures
][2
bitseaddressSiz memorySize
8/15/2019 Microprocessors Ch1. the Architecture of a Microcomputer - HC 2016 v2
http://slidepdf.com/reader/full/microprocessors-ch1-the-architecture-of-a-microcomputer-hc-2016-v2 10/22
The Memory – Contents Significance
03.03.2016 10Microprocessor Architectures
This could be a 16-bit result
This could be an instruction
These could be the first two elements inan array of 8-bit numbers
• The significance of the information is given by the programmer.
• The memory “doesn’t know” the significance of the information it stores!
8/15/2019 Microprocessors Ch1. the Architecture of a Microcomputer - HC 2016 v2
http://slidepdf.com/reader/full/microprocessors-ch1-the-architecture-of-a-microcomputer-hc-2016-v2 11/22
Input/Output Devices
I/O Devices – hardware blocks that form the interfacebetween the microcomputer and the external world
I/O Devices – can be regarded as a set of I/O Ports
Each I/O port can be used to: send an 8-bit/16-bit/32-bit number to an external device
receive an 8-bit/16-bit/32-bit number from an external device
is identified by a unique number, called port address
The ports map – all ports that can be addressed by the CPU(not necessarily implemented)
The size of the ports map – performance criterion
03.03.2016 11Microprocessor Architectures
8/15/2019 Microprocessors Ch1. the Architecture of a Microcomputer - HC 2016 v2
http://slidepdf.com/reader/full/microprocessors-ch1-the-architecture-of-a-microcomputer-hc-2016-v2 12/22
8/15/2019 Microprocessors Ch1. the Architecture of a Microcomputer - HC 2016 v2
http://slidepdf.com/reader/full/microprocessors-ch1-the-architecture-of-a-microcomputer-hc-2016-v2 13/22
The Software Component
The microcomputer is executing instructions organized incomputer programs, namely the software
Two main categories: The Operating System: set of programs which facilitate the
user’s access to the system’s resources
User Software: set of programs specifically created by the user
to achieve a certain task
03.03.2016 13Microprocessor Architectures
8/15/2019 Microprocessors Ch1. the Architecture of a Microcomputer - HC 2016 v2
http://slidepdf.com/reader/full/microprocessors-ch1-the-architecture-of-a-microcomputer-hc-2016-v2 14/22
Summary
03.03.2016 14Microprocessor Architectures
The CPU: executes instructions (processes data) and controls the system
The Memory: stores both the data and the instructions
The I/O Devices: interconnect the microcomputer with the outside world
8/15/2019 Microprocessors Ch1. the Architecture of a Microcomputer - HC 2016 v2
http://slidepdf.com/reader/full/microprocessors-ch1-the-architecture-of-a-microcomputer-hc-2016-v2 15/22
1.2 Information Representation in Computer Systems
8/15/2019 Microprocessors Ch1. the Architecture of a Microcomputer - HC 2016 v2
http://slidepdf.com/reader/full/microprocessors-ch1-the-architecture-of-a-microcomputer-hc-2016-v2 16/22
Information Representation in
Computer Systems
03.03.2016 16Microprocessor Architectures
Information is stored using electronic circuits, called flip-flops (or bistables), that have two stable states: on/off
The state of a bistable can be used to represent a bit (i.e.binary digit: 0, 1) or a boolean value (true, false)
Data types with more than two possible values are stored
using sequences of bits: Byte (B) – a sequence of 8 bits: can store max 28 (256) values
Word (w) – a sequence of 16 bits: can store max 216 values
Double word (dw) – 32 bits: can store max 232 values
8/15/2019 Microprocessors Ch1. the Architecture of a Microcomputer - HC 2016 v2
http://slidepdf.com/reader/full/microprocessors-ch1-the-architecture-of-a-microcomputer-hc-2016-v2 17/22
The binary, decimal
and hexadecimal bases
03.03.2016 17Microprocessor Architectures
Any sequence of bits can also be represented as: a decimal number (number in base 10)
can be written as a sequence of decimal digits (0, 1, …, 9)
a hexadecimal number (number in base 16) can be written as a sequence of hexadecimal digits (0, 1, …, 9, A,
B, C, D, E and F)
Hexadecimal numbers representation conventions:
the “h” suffix: 1A44h the “0x” prefix: 0x1A44
Conversion algorithms
binary decimal
hex
8/15/2019 Microprocessors Ch1. the Architecture of a Microcomputer - HC 2016 v2
http://slidepdf.com/reader/full/microprocessors-ch1-the-architecture-of-a-microcomputer-hc-2016-v2 18/22
Numbers representation
03.03.2016 18Microprocessor Architectures
Unsigned (positive) integer numbers
“Natural binary” representation
Signed integer numbers “Sign & magnitude” representation
“1’s complement” representation
“2’s complement” representation
Signed real numbers
“Fixed point” representation
“Floating point” representation
8/15/2019 Microprocessors Ch1. the Architecture of a Microcomputer - HC 2016 v2
http://slidepdf.com/reader/full/microprocessors-ch1-the-architecture-of-a-microcomputer-hc-2016-v2 19/22
Integer numbers representation
03.03.2016 19Microprocessor Architectures
Decimal
value Sign and magnitude 1’s complement 2’s complement
5 natural binary: 00000101 natural binary: 00000101 natural binary: 00000101
-5natural binary: 00000101
flip the sign bit: 10000101
natural binary: 00000101
flip all bits: 11111010
natural binary: 00000101
flip all bits: 11111010
add 1: 11111011
12 natural binary: 00001100 natural binary: 00001100 natural binary: 00001100
-12natural binary: 00001100
flip the sign bit: 10001100
natural binary: 00001100
flip all bits: 11110011
natural binary: 00001100
flip all bits: 11110011
add 1: 11110100
8/15/2019 Microprocessors Ch1. the Architecture of a Microcomputer - HC 2016 v2
http://slidepdf.com/reader/full/microprocessors-ch1-the-architecture-of-a-microcomputer-hc-2016-v2 20/22
Real numbers representation
03.03.2016 20Microprocessor Architectures
“Fixed point” representation
A fixed sequence of bits is used to represent decimal part
Two’s complement representation
A fixed sequence of bits is used to represent the fractional part
Natural binary representation
“Floating point” representation
A fixed sequence of bits is used to represent the mantissa
Two’s complement representation A fixed sequence of bits is used to represent the exponent
Natural binary representation
Example: real number = mantissa × 2exponent
8/15/2019 Microprocessors Ch1. the Architecture of a Microcomputer - HC 2016 v2
http://slidepdf.com/reader/full/microprocessors-ch1-the-architecture-of-a-microcomputer-hc-2016-v2 21/22
Characters representation
03.03.2016 21Microprocessor Architectures
Codingconventions:
ASCII
UTF-8 UTF-16
Unicode
8/15/2019 Microprocessors Ch1. the Architecture of a Microcomputer - HC 2016 v2
http://slidepdf.com/reader/full/microprocessors-ch1-the-architecture-of-a-microcomputer-hc-2016-v2 22/22
Instructions are represented using sequences of bytes; Some processors have fixed-size instructions
8086 has variable-size instructions (1-6 bytes)
The instruction codes are formed of several fields:
one field representing the instruction type
none, one or several fields representing data
none, one or several fields representing addresses are associated with mnemonics (to be used in programming)
Example: add AX, 8017h <=> 051780h
Programs representation
03.03.2016 22Microprocessor Architectures