ECE342 Digital II Lecture 1: Introduction to Microprocessors Dr. Ying (Gina) Tang Electrical and Computer Engineering Rowan University 1
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 2
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 3
Advantages of Microprocessors Programmability Sophisticated functions can be provided relatively easily in software Performance Advances in integrated circuit technology leads to faster and more powerful microprocessors Reliability Integrated circuits are highly-reliable and solid state devices. Compactness Prof. Ying (Gina) Tang 4
Limitations of Microprocessors Limitations External memory chips needed to hold program and data Glue logic (e.g., address decoder and buffer chips) required to interface with the memory chips Peripheral chips needed to interface with I/O devices Prof. Ying (Gina) Tang 5
Embedded Processor What make a processor an embedded processor A microprocessor used in an embedded system that is not a general-purpose computer 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. Prof. Ying (Gina) Tang 6
Anatomy of a Microcontroller Essential Components of a Microcontroller : the processor and peripheral functions Prof. Ying (Gina) Tang 7
Anatomy of a Microcontroller 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 Watchdog Timer A safety feature that resets the processor if the program stuck in an infinite loop Prof. Ying (Gina) Tang 8
Anatomy of a Microcontroller Different Peripherals (cont.) Communication interfaces Integrated Circuit (I 2 C) Universal Synchronous/Asynchronous Receiver/Transmitter (USART) RS232 A/D and D/A Real Time Clock Track the time of day Data loggers Prof. Ying (Gina) Tang 9
Architectures Harvard Architecture: Microchip PIC; Intel 8051 von Neumann Architecture MSP430; ARM7 10
Data representation Number systems Integer storage sizes byte word doubleword quadword 8 16 32 64 Ranges of unsigned integers 11
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? 12
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 13
Data representation Your turn.conversion Problems (0.6875) 10 =( ) 2 (1.234) 5 = ( ) 10 45677h = ( ) 8-38d = ( )h 14
Data representation Character Storage 7-bit /8-bit ASCII Format Value ASCII binary "01000001" ASCII decimal "65" ASCII hexadecimal "41" ASCII octal "101" 16-bit Unicode: http://www.unicode.org 15
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: +.612378x10 4 16
Data representation Floating-point numbers can be taken with ± E binary numbers in the form: ± S B This number can be stored in a binary word with three field: Sign: plus or minus The base B is implicit Significand S and need not be stored because it is the same for Exponent E all numbers A normalized number: one in which the most significant digit of the significand is nonzero. 17
IEEE Floating-point Standard For base 2 representation, a normalized number is one in which the most significant bit of the ± E significand is one: ± 1. bbb... b 2 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. 18
IEEE Floating-point Standard Two most common formats of IEEE floatingpoint representations (+/- S x B +/-E ) Single precision (the bias is 127d) Sign Biased exponent (E) Significand/mantissa/fraction (S) 1 bit 8 bits 23 bits Double precision ( the bias is 1023) Sign Biased exponent (E) Significand/mantissa/fraction (S) 1 bit 11 bits 52 bits Hidden bit Hidden bit In decimal In binary 1.5 x 2-126 0 00000001 10000000000000000000000-1.5 x 2 126 1 11111101 10000000000000000000000 19
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 fixedpoint numbers. 20
IEEE Floating-point Standard Two exceptions 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 The number 0.0 is stored as all zeros. The sign bit indicates either a positive or a negative zero. 21
Focus of This Course Embedded systems without an OS 16 bit processors Embedded software in C Software patterns & tricks Embedded hardware overview Peripheral usage Prof. Ying (Gina) Tang 22
Development Hardware TI MSP430F5529 Launchpad 16-bit processor w/ 128 KB flash Integrated USB and PHY, supporting USB 2.0 4 16-bit timers Hardware multiplier Real time clock 2 university serial communication interfaces DMA (direct memory access) 12-bit A/D 63 I/O pins 23
Development Hardware (cont.) 24
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 25