communication theory ii - eced mansoura · pdf filethe intel microprocessors, architecture,...

45
Microprocessor (COM 9323) Lecture 1: Introduction Ahmed Elnakib, PhD Assistant Professor, Mansoura University, Egypt 1 Feb 17 th , 2016

Upload: trinhanh

Post on 06-Feb-2018

237 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Communication Theory II - ECED Mansoura · PDF fileThe Intel Microprocessors, Architecture, Programming and Interfacing, 8th edition, Barry B. Brey, ... USA 2008-2013 Master University

Microprocessor (COM 9323)

Lecture 1: Introduction

Ahmed Elnakib, PhD

Assistant Professor, Mansoura University, Egypt

1Feb 17th, 2016

Page 2: Communication Theory II - ECED Mansoura · PDF fileThe Intel Microprocessors, Architecture, Programming and Interfacing, 8th edition, Barry B. Brey, ... USA 2008-2013 Master University

Course Syllabus*

o Introduction to computer architecture

o Basics of microprocessors

o Instruction sets for Intel processors

o Assembly/C++ language programming

o Memory organization and memory interfacing

o I/O organization and interfacing

o Interrupt instruction set drivers interface

2*Subject to 20% variability

Page 3: Communication Theory II - ECED Mansoura · PDF fileThe Intel Microprocessors, Architecture, Programming and Interfacing, 8th edition, Barry B. Brey, ... USA 2008-2013 Master University

What is the Course Objective?

o To give a good overview of the course objectives, we will start list some important microprocessors applications

3

Page 4: Communication Theory II - ECED Mansoura · PDF fileThe Intel Microprocessors, Architecture, Programming and Interfacing, 8th edition, Barry B. Brey, ... USA 2008-2013 Master University

Microprocessors Applications: Systems on chip (SoCs)

oAn integrated circuit (IC) that integrates all components of a computer or other electronic system into a single chip

o It may contain all on a single chip substrate:1. Digital functions,2. Analog functions,3. Mixed-signal functions,4. Radio-frequency functions

oSoCs are very common in the mobile electronics market because oftheir low power consumption.

o A typical application is in the area of embedded systems

oUse powerful processors and may need external flash/RAM memory4

Page 5: Communication Theory II - ECED Mansoura · PDF fileThe Intel Microprocessors, Architecture, Programming and Interfacing, 8th edition, Barry B. Brey, ... USA 2008-2013 Master University

SoCs: FPGA (Field Programmable Gate Array)

A Xilinx Zynq-7000 All Programmable System

on a Chip

Page 6: Communication Theory II - ECED Mansoura · PDF fileThe Intel Microprocessors, Architecture, Programming and Interfacing, 8th edition, Barry B. Brey, ... USA 2008-2013 Master University

SoCs: Software-defined Radio & Cognitive Radio

Software defined radios (SDRs):o These radios typically have a radio frequency (RF) front end with a software-controlled tunero Baseband signals are passed into an analog-to digital convertero The quantized baseband is then demodulated in a reconfigurable device such as a field-programmable gate array (FPGA),

digital signal processor (DSP), or commodity personal computer (PC)o The reconfigurability of the modulation scheme makes it a software-defined radio

Page 7: Communication Theory II - ECED Mansoura · PDF fileThe Intel Microprocessors, Architecture, Programming and Interfacing, 8th edition, Barry B. Brey, ... USA 2008-2013 Master University

Systems on chip (SoCs): General structure

1. A microcontroller, microprocessor or digital signal processor (DSP) core –multiprocessor SoCs (MPSoC) having more than one processor core

2. Memory blocks including a selection of ROM, RAM, EEPROM and flash memory

3. Timing sources including oscillators and phase-locked loops

4. Peripherals including counter-timers, real-time timers and power-on reset generators

5. External interfaces, including industry standards such as USB, FireWire, Ethernet, USART, SPI

6. Analog interfaces including ADCs and DACs

7. Voltage regulators and power management circuits

7

Page 8: Communication Theory II - ECED Mansoura · PDF fileThe Intel Microprocessors, Architecture, Programming and Interfacing, 8th edition, Barry B. Brey, ... USA 2008-2013 Master University

