580 likes | 585 Vues
Introduction to Micro Controllers & Embedded System Design Introduction & Background. Department of Electrical & Computer Engineering Missouri University of Science & Technology hurson@mst.edu. Instructor: Ali R. Hurson 128 EECH hurson@mst.edu Office Hours T, R 11:00-12:00
E N D
Introduction to Micro Controllers&Embedded System DesignIntroduction & Background Department of Electrical & Computer Engineering Missouri University of Science & Technology hurson@mst.edu A.R. Hurson
Instructor: Ali R. Hurson 128 EECH hurson@mst.edu Office Hours T, R 11:00-12:00 • Text: The 8051 Microcontroller and Embedded Systems Using Assembly and C, Second Ed., • Class notes available at A.R. Hurson
Grading Policy • In class exams & Quizzes: 40% • Final Exam (Comprehensive): 35% • Home works and Projects: 20% • Active class participation 5% • Individual grade will be determined based on individual effort, individual effort relative to the class effort, and proactive class participation. A.R. Hurson
Hardcopy of homeworks and Projects are collected at the beginning of the class, • It is encouraged to work as a group (at most three people per group) on homeworks/projects (grouping is fixed through out the semester), • December 1 is the deadline for filing grade corrections; no requests for grade change/update will be entertained after this deadline A.R. Hurson
Why this course? • What is its objective (s)? • This course attempts to study a computer in general and specifically microprocessor and microcontroller architectures. • So one has to find out what a computer is. A.R. Hurson
A computer, like any other system, is a collection of interconnectedentities (components) in order to perform a well defined function. This function is determined by the functions performed by its components and by the manner in which they are interconnected. • The function of the computer is a mapping of the input data to the output data: F: A B • In case of a digital system A and B are digital or discrete quantities. A.R. Hurson
The study of computers is the study of its components, their interactions, and their parallel activities and co-operations. • In this course a computer is viewed as a collection of five interconnected components: • Input Unit • Output Unit • Memory Unit • Central Processing Unit (CPU): • Control Unit (CU) • Arithmetic Logic Unit (ALU) A.R. Hurson
Input Unit: is an interface between the outside world and the internal parts. It performs two tasks: Transmission and Translationof information. • Output Unit: is an interface between the internal parts and the outside world. Its functions are the same as the Input Unit. • Memory Unit: acts as storage. It stores the instructions, data, intermediate, and final results. • Central Processor Unit: is used to: • Interpret the instructions and initiate their executions. • Perform arithmetic and logical operations on the data. A.R. Hurson
CPU CU ALU Information Result Memory Unit Input Unit Output Unit Data Path Control Path A.R. Hurson
In general, a computer can be studied at four different levels: Electronic, Logic, Programming, and System.Though it is hard to generalize, usually: • Electronic level is the subject of physics and mathematics, • Logic level is the subject of electrical engineering, and • Programming and System levels are the subjects of computer science/computer engineering. A.R. Hurson
Program Instruction Subroutine Module • • • A.R. Hurson
Conversion from Decimal to base R • A decimal number can be converted to another base, say R, by repeated division and recording the remainder, until the quotient becomes zero. A.R. Hurson
Conversion from Decimal to base R • Example: Convert 72 in base 10 to a hexadecimal number (i.e., base 16) • Hence (72)10 = (48)16 A.R. Hurson
Conversion from Decimal to base R • Example: Convert 56 in base 10 to a binary number • Hence (56)10 = (111000)2 A.R. Hurson
Conversion from base R to Decimal • This will be done by summing the products of each digit with its positional weight. Positional weight is the power of base starting from 0. • (121)10 = 1 2 1 • Positional weight 102 101 100 • Hence 121 = 1 * 10 + 2 * 101 + 1 * 100 A.R. Hurson
Conversion from base 16 to Decimal • Example: Convert 56 in base 16 to a decimal number (56)16 = 5 * 161 + 6 * 160 = 80 + 6 = (86)10 A.R. Hurson
Conversion from base 2 to Decimal • Example: Convert (110110)2 to a decimal number (110110)2 = 1 * 25 + 1 * 24+ 0 * 23+ 1 * 22+ 1 * 21+ 0 * 20 = 32 + 16 + 0 + 4 + 2 + 0 = (54)10 A.R. Hurson
Conversion from base R to base Q • Convert the number from base R to base 10 • Convert the decimal number to base Q A.R. Hurson
Conversion from base R to base Q • Example: Convert (57)8to base 12 • (57)8= 5 * 81+ 7 * 80= 40 + 7 = (47)10 • Hence: (57)8 = (3B)12 A.R. Hurson
Conversion from base 16 to binary • Convert each hexadecimal digit into a 4 binary digits. • Example: Convert (ABC)16to binary A = 1010 B = 1011 C = 1100 • Hence: (ABC)16 = (101010111100)2 A.R. Hurson
Conversion from binary to base 16 • Start from right to left, make groups of 4 binary digits, • Convert each group into a hexadecimal digit • Example: Convert (110011001)2 to hexadecimal number • Hence: (110011001)2 = (199)16 A.R. Hurson
Question: conversion from binary to octal and vice versa? A.R. Hurson
Conversion of decimal fraction to base R • This can be done by iterative multiplication of fraction by base R and recording the integer parts of the results. A.R. Hurson
Conversion of decimal fraction to base R • Example: Convert (.56)10 to hexadecimal • Hence (.56)10 = (.8E)16 A.R. Hurson
Conversion of decimal fraction to base R • Example: Convert (.56)10 to binary • Hence (.56)10 = (.100011)2 A.R. Hurson
Conversion of fraction in base R to decimal fraction • This can be done by summation of multiplication of each digit by its positional weight in base R. A.R. Hurson
Conversion of fraction in base R to decimal fraction • Example: Convert (.111011)2 to a decimal number • (.111011)2 = 1 * 1/2 + 1 * 1/4 + 1 * 1/8 + 0 * 1/16 + 1 * 1/32 + 1 * 1/64 = 1/2 + 1/4+ 1/8 + 1/32 + 1/64 = .5 + .25 + .18 + … = (.875)10 A.R. Hurson
Basic Arithmetic Operations are: • Addition • Subtraction • Multiplication • Division A.R. Hurson
Basic Logic Operations are: • AND • OR • NOT A.R. Hurson
Questions • What is the minimum number of arithmetic operations needed to carry out all arithmetic operations? • What is the minimum number of logic operations needed to carry out all logic operations? A.R. Hurson
Addition of two binary bits is as follows: A.R. Hurson
Addition of three binary bits is as follows: A.R. Hurson
Addition of two binary numbers can be done by using the previous two tables. • Example: perform (11001)2 + (101101)2 A.R. Hurson
Subtraction can be done by means of complement operation: A – B = A + (complement of B) A.R. Hurson
Carry out A A.R. Hurson
A A.R. Hurson
As noted before, in general subtraction can be done using 2s or 1s complement addition. • Example: A.R. Hurson
Addition of hexadecimal numbers • Example: perform the following operation A.R. Hurson
Subtraction of hexadecimal numbers • Similarly subtraction can be done using 16s and 15s complement addition. • Example: perform the following operation A.R. Hurson
Basic Logic • AND gate A B A.R. Hurson
Basic Logic • OR gate A B A.R. Hurson
Basic Logic • NOT gate A A.R. Hurson
Basic Logic • NAND gate A B A.R. Hurson
Basic Logic • NOR gate A B A.R. Hurson
Basic Logic • EXOR gate A B A.R. Hurson
Basic Logic • EXNOR gate A B A.R. Hurson
Note: • The NAND and NOR are called universal functions since with either one we can generate AND, OR, and NOT gates A.R. Hurson
Basic Logic A.R. Hurson
Half adder • Is a logic circuit with two inputs and two outputs generating Sum and Carry A.R. Hurson