You are on page 1of 35

Microprocessing Systems and Interfaceing

(EEE-342)

Muhammad Faizan Malik


Week 1 - Introduction

2 M. Faizan COMSATS Attock Dept EE


Course Introduction
 Microprocessor and Microcontroller – EEE342

 4 Credit Hours
 Theory 3
 Lab 1

 Instructor
M. Faizan Malik

 Lab
Microprocessor LAB, LAB Block

3 M. Faizan COMSATS Attock Dept EE


Tentative Breakdown

4 M. Faizan COMSATS Attock Dept EE


Books
8051 Microcontroller
 I. Scott Mackenzie and R.C. Phan, “The 8051 Microcontroller”,
Fourth Edition, Pearson Education 2007
 Muhammad Ali Mazidi and J. G. Mazidi, “The 8051 Microcontroller
and Embedded Systems”, Pearson Education 2006

PIC 18F Microcontroller


 M. Ali Mazidi, R. D. Mickinlay and D. Causey, “PIC Microcontrollers
and Embedded Systems”, Pearson Education 2008

7 M. Faizan COMSATS Attock Dept EE


Tutorials

 Tough and demanding course with much information

 Weekly Tutorial Session


 Students can discuss the problems / queries
 Participation is compulsory

 Students are welcome to discuss queries any time other


than Tutorial Session as well

10 M. Faizan COMSATS Attock Dept EE


Prerequisites
 Number Systems
 Binary
 Decimal
 Hexadecimal
 Electronics
 Basic concepts
 DLD
 Logical Gates
 Multiplexer, De-multiplexer
 Encoder, Decoder
 Basic Concepts
 Computer Programming
 C
 Basic Concepts
Clear and practice these topics before this course

11 M. Faizan COMSATS Attock Dept EE


Introduction

What is a Computer?

12
Introduction
What is a Computer?

 Computer
 Device capable of
 Performing computations
 Making Logical Decisions

 Works billions of times faster than human beings

13
Introduction
What is a Computer?

 Programs
 Set of instructions that process data
 Guide computer through orderly sets of actions specified by
“Programmer”

 Computer System
 Consists of various hardware devices
 Keyboard
 Screen
 Disks
 Memory
 Processing Units

14
Introduction
Computer

RAM

Inputs

Central Processing
ALU Unit
Outputs

ROM

15
Introduction

Every computer consists of


1. Input Unit
 Receiving section of computer
 Gets data from input devices e.g. Keyboard, Mouse etc

2. Output Unit
 Puts information on various output devices
 Monitors
 Printouts
 Speakers

16
Introduction

Every computer consists of


3. Central Processing Unit (CPU)
 Administrative section of computer
 Supervises other sections

4. Arithmetic Logic Unit (ALU)


 Performs calculations (addition, subtraction, multiplication and
division)
 Can make decisions and comparisons

17
Introduction

Every computer consists of


5. Memory Unit
 Rapid access, Fast
 Temporarily retains information; lost when powered off
 Also called Memory, Primary Memory or Random Access Memory
(RAM)

6. Secondary Storage Units


 Long-term high capacity storage
 Stores programs Or data not currently being used
 Hard drives, Disks, CDs etc
 Slower than primary memory

18
Introduction

 Computer Architecture

 Von Neumann Vs Harvard


 Instruction = Program / Code
 Data = Information being used

 RISC Vs CISC
 Instruction Set = Set of Instructions (low level) that CPU can process

19
Von Neumann Vs Harvard
Von Neumann Architecture
 A single memory has
 DATA: the information being used
 Instructions: Program to be executed
 A single Bus connects CPU with the memory
 At a time, either Instruction can be read OR data can be read
or written

 2 cycles complete an
instruction
 1st : Read instruction
 2nd : Read/Write Data

20 Image courtesy Dr. Javaid


Von Neumann Vs Harvard
Harvard Architecture
 Separate Memories for
 DATA: the information being used
 Instructions: Program to be executed
 Separate Buses connects CPU with the memory
 When an instruction is being executed, data for next
instruction is fetched,
known as Pipelining.

21 Image courtesy Dr. Javaid


Von Neumann Vs Harvard

Von Neumann Harvard

 Same memory keeps Data  Separate memories for data