o Microcontrollers is a small computer (SoC) on a single integrated circuit containing a processor core, memory, and programmable input/output peripherals It

8

Microprocessors Applications: Microcontrollers

Page 9: Communication Theory II - ECED Mansoura · PDF fileThe Intel Microprocessors, Architecture, Programming and Interfacing, 8th edition, Barry B. Brey, ... USA 2008-2013 Master University

PIC (Peripheral Interface Controller)

oThe first parts of the family were available in 1976

oBy 2013 the company had shipped more than twelve billion individual parts

oCapabilities include discrete I/O pins, ADC and DAC modules, and communications ports

oMicroprocssor instructions vary from about 35 instructions to over 80 instructions

9

Page 10: Communication Theory II - ECED Mansoura · PDF fileThe Intel Microprocessors, Architecture, Programming and Interfacing, 8th edition, Barry B. Brey, ... USA 2008-2013 Master University

Microcontrollers: ArduinooAn open-source platform used for building electronics projects, consisting:

1. Physical programmable circuit board (often referred to as a microcontroller)

2. IDE (Integrated Development Environment software) that runs on your computer, used to write and upload computer code to the physical board using a USB cable

10

Arduino IDE uses asimplified version ofC++ for programming

Page 11: Communication Theory II - ECED Mansoura · PDF fileThe Intel Microprocessors, Architecture, Programming and Interfacing, 8th edition, Barry B. Brey, ... USA 2008-2013 Master University

Microcontroller: Raspberry Pi

11

Page 12: Communication Theory II - ECED Mansoura · PDF fileThe Intel Microprocessors, Architecture, Programming and Interfacing, 8th edition, Barry B. Brey, ... USA 2008-2013 Master University

Report 01: Due to Feb. 24th , 1.30 PM

o Form a group of 5 members, each from a single section

o Each individual in the group is responsible to make a 2-page report on:1. Field Programmable Gate Array (FPGA)2. Peripheral Interface Controller (PIC)3. Adruino4. Raspberry Pi5. Soft-ware defined Radio and Cognitive Radio

o Report main points:1. Structure, capabilities, instruction set if it has, prices, programming language, steps on how to

program your first device2. References

o Report will be delivered by hand before the lecture12

Page 13: Communication Theory II - ECED Mansoura · PDF fileThe Intel Microprocessors, Architecture, Programming and Interfacing, 8th edition, Barry B. Brey, ... USA 2008-2013 Master University

General Purpose Microprocessor

o Powerful processor in terms of speed and system buses

o Intel processors have invaded the personal computer (PC) market,and almost all desktop computers/laptops work with an Intelmicroprocessor family

13

Page 14: Communication Theory II - ECED Mansoura · PDF fileThe Intel Microprocessors, Architecture, Programming and Interfacing, 8th edition, Barry B. Brey, ... USA 2008-2013 Master University

o What is the structure of a microprocessor?

o How to interface a microprocessor with memory and I/O devices?

o How to program the microprocessor to do a certain job?

14

Questions?

Page 15: Communication Theory II - ECED Mansoura · PDF fileThe Intel Microprocessors, Architecture, Programming and Interfacing, 8th edition, Barry B. Brey, ... USA 2008-2013 Master University

Course Focus

o Understand the basic computer architecture

o Understand the main components of microprocessors

o Program and debug in assembly/C++ language

o Understand the memory organization and memory interfacing

o Perform input/output device programming in assembly

o Understand the hardware and software interrupts and their applications

o Understand the properties and interfacing of the parallel and serial ports

15

Page 16: Communication Theory II - ECED Mansoura · PDF fileThe Intel Microprocessors, Architecture, Programming and Interfacing, 8th edition, Barry B. Brey, ... USA 2008-2013 Master University

Text Book/References

Textbook:1. The Intel Microprocessors, Architecture, Programming and Interfacing, 8th edition,

Barry B. Brey, Prentice Hall, 2009

2. Assembly Language for x86 processors, 6th edition, K. R. Irvine, Prentice Hall, 2011

