Download presentation
Presentation is loading. Please wait.
1
ECE 3430 – Intro to Microcomputer Systems
ECE 3430 – Introduction to Microcomputer Systems University of Colorado at Colorado Springs Lecture #1 Agenda Today: 1) Microcomputers, Microprocessors, Microcontrollers 2) Number Systems Lecture #1 ECE 3430 – Intro to Microcomputer Systems Fall 2009
2
Microcomputers and Terminology
There are lots of confusing terms floating around which don’t always have consistent definitions. Get used to it! What is a microcomputer? Term which evolved into personal computer (PC)—desktop and laptop. Sometimes just referred to as a computer. A microcomputer is a computer—but a computer is not a microcomputer. Other types of computers (not digital in nature): Analog (slide ruler, abacus, mechanical computers) Pulse (neural networks) Talk about main components of a microcomputer. Lecture #1 ECE 3430 – Intro to Microcomputer Systems Fall 2009
3
Microcomputers and Terminology
Other types of digital computers: Minicomputers (larger than microcomputers) Mainframe computers (larger than minicomputers) Supercomputers (biggest and fastest) Microcomputers have five classic components: Input (keyboards, mice, touch-screens, etc.) Output (LCD panels, monitors, printers) Memory (ROM, RAM, hard drives) Datapath (performs arithmetic and logical operations [ALU]) Control (state machine in nature, controls the datapath) The last two (datapath and control) are usually collectively called the processor or central processor unit (CPU). Microcomputers are typically computers that are developed around a microprocessor. Lecture #1 ECE 3430 – Intro to Microcomputer Systems Fall 2009
4
Microprocessors and Microcontrollers
A CPU packaged in a single integrated circuit. Typically employs multiple execution pipelines, data and instruction caches, and other complex logic to get very high execution throughput (lots of “work” done in a given unit of time). Microcontroller: A computer system implemented on a single, very large-scale integrated circuit. Generally speaking, a microcontroller contains everything in a microprocessor plus on-chip peripheral devices (bells and whistles). A microcontroller may contain memories, timer circuits, A/D converters, USB interface engines, the kitchen sink, et cetera. Lecture #1 ECE 3430 – Intro to Microcomputer Systems Fall 2009
5
Use Models for Microprocessors/Microcontrollers
Used in systems that need to do complex calculations (serious number crunching). Used in systems that need to do calculations very quickly. Microcontrollers: Typically don’t have overly-complex datapaths and control logic. Microcontrollers typically live in a system to do one dedicated operation. Circuits that do complex control operations (not complex calculations) use microcontrollers. The datapath complexity of a microprocessor is often scaled back in microcontrollers—in favor of on-chip peripheral devices. This course will focus on the use of the MC68HC11 microcontroller to solve engineering problems (see chip timeline on web). Lecture #1 ECE 3430 – Intro to Microcomputer Systems Fall 2009
6
ECE 3430 – Intro to Microcomputer Systems
Number Systems Number Base Notation Used in this Course: Decimal, Base 10 <nothing> Ex) 11 Binary, Base 2 % Ex) %1011 Octal, Base 8 @ Hexadecimal, Base 16 $ Ex) $BD ASCII ‘ Ex) ‘z This notation is also used by the HC11 assembler we will be using. We’ll discuss assembly and the assembler later. Lecture #1 ECE 3430 – Intro to Microcomputer Systems Fall 2009
7
ECE 3430 – Intro to Microcomputer Systems
Number Systems Base Conversion – Binary to Decimal Each digit has a “weight” of 2n that depends on the position of the digit. Multiply each digit by its “weight”. Sum the resultant products. Ex) Convert %1011 to decimal (weight) % = 1•(23) + 0• (22) + 1• (21) + 1• (20) = 1•(8) + 0• (4) + 1• (2) + 1• (1) = = 11 Decimal Lecture #1 ECE 3430 – Intro to Microcomputer Systems Fall 2009
8
ECE 3430 – Intro to Microcomputer Systems
Number Systems Base Conversion – Binary to Decimal with Fractions The weight of the binary digits have negative positions. ex) Convert % to decimal % = 1•(23) + 0• (22) + 1• (21) + 1• (20) + 1• (2-1) + 0• (2-2) • (2-3) = 1•(8) + 0• (4) • (2) • (1) • (0.5) + 0• (0.25) + 1• (0.125) = = Decimal Lecture #1 ECE 3430 – Intro to Microcomputer Systems Fall 2009
9
ECE 3430 – Intro to Microcomputer Systems
Number Systems Base Conversion – Decimal to Binary - the decimal number is divided by 2, the remainder is recorded - the quotient is then divided by 2, the remainder is recorded - the process is repeated until the quotient is zero ex) Convert 11 decimal to binary Quotient Remainder LSB MSB = %1011 Lecture #1 ECE 3430 – Intro to Microcomputer Systems Fall 2009
10
ECE 3430 – Intro to Microcomputer Systems
Number Systems Base Conversion – Decimal to Binary with Fractions - the fraction is converted to binary separately - the fraction is multiplied by 2, the 0th digit is recorded - the remaining fraction is multiplied by 2, the 0th digit is recorded - the process is repeated until the fractional part is zero ex) Convert decimal to binary Product th Digit • MSB • • LSB decimal = % .011 finished Lecture #1 ECE 3430 – Intro to Microcomputer Systems Fall 2009
11
ECE 3430 – Intro to Microcomputer Systems
Number Systems Base Conversion – Hex to Decimal - the same process as “binary to decimal” except the weights are now BASE NOTE ($A=10, $B=11, $C=12, $D=13, $E=14, $F=15) ex) Convert $2BC to decimal (weight) $2 B C = 2• (162) + B• (161) + C• (160) = 2•(256) • (16) • (1) = = 700 Decimal Lecture #1 ECE 3430 – Intro to Microcomputer Systems Fall 2009
12
ECE 3430 – Intro to Microcomputer Systems
Number Systems Base Conversion – Hex to Decimal with Fractions - the fractional digits have negative weights (BASE 16) - NOTE ($A=10, $B=11, $C=12, $D=13, $E=14, $F=15) ex) Convert $2BC.F to decimal (weight) $2 B C F = 2• (162) + B• (161) + C• (160) + F• (16-1) = 2•(256) • (16) • (1) • (0.0625) = = Decimal Lecture #1 ECE 3430 – Intro to Microcomputer Systems Fall 2009
13
ECE 3430 – Intro to Microcomputer Systems
Number Systems Base Conversion – Decimal to Hex - the same procedure is used as before but with BASE 16 as the divisor/multiplier ex) Convert decimal to hex st, convert the integer part… Quotient Remainder LSB MSB = $1A4 2nd, convert the fractional part… Product th Digit • MSB = $ .A decimal = $1A4.A Lecture #1 ECE 3430 – Intro to Microcomputer Systems Fall 2009
14
ECE 3430 – Intro to Microcomputer Systems
Number Systems Base Conversion – Octal to Decimal / Decimal to Octal The same procedure is used as before but with BASE 8 as the divisor/multiplier Lecture #1 ECE 3430 – Intro to Microcomputer Systems Fall 2009
15
Number Systems (Shortcuts)
Base Conversion – Hex to Binary Each HEX digit is made up of four binary bits which represent 8, 4, 2, and 1 Ex) Convert $ABC to binary $A B C = % = % Octal to Binary works the same except using groups of three binary Bits which represent 4, 2, and 1. Lecture #1 ECE 3430 – Intro to Microcomputer Systems Fall 2009
16
Number Systems (Shortcuts)
Base Conversion – Binary to Hex - every 4 binary bits for one HEX digit - begin the groups of four at the LSB - if necessary, fill the leading bits with 0’s ex) Convert $ABC to binary = % $3 2 F Binary to Octal works the same way using groups of 3 binary bits. Talk about representations of negative numbers – alternate formats other than two’s complement: * Sign – Magnitude * One’s complement * Two’s complement Lecture #1 ECE 3430 – Intro to Microcomputer Systems Fall 2009
17
ECE 3430 – Intro to Microcomputer Systems
Number Systems Binary Addition - same as BASE 10 addition - need to keep track of the carry bit ex) Add %1011 and % % % +________ Carry Bit Lecture #1 ECE 3430 – Intro to Microcomputer Systems Fall 2009
18
ECE 3430 – Intro to Microcomputer Systems
Number Systems Two’s Complement - we need a way to represent negative numbers in a computer - this way we can use “adding” circuitry to perform subtraction - since the number of bits we have is fixed (i.e., 8), we use the MSB as a sign bit Positive #’s : MSB = 0 (ex: % , positive number) Negative #’s : MSB = (ex: % , negative number) the range of #’s that a two’s complement code can represent is: (-2n-1) < N < (2n-1 – 1) : n = number of bits ex) What is the range of #’s that an 8-bit two’s complement code can represent? (-28-1) < N < (28-1 – 1) (-128) < N < (+127) Lecture #1 ECE 3430 – Intro to Microcomputer Systems Fall 2009
19
ECE 3430 – Intro to Microcomputer Systems
Number Systems Two’s Complement Negation - to take the two’s complement of a positive number (i.e., find its negative equivalent) Nc = 2n – N Nc = Two’s Complement N = Original Positive Number ex) Find the 8-bit two’s complement representation of –52dec N = +52dec Nc = 28 – 52 = 256 – 52 = 204 = % Note the Sign Bit Lecture #1 ECE 3430 – Intro to Microcomputer Systems Fall 2009
20
ECE 3430 – Intro to Microcomputer Systems
Number Systems Two’s Complement Negation (a second method) - to take the two’s complement of a positive number (i.e., find its negative equivalent) 1) Invert all the bits of the original positive number (binary) 2) Add 1 to the result ex) Find the 8-bit two’s complement representation of –52dec N = +52dec = % Invert: = % Add 1 = % % (-52dec) Lecture #1 ECE 3430 – Intro to Microcomputer Systems Fall 2009
21
ECE 3430 – Intro to Microcomputer Systems
Number Systems Two’s Complement Negation (a third method) Begin with the original positive value. Change all of bits to the left of the right-most 1 to the opposite state. Done. ex) Find the 8-bit two’s complement representation of –52dec N = +52dec = % right-most 1 % (-52dec) Lecture #1 ECE 3430 – Intro to Microcomputer Systems Fall 2009
22
ECE 3430 – Intro to Microcomputer Systems
Number Systems Two’s Complement Addition Addition of two’s complement numbers is performed just like standard binary addition However, the carry bit is ignored Lecture #1 ECE 3430 – Intro to Microcomputer Systems Fall 2009
23
ECE 3430 – Intro to Microcomputer Systems
Number Systems Two’s Complement Subtraction - now we have a tool to do subtraction using the addition algorithm ex) Subtract 8dec from 15dec 15dec = % dec = % > two’s complement -> invert % add1 % % = -8dec Now Add: (-8) = % % _________ % = 7dec Disregard Carry Lecture #1 ECE 3430 – Intro to Microcomputer Systems Fall 2009
24
ECE 3430 – Intro to Microcomputer Systems
Number Systems Two’s Complement Overflow - If a two’s complement subtraction results in a number that is outside the range of representation (i.e., -128 < N < +127), an “overflow” has occurred. ex) -100dec – 100dec- = -200dec (can’t represent) - There are three cases when overflow occurs 1) Sum of like signs results in answer with opposite sign 2) Negative – Positive = Positive 3) Positive – Negative = Negative - Boolean logic can be used to detect these situations. Lecture #1 ECE 3430 – Intro to Microcomputer Systems Fall 2009
25
ECE 3430 – Intro to Microcomputer Systems
Number Systems Binary Coded Decimal - Sometimes we wish to represent an individual decimal digit as a binary representation (i.e., 7-segment display to eliminate a decoder) - We do this by using 4 binary digits Decimal BCD ex) Represent 17dec Binary = % BCD = % Comment on why BCD exists: * Simplifies some display electronics (simple mapping). * Avoids conversions binary to ASCII. Lecture #1 ECE 3430 – Intro to Microcomputer Systems Fall 2009
26
ECE 3430 – Intro to Microcomputer Systems
Number Systems ASCII American Standard Code for Information Interchange English Alphanumeric characters are represented with a 7-bit code ex) ‘A’ = $ ‘a’ = $61 There is an ASCII table in the front of the HC11 Programming Reference Guide. More on Number Systems in Appendix A of Your Text Book. Mention UNICODE. Lecture #1 ECE 3430 – Intro to Microcomputer Systems Fall 2009
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.