Microprocessor (COM 9323) Lecture 1: Introduction Ahmed Elnakib, PhD Assistant Professor, Mansoura University, Egypt Feb 17 th, 2016 1
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 *Subject to 20% variability 2
What is the Course Objective? o To give a good overview of the course objectives, we will start list some important microprocessors applications 3
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 of their low power consumption. o A typical application is in the area of embedded systems ouse powerful processors and may need external flash/ram memory 4
SoCs: FPGA (Field Programmable Gate Array) A Xilinx Zynq-7000 All Programmable System on a Chip
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 tuner o Baseband signals are passed into an analog-to digital converter o 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
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
Microprocessors Applications: Microcontrollers o Microcontrollers is a small computer (SoC) on a single integrated circuit containing a processor core, memory, and programmable input/output peripherals It 8
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
Microcontrollers: Arduino oan 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 Arduino IDE uses a simplified version of C++ for programming 10
Microcontroller: Raspberry Pi 11
Report 01: Due to Feb. 24 th, 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. Adruino 4. Raspberry Pi 5. 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 device 2. References o Report will be delivered by hand before the lecture 12
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 Intel microprocessor family 13
Questions? 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
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
Text Book/References Textbook: 1. The Intel Microprocessors, Architecture, Programming and Interfacing, 8 th edition, Barry B. Brey, Prentice Hall, 2009 2. Assembly Language for x86 processors, 6 th edition, K. R. Irvine, Prentice Hall, 2011 References: 1. Computer Architecture: A Quantitative Approach, 5 th edition, J. Hennessy, D. Patterson, Elsevier, 2012. 2. The 80x86 Family, Design, Programming and Interfacing, 3 rd edition, Prentice Hall, 2002 3. The 80x86 IBM PC and Compatible Computers, Assembly Language, Design, and Interfacing, 4 th edition, M.A. Mazidi and J.G. Mazidi, Prentice Hall, 2003 16
About the instructor Current position Assistant Professor, Mansoura University, 2015 Professional Training Research Interests Post Doctor University of Louisville, USA 2014 PHD University of Louisville, USA 2008-2013 Master University of Mansoura 2004-2007 MSc University of Mansoura 1998-2003 Medical image analysis, cancer imaging, brain disorders, computer aided diagnosis systems More details Research gate (or) Google scholar: Ahmed Elnakib 17
Lectures and office hours Class Time Instructor Office E-Mail Office Hours Wednesday: 4 th session Thursday: 1 st session Ahmed Elnakib ECE Dept. Second floor, Room B3119 eng.nakib@gmail.com Email caption must start with COM9323 Wednesday: 2 nd session, Thursday: 2 nd session or by appointment (email) 18
Grading 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 19
How to get benefit from the class? 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 20
Lecture 1 Introduction 21
Lecture Objectives 1. 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
Computer Architecture: Major parts of a Computer System 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 23
Computer Architecture: Major parts of a Computer System 2. The Memory: The program instructions and data are primarily stored. 24
Computer Architecture 3. The Input/Output (I/O) Devices: o Allow the computer to input information for processing and then output the results. o I/O Devices are also known as computer peripherals. 25
Computer Architecture 26
How to connect/interface the basic parts of the computer? 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? 27
Main types of Computer Buses Control Bus 28
1-Address Bus (Unidirectional) 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) 29
2- Data Bus (Bidirectional) 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)] 30
3-Control Bus (Unidirectional) 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. 31
How a program is executed inside the MP? 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. 32
Example-1: Memory Read 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 MRDC; MRDC=0) 3. Finally, the data read from the memory are passed to the microprocessor through the data bus 33
Example-2: Input Output Write oif IOWC is active (IOWC=0), then, the microprocessor is writing data from the data bus to an I/O device whose address appears on the address bus 34
Main Memory Types: ROM ROM (Read Only Memory, nonvolatile memory) the information in ROM is permanent and not lost when the power is turned off 35
Main Memory Types: RAM (Primary Storage) 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. 36
Secondary Storage: I/O devices o Refer to magnetic /optical disks (I/O devices) 37
Example: 8085 Intel Microprocessor o 16 bit address bus to select an address between 64Mbyte memory o 8 bit data bus to fetch 8 bits to its internal registers 38
Simple Microprocessor Architecture 39
Microprocessor Architecture: Registers 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. 40
Microprocessor Architecture: ALU 2. The CPU also contains Arithmetic and Logic Unit (ALU). The ALU performs arithmetic (add, subtract, multiply, divide) and logic (AND, OR, NOT) functions. 41
Microprocessor Architecture: Instruction Pointer 3. The CPU contains a program counter also known as the Instruction Pointer to point the address of the next instruction to be executed. 42
Microprocessor Architecture: Instruction Decoder 4. Instruction Decoder is a kind of dictionary which is used to interpret the meaning of the instruction fetched into the CPU. Appropriate control signals are generated according to the meaning of the instruction. 43
Interaction between MP, memory and I/O devices 44
Questions 45