References:1. Computer Architecture: A Quantitative Approach, 5th edition, J. Hennessy, D. Patterson,

Elsevier, 2012.

2. The 80x86 Family, Design, Programming and Interfacing, 3rd edition, Prentice Hall,

2002

3. The 80x86 IBM PC and Compatible Computers, Assembly Language, Design, and

Interfacing, 4th edition, M.A. Mazidi and J.G. Mazidi, Prentice Hall, 200316

Page 17: Communication Theory II - ECED Mansoura · PDF fileThe Intel Microprocessors, Architecture, Programming and Interfacing, 8th edition, Barry B. Brey, ... USA 2008-2013 Master University

About the instructor

17

Current position Assistant Professor, Mansoura University, 2015

Professional Training

Post Doctor University of Louisville, USA 2014PHD University of Louisville, USA 2008-2013

Master University of Mansoura 2004-2007MSc University of Mansoura 1998-2003

Research InterestsMedical image analysis, cancer imaging, brain

disorders, computer aided diagnosis systems

More details Research gate (or) Google scholar: Ahmed Elnakib

Page 18: Communication Theory II - ECED Mansoura · PDF fileThe Intel Microprocessors, Architecture, Programming and Interfacing, 8th edition, Barry B. Brey, ... USA 2008-2013 Master University

Lectures and office hours

Class TimeWednesday: 4th session

Thursday: 1st session

Instructor Ahmed Elnakib

Office ECE Dept. – Second floor, Room B3119

[email protected]

Email caption must start with “COM9323”

Office HoursWednesday: 2nd session, Thursday: 2nd session

or by appointment (email)

18

Page 19: Communication Theory II - ECED Mansoura · PDF fileThe Intel Microprocessors, Architecture, Programming and Interfacing, 8th edition, Barry B. Brey, ... USA 2008-2013 Master University

Assessment Method Marks Time

Mid Term Examination 20 Week 7

Semester work 20 Every week

Oral Examination 10 Week 12

Final Term Examination 100 Week 14

Total 150

Grading

19

Page 20: Communication Theory II - ECED Mansoura · PDF fileThe Intel Microprocessors, Architecture, Programming and Interfacing, 8th edition, Barry B. Brey, ... USA 2008-2013 Master University

How to get benefit from the class?

20

o Study regularly each week (min. 3 Hrs) and try to be eager in reading external materials, specially which improve the practice

o Be ready with software and try to gain practical skills

o Avoid external courses

Work hard and make it interesting

Rely on yourself and be independent

Invest in yourself

Page 21: Communication Theory II - ECED Mansoura · PDF fileThe Intel Microprocessors, Architecture, Programming and Interfacing, 8th edition, Barry B. Brey, ... USA 2008-2013 Master University

Lecture 1

Introduction

21

Page 22: Communication Theory II - ECED Mansoura · PDF fileThe Intel Microprocessors, Architecture, Programming and Interfacing, 8th edition, Barry B. Brey, ... USA 2008-2013 Master University

Lecture Objectives1. Draw the block diagram of a computer system

2. Describe the structure and function of the microprocessor

3. Provide an overview of the various 80X86 and Pentium family members

4. Define the contents of the memory system in the personal computer

5. Convert between binary, decimal, and hexadecimal numbers

6. Differentiate and represent numeric and alphabetic information as integers, floating-point, BCD, and ASCII data

7. Understand basic computer terminology (bit, byte, data, real memory system, protected mode memory system, Windows, DOS, I/O)

22

Page 23: Communication Theory II - ECED Mansoura · PDF fileThe Intel Microprocessors, Architecture, Programming and Interfacing, 8th edition, Barry B. Brey, ... USA 2008-2013 Master University

Computer Architecture: Major parts of a Computer System

23

1. Central Processing Unit (CPU, Microprocssor): acts as the brain coordinating all activities within a computer

a) data transfer between itself and the memory or I/O systems,

b) (2) simple arithmetic and logic operations

c) program flow via simple decisions

Page 24: Communication Theory II - ECED Mansoura · PDF fileThe Intel Microprocessors, Architecture, Programming and Interfacing, 8th edition, Barry B. Brey, ... USA 2008-2013 Master University