and instructions
and Instructions

 A single bus connects CPU  Two buses between memory


with memory and CPU

 At a time, either reading  Reading / Writing memory


an instruction OR reading and reading an Instruction
can be done simultaneously
/ writing data
22
RISC Vs CISC
CISC
Complex Instruction Set Computer

 Instruction Set is set of all Instructions (low level Commands)


that CPU can execute

 Primary goal of CISC Architecture is to complete task in as few


lines of assembly as possible

 Processor that understands and performs series of actions for


each assembly command

 Instructions may be variable in length

23
RISC Vs CISC
RISC
Reduced Instruction Set Computer

 Compact Uniform instructions

 Reduces chip complexity by using simpler instructions

 Few types of instructions to operate at high speed

 Requires more RAM

 Has become more popular due to decreasing RAM cost


24
RISC Vs CISC

CISC RISC
 Large Instruction set  Small and Compact
Instruction set

 Less lines of code  More lines of Code

 Variable length of  Uniform length of


instructions instructions

 Complex architecture  Simple architecture

25
Programming Languages
 Programming Language: A set of rules, symbols and
special words used to construct a computer program

 High Level Language


 A computer language that is more intuitive to the humans. Closer to
plain English

 Low Level (Assembly Language)


 In which a mnemonic is used to represent each machine language
instruction

 Machine Language
 The binary representation of instructions a computer can perform
26
Programming Languages
 High Level Languages

 Single statements accomplish substantial tasks

 Translated to machine language


 Compilers convert to machine language
 Conversion takes much time

 Instructions comprehensible to humans


 Looks mostly like general English
 Contains common mathematical notations

27
Programming Languages
 Low Level (Assembly Language)

 English-like abbreviations
 Represent basic operations of computer

 Translated to machine language


 Assemblers convert to machine language
 High speed conversion

 Easier for human interpretation as compared to Machine


language
 Still tedious and difficult
 Many instructions for simple tasks
 These problems led to High Level languages
28
Programming Languages
 Machine Language

 Only language understood directly by computer

 Defined by computer’s hardware design


 Machine-dependent

 Difficult to understand for human readers


 Ultimately reduced binary code i.e. 0s and 1s

 Slow, tedious and error prone


 Led to assembly language

29
Programming Languages
Assembly is a Low Level Language
FORTRAN
 High Level Pascal
COBOL
BASIC

C++
 Middle Level C

 Low Level Assembly

30
Programmer’s Model of Computer
 It does not matter whether the machine is
microprocessor / microcontroller based or a larger
machine

 Programmers see the computer as having 3


characteristics
 Address Space
 Registers
 Instruction Set

31
Address Space
 Address Space is set of storage locations, each of which
has an Address

 The size of Address Space is defined by number of bits the


computer uses to form an address

 A machine that uses 8 bits for address can access at most


28 = 256 locations

32
Registers
 Registers serve many important functions, including
temporary storage of data

 The register set of a computer is fundamental to its


operation

 Registers may be:


 General Purpose
 Special Function

33
Instruction Set
 Set of commands that computer can obey

 Machine codes are generated from instruction set

 Very simple commands

 Instruction set specifies set of operations e.g. ADD,


SUBTRACT, JUMP and Addressing Modes etc

34
Buses
 Bus – Collection of wires through which data is
transmitted from one part of computer to another

 Buses can be thought of as highways of computer on


which data travels

 Types of Buses
1. Data Bus
2. Address Bus
3. Control Bus

35
Data Bus
 Data is shared among various components inside a
computer using wires known as Data Lines

 Group of data lines is called Data Bus

 Each data line carries a bit i.e. it can be Off or On

 Data bus is Bi-Directional

36
Address Bus
 Addresses are accessed in a computer using wires known
as Address Lines

 Group of address lines is call Address Bus

 Address bus is Uni-directional


 It only specifies the address of the target location

37
Control Bus
 These lines control the operation of a computer

 For example, CPU uses these lines to specify whether a


read or write is required

 This is done by different Control Lines

38
Acknowledgement

Material used with permission of

 Dr. Javaid Iqbal


 Head of Department, Mechatronics Engineering
 College of EME, NUST

I am extremely thankful to Dr. Javaid who has been a great


teacher and still helps and supports me

40

You might also like