Upload
dotu
View
223
Download
1
Embed Size (px)
Citation preview
1
Lecture 1: Introduction to Microprocessors
Dr. Ying (Gina) Tang Electrical and Computer Engineering Rowan University
ECE342 Digital II
2
What is a microprocessor
Informally, a microprocessor (µP) is the “brain” of a computer that has been implemented on one semiconductor chip
Precisely, a microprocessor (µP) is a single-chip CPU for a programmable computer
Prof. Ying (Gina) Tang
3
The Microprocessor Age
The microprocessor became possible only after integrated circuit technology had advanced to the point where several thousand transistor switches could be integrated onto single semiconductor “chip”
Prof. Ying (Gina) Tang
4
Advantages of Microprocessors
Programmability
Performance
Sophisticated functions can be provided relatively easily in software
Reliability
Advances in integrated circuit technology leads to faster and more powerful microprocessors
Integrated circuits are highly-reliable and solid state devices.
Compactness
Prof. Ying (Gina) Tang
5
Limitations of Microprocessors
Limitations
Glue logic (e.g., address decoder and buffer chips) required to interface with the memory chips
External memory chips needed to hold program and data
Peripheral chips needed to interface with I/O devices
Prof. Ying (Gina) Tang
6
Embedded Processor What make a processor an embedded processor A microprocessor used in an embedded system
that is not a general-purpose computer
Prof. Ying (Gina) Tang
Systems range from using 4-bit to 128-bit CPUs.
Programming languages range from assembly language to higher level object oriented languages.
Complex systems typically run a embedded OS or a lite desktop OS.
CPU clock speeds can range from kHz to GHz.
Packages from 6 pins to 1000+ pins.
7
Anatomy of a Microcontroller Essential Components of a Microcontroller :
the processor and peripheral functions
Prof. Ying (Gina) Tang
8
Different Peripherals Timers The time at which transitions occur on an
input can be recorded Outputs can be driven on and off
automatically at a specified frequency They provide a regular “tick” that can be
used to schedule tasks in a program
Prof. Ying (Gina) Tang
Anatomy of a Microcontroller
Watchdog Timer A safety feature that resets the processor if
the program stuck in an infinite loop
9 Prof. Ying (Gina) Tang
Different Peripherals (cont.)
Anatomy of a Microcontroller
Communication interfaces Integrated Circuit (I2C) Universal Synchronous/Asynchronous
Receiver/Transmitter (USART) RS232 A/D and D/A Real Time Clock Track the time of day Data loggers
10
Architectures Harvard Architecture:
von Neumann Architecture
Microchip PIC; Intel 8051
MSP430; ARM7
11
Data representation Number systems Integer storage sizes
Ranges of unsigned integers
8 16
32 64
byte word
doubleword quadword
12
Data representation Number systems Storage sizes and ranges of signed
integers
Two’s complement Question: what are the 2’s complement representations of 8d and –8d in 8-bit binary?
13
Data representation Conversion Convert binary/hex/oct to decimal
(Number)n
= ∑(multiply each digit by an integer power of n)
Convert decimal to binary/hex/oct For a decimal integer - successive division by n - accumulation of the remainders For a decimal fraction - successive multiplication by n - accumulation of the integer digits
14
Data representation Your turn….Conversion Problems
(0.6875)10=(_________)2
(1.234)5 = (________)10 45677h = (________)8 -38d = (________)h
15
Data representation Character Storage 7-bit /8-bit ASCII
16-bit Unicode: http://www.unicode.org
Format Value
ASCII binary "01000001"
ASCII decimal "65"
ASCII hexadecimal "41"
ASCII octal "101"
16
Data representation Real Numbers – floating-point numbers Floating-point numbers are expressed as a
number (Significand) multiplied by a constant (base) raised to some integer power (exponent).
e.g., the floating-point notation for decimal number +6123.78 is: +.612378x104
17
Sign: plus or minus Significand S Exponent E
This number can be stored in a binary word with three field:
The base B is implicit and need not be stored because it is the same for all numbers
A normalized number: one in which the most significant digit of the significand is nonzero.
Data representation Floating-point numbers can be taken with
binary numbers in the form: EBS ±×±
18
IEEE Floating-point Standard
For base 2 representation, a normalized number is one in which the most significant bit of the significand is one: Ebbbb ±×± 2....1
Since the most significant bit is always one, it is unnecessary to store this bit, which is called the hidden bit.
Biased exponent: a constant called excess number is added to the actual exponent so that the biased exponent is always a positive number.
19
IEEE Floating-point Standard Two most common formats of IEEE floating-
point representations (+/- S x B+/-E)
Sign Biased exponent (E) Significand/mantissa/fraction (S) 1 bit 8 bits 23 bits
Single precision (the bias is 127d)
1 bit 11 bits 52 bits
Double precision ( the bias is 1023) Sign Biased exponent (E) Significand/mantissa/fraction (S)
Hidden bit
Hidden bit
In decimal In binary 1.5 x 2-126 0 00000001 10000000000000000000000 -1.5 x 2126 1 11111101 10000000000000000000000
20
IEEE Floating-point Standard Note that we are not representing more
individual values with floating-point notation. What we have done is to spread those numbers out in two ranges, positive and negative. The number in floating-point notation are not
spaced evenly along the number line as are fixed-point numbers.
21
The number infinity is stored as all ones in the exponent and all zeros in the mantissa. The sign bit indicates either a positive or a negative infinity
IEEE Floating-point Standard
The number 0.0 is stored as all zeros. The sign bit indicates either a positive or a negative zero.
Two exceptions
22
Focus of This Course
Prof. Ying (Gina) Tang
Embedded systems without an OS
16 bit processors
Embedded software in C
Software patterns & tricks Embedded hardware overview
Peripheral usage
23
Development Hardware
TI MSP430F5529 Launchpad 16-bit processor w/ 128 KB flash Integrated USB and PHY, supporting USB 2.0 Hardware multiplier 2 university serial communication interfaces DMA (direct memory access) 12-bit A/D 63 I/O pins
4 16-bit timers Real time clock
25
Development Software Code Composer Studio 6 An integrated development environment
(IDE) with A suite of tools used to develop and debug
embedded applications Compilers for each of TI's device families Source code editor12-bit A/D Project build environment Debugger Simulators Free in a special “16KB code-limited”! Available
at http://www.ti.com/tool/ccstudio-msp