24

2. The Memory: The program instructions and data are primarily stored.

Computer Architecture: Major parts of a Computer System

Page 25: Communication Theory II - ECED Mansoura · PDF fileThe Intel Microprocessors, Architecture, Programming and Interfacing, 8th edition, Barry B. Brey, ... USA 2008-2013 Master University

Computer Architecture

25

3. The Input/Output (I/O) Devices:

oAllow the computer to input information for processing and then output the results.

o I/O Devices are also known as computer peripherals.

Page 26: Communication Theory II - ECED Mansoura · PDF fileThe Intel Microprocessors, Architecture, Programming and Interfacing, 8th edition, Barry B. Brey, ... USA 2008-2013 Master University

26Computer Architecture

Page 27: Communication Theory II - ECED Mansoura · PDF fileThe Intel Microprocessors, Architecture, Programming and Interfacing, 8th edition, Barry B. Brey, ... USA 2008-2013 Master University

How to connect/interface the basic parts of the computer?

27

• Bus: The CPU is connected to memory and I/O devices through a strip of wires called a bus. The bus inside a computer carries information from place to place.

• In every computer there are three types of busses. What are these types?

Page 28: Communication Theory II - ECED Mansoura · PDF fileThe Intel Microprocessors, Architecture, Programming and Interfacing, 8th edition, Barry B. Brey, ... USA 2008-2013 Master University

Main types of Computer Buses

28

Control Bus

Page 29: Communication Theory II - ECED Mansoura · PDF fileThe Intel Microprocessors, Architecture, Programming and Interfacing, 8th edition, Barry B. Brey, ... USA 2008-2013 Master University

1-Address Bus (Unidirectional)

29

oThe address bus is used to identify the memory location or I/O device the processor intends to communicate with

oThe width of the Address Bus is determined by the size of the memory addresses it can locate

o20 bits to address 1Mbyte (8086), 36 bits to address 64 GByte (Pentium II)

Page 30: Communication Theory II - ECED Mansoura · PDF fileThe Intel Microprocessors, Architecture, Programming and Interfacing, 8th edition, Barry B. Brey, ... USA 2008-2013 Master University

2- Data Bus (Bidirectional)

30

oData bus is used by the CPU to get data from / to send data to the memory or the I/O devices.

o The width of data bus determine the data size it can carry

oThe size of data bus of Intel microprocessors vary [8-bit (8085), 64-bit (Pentium)]

Page 31: Communication Theory II - ECED Mansoura · PDF fileThe Intel Microprocessors, Architecture, Programming and Interfacing, 8th edition, Barry B. Brey, ... USA 2008-2013 Master University

3-Control Bus (Unidirectional)

31

oTell if the address on the bus is memory address or an I/O device address

oEach time the processor outputs an address it also activates one of the four control bus signals: Memory Read, Memory Write, I/O Read and I/O Write.

Page 32: Communication Theory II - ECED Mansoura · PDF fileThe Intel Microprocessors, Architecture, Programming and Interfacing, 8th edition, Barry B. Brey, ... USA 2008-2013 Master University

How a program is executed inside the MP?

32

o A program stored in the memory provides instructions to the CPU to perform a

specific action. This action can be a simple addition

o It is function of the CPU to fetch the program instructions from the memory to the MP registers and execute them.

Page 33: Communication Theory II - ECED Mansoura · PDF fileThe Intel Microprocessors, Architecture, Programming and Interfacing, 8th edition, Barry B. Brey, ... USA 2008-2013 Master University

Example-1: Memory Read

33

The microprocessor reads the contents of a memory location by:

1. Sending the memory the desired memory location through the address bus

2. Sending the memory read control signal (Activate 𝑀𝑅𝐷𝐶; 𝑀𝑅𝐷𝐶=0)

3. Finally, the data read from the memory are passed to the microprocessor through the data bus

Page 34: Communication Theory II - ECED Mansoura · PDF fileThe Intel Microprocessors, Architecture, Programming and Interfacing, 8th edition, Barry B. Brey, ... USA 2008-2013 Master University

Example-2: Input Output Write

34

oIf 𝐼𝑂𝑊𝐶 is active (𝐼𝑂𝑊𝐶=0), then, the microprocessor is writing data from the data bus to an I/O device whose address appears on the address bus

Page 35: Communication Theory II - ECED Mansoura · PDF fileThe Intel Microprocessors, Architecture, Programming and Interfacing, 8th edition, Barry B. Brey, ... USA 2008-2013 Master University

Main Memory Types: ROM

35

ROM (Read Only Memory, nonvolatile memory) the information in ROM is permanent and not lost when the power is turned off

Page 36: Communication Theory II - ECED Mansoura · PDF fileThe Intel Microprocessors, Architecture, Programming and Interfacing, 8th edition, Barry B. Brey, ... USA 2008-2013 Master University

Main Memory Types: RAM (Primary Storage)

36

RAM (Random Access Memory/ Read-Write memory, volatile

memory) is used by the computer for the temporary storage of the

programs that is running. Data is lost when the computer is turned off.

Page 37: Communication Theory II - ECED Mansoura · PDF fileThe Intel Microprocessors, Architecture, Programming and Interfacing, 8th edition, Barry B. Brey, ... USA 2008-2013 Master University

Secondary Storage: I/O devices

37

o Refer to magnetic /optical disks (I/O devices)

Page 38: Communication Theory II - ECED Mansoura · PDF fileThe Intel Microprocessors, Architecture, Programming and Interfacing, 8th edition, Barry B. Brey, ... USA 2008-2013 Master University

Example: 8085 Intel Microprocessor

38

o 16 bit address bus to select an address between 64Mbyte memoryo 8 bit data bus to fetch 8 bits to its internal registers

Page 39: Communication Theory II - ECED Mansoura · PDF fileThe Intel Microprocessors, Architecture, Programming and Interfacing, 8th edition, Barry B. Brey, ... USA 2008-2013 Master University

Simple Microprocessor Architecture

39

Page 40: Communication Theory II - ECED Mansoura · PDF fileThe Intel Microprocessors, Architecture, Programming and Interfacing, 8th edition, Barry B. Brey, ... USA 2008-2013 Master University

Microprocessor Architecture: Registers

40

1. The CPU contains a number of registers to store information inside the CPU temporarily. Registers inside the CPU can be 8-bit, 16-bit, 32-bit or even 64-bit depending on the CPU.

Page 41: Communication Theory II - ECED Mansoura · PDF fileThe Intel Microprocessors, Architecture, Programming and Interfacing, 8th edition, Barry B. Brey, ... USA 2008-2013 Master University

Microprocessor Architecture: ALU

41

2. The CPU also contains Arithmetic and Logic Unit (ALU). The ALU performs arithmetic (add, subtract, multiply, divide) and logic (AND, OR, NOT) functions.

Page 42: Communication Theory II - ECED Mansoura · PDF fileThe Intel Microprocessors, Architecture, Programming and Interfacing, 8th edition, Barry B. Brey, ... USA 2008-2013 Master University

Microprocessor Architecture: Instruction Pointer

42

3. The CPU contains a program counter also known as theInstruction Pointer to point the address of the next instruction to beexecuted.

Page 43: Communication Theory II - ECED Mansoura · PDF fileThe Intel Microprocessors, Architecture, Programming and Interfacing, 8th edition, Barry B. Brey, ... USA 2008-2013 Master University

Microprocessor Architecture: Instruction Decoder

43

4. Instruction Decoder is a kind of dictionary which is used tointerpret the meaning of the instruction fetched into the CPU.Appropriate control signals are generated according to the meaningof the instruction.

Page 44: Communication Theory II - ECED Mansoura · PDF fileThe Intel Microprocessors, Architecture, Programming and Interfacing, 8th edition, Barry B. Brey, ... USA 2008-2013 Master University

44

Interaction between MP, memory and I/O devices

Page 45: Communication Theory II - ECED Mansoura · PDF fileThe Intel Microprocessors, Architecture, Programming and Interfacing, 8th edition, Barry B. Brey, ... USA 2008-2013 Master University

Questions

45