Microprocessors and Programming Department of Mechatronics Engineering

Slides:



Advertisements
Similar presentations
Microcontroller – 3 PIC.
Advertisements

Processor System Architecture
Khaled A. Al-Utaibi  Computers are Every Where  What is Computer Engineering?  Design Levels  Computer Engineering Fields  What.
Engr. M.K.Debnath1 Microcontroller and PLC Eng. ISRAFIL KHAN. DIPLOMA IN ELECTRONIC.
Microprocessor and Microcontroller Based Systems Instructor: Eng.Moayed N. EL Mobaied The Islamic University of Gaza Faculty of Engineering Electrical.
Chapter 4 Processor Technology and Architecture. Chapter goals Describe CPU instruction and execution cycles Explain how primitive CPU instructions are.
Computer Organization and Assembly language
Basic Computer Organization CH-4 Richard Gomez 6/14/01 Computer Science Quote: John Von Neumann If people do not believe that mathematics is simple, it.
Microcontroller based system design
COMPONENTS OF THE SYSTEM UNIT
1 © Unitec New Zealand Embedded Hardware ETEC 6416 Date: - 10 Aug,2011.
Computer Organization
C.S. Choy95 COMPUTER ORGANIZATION Logic Design Skill to design digital components JAVA Language Skill to program a computer Computer Organization Skill.
Computer Systems 1 Fundamentals of Computing The CPU & Von Neumann.
E0001 Computers in Engineering1 The System Unit & Memory.
Introduction to Computing: Lecture 4
Invitation to Computer Science 5th Edition
 Design model for a computer  Named after John von Neuman  Instructions that tell the computer what to do are stored in memory  Stored program Memory.
Computers organization & Assembly Language Chapter 0 INTRODUCTION TO COMPUTING Basic Concepts.
Computer Organization - 1. INPUT PROCESS OUTPUT List different input devices Compare the use of voice recognition as opposed to the entry of data via.
SKILL AREA: 1.2 MAIN ELEMENTS OF A PERSONAL COMPUTER.
Computer Hardware A computer is made of internal components Central Processor Unit Internal External and external components.
Computer Structure & Architecture 7b - CPU & Buses.
Computer Studies/ICT SS2
MICROOCESSORS AND MICROCONTROLLER:
Computer and Information Sciences College / Computer Science Department CS 206 D Computer Organization and Assembly Language.
Computer operation is of how the different parts of a computer system work together to perform a task.
1 Basic Processor Architecture. 2 Building Blocks of Processor Systems CPU.
Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.
STUDY OF PIC MICROCONTROLLERS.. Design Flow C CODE Hex File Assembly Code Compiler Assembler Chip Programming.
Chapter 2 content Basic organization of computer What is motherboard
COMP2121: Microprocessors and Interfacing
Computer Hardware What is a CPU.
CPU Lesson 2.
Computer Organization and Architecture Lecture 1 : Introduction
Unit Microprocessor.
Basic Computer Organization and Design
Microprocessor and Microcontroller Fundamentals
MICROCONTROLLER ARCHITECTURE & ASSEMBLY LANGUAGE PROGRAMMING
COURSE OUTCOMES OF Microprocessor and programming
Microprocessor and Microcontroller Fundamentals
Computer Organization and Architecture + Networks
Computing Systems Organization
Microprocessors and Programming Department of Mechatronics Engineering
Edexcel GCSE Computer Science Topic 15 - The Processor (CPU)
UNIT – Microcontroller.
Discovering Computers 2011: Living in a Digital World Chapter 4
Chapter 7.2 Computer Architecture
MCU – Microcontroller Unit – 2
Modified Harvard Architectures
IPCOWALA INSTITUTE OF ENGINEERING & TECHNOLOGY-DHARMAJ
The Central Processing Unit
Lecture on Microcomputer
Introduction of microprocessor
Overview Introduction General Register Organization Stack Organization
Memory Units Memories store data in units from one to eight bits. The most common unit is the byte, which by definition is 8 bits. Computer memories are.
Microprocessor and Assembly Language
Introduction to Microprocessors
Electronics Technology
An Introduction to Microprocessor Architecture using intel 8085 as a classic processor
Introduction to Microprocessors and Microcontrollers
Number Representations and Basic Processor Architecture
CISC AND RISC SYSTEM Based on instruction set, we broadly classify Computer/microprocessor/microcontroller into CISC and RISC. CISC SYSTEM: COMPLEX INSTRUCTION.
Morgan Kaufmann Publishers Computer Organization and Assembly Language
ECEG-3202 Computer Architecture and Organization
Introduction to Microprocessor Programming
Chapter 5 Computer Organization
Microcontroller – 2 PIC.
Computer Architecture
WJEC GCSE Computer Science
Presentation transcript:

Microprocessors and Programming Department of Mechatronics Engineering Lecture 1 1 Microprocessors and Programming Dr. Kadir ERKAN Department of Mechatronics Engineering Fall : 2017 11/26/2019

Basic Structure of Microcomputers Elements of a microcomputer system are connected each other via SYSTEM BUSES. System Buses are comprised of three distinctive structures; Data Bus: conveyes actual data from the pheripheral devices to CPU or vice versa. Address Bus: carries the information on which device the CPU is communicating with. Control Bus: transmits commands from the CPU and returns status signals from the pheripheral devices. Elements of a microcomputer; Peripheral Input (input port) Peripheral Output (output port) Peripheral Storage (memory) Central Processing Unit (mP) 11/26/2019

Operation of CPU • Fetch cycle (phase): o The CPU puts the address of the instruction to be executed on the address bus. The address information comes from the program counter (PC) maintained by the control unit. o The control bus holds the information for reading the memory location and the data bus holds the instruction from the memory which is stored into the instruction register (IR) o PC is updated to point to the next instruction. • Execute cycle (phase): o Instruction in the IR is decoded o The required data transfer and the required logical and arithmetic operation are performed o The result is written back either to one of the registers or memory or I/O device 11/26/2019

Microcomputer Memory Technologies Traditionally, memory technology is divided into two categories: (1) Volatile: This is memory that only works as long as it is powered. It loses its stored value when power is removed, but can be used as memory for temporary data storage Generally, this type of memory uses simple semiconductor technology and is easier to write to from an electrical point of view Commonly called RAM (Random Access Memory) (2) Non-volatile: This is memory that retains its stored value even when power is removed. In an embedded system it is achieved using non-volatile semiconductor memory Non-volatile memory is used for holding the computer program and for historical reasons has commonly been called ROM (Read-Only Memory), FLASH ROM, EEPROM,… With sophisticated memory technology available now, the division of function between these two memory categories is becoming increasingly blurred 11/26/2019

Microcomputer Memory Types Two main types of memory in a computer: Program memory: holds the program that the computer will execute This memory needs to be permanent; whether power is applied or not, and it is ready to run as soon as power is applied (non-volatile) Data memory: is used for holding temporary data, which the program works on as it runs (volatile) This memory type need not be permanent Every memory has two types of communication paths (buses): The address of the memory location required (address bus) – mainly unidirectional The actual data that belongs in the location (data bus) – mainly bidirectional 11/26/2019

Hardware Architecture of Microcomputers Achieving high performance specifications in a microcomputer system is hidden in the design underlying hardware architecture. There are two types computer architectures based on the configuration of address and data bus. Hardware Architecture Von-Neuman Architecture Harvard Architecture Modified Edilmiş Harvard Architecture 11/26/2019

Von Neuman (Princeton) Architecture The computer has just one address bus and one data bus The same address and data buses serve both program and data memories Simple and logical, and gives a certain type of flexibility However, it suffers from two disadvantages: It’s the same data bus for all areas of memory, even if one area wants to deal with large words and another wants to deal with small It also has the problem of all things that are shared - if the CPU is accessing program memory, then data memory must be idle and vice versa 11/26/2019

Harward Architecture Every memory area gets its own address bus and its own data bus Different program and data bus widths (size) are possible, allowing program and data memory to be better optimized to the architectural requirements Data and program can be accessed simultaneously Example (PIC 8-bit MPU): If the instruction format requires 14 bits then program bus and memory can be made 14-bit wide, while the data bus and data memory remain 8-bit wide 11/26/2019

Modified Harward Architecture A variation of Harvard architecture that allows the contents of the instruction memory to be accessed as if it was data E.g.: AVR, TMS320, Zilog, Blackfin, etc. :: http://www.freepatentsonline.com/y2002/0184465.html A pure Harvard architecture computer suffers from the disadvantage that mechanisms must be provided to separately load the program to be executed into instruction memory and any data to be operated upon into data memory Additionally, modern Harvard architecture machines often use a read-only technology for the instruction memory and read/write technology for the data memory. This allows the computer to begin execution of a preloaded program as soon as power is applied. The data memory will at this time be in an unknown state, so it is not possible to provide any kind of pre-defined data values to the program. Modified Harvard Architecture attempts to solve these problems 11/26/2019

Harward vs Von Neuman The Von Neumann architecture has only one memory space to store both program and data memory. This means that it is necessary to fetch instructions and data from the same memory space, which limits your bandwidth because you can only transmit one piece of data or one instruction at one time. With the Harvard architecture, there are two separate memory spaces, one for instructions and one for data. You can increase your throughput because while fetching the next instruction you can still be writing the result from the previous instruction. The other advantage is that since this is an 8-bit microcontroller, the data memory is 8-bits wide, but the program memory can be any width you choose. On existing PICmicro architectures, the program memory used is either 12- bits, 14-bits, or 16-bits wide. The architecture we will be discussing today is the x14 architecture, which has a 14 bit wide program memory space. 11/26/2019

Software Architecture of Microcomputers There are mainly two software architecture types: directly effected by hardware architectures number of instruction and execution time depend on the used architecture… Instruction Set Architecture EPIC Explicitly Parallel Instruction Computing RISC Reduced Instruction Set Computer CISC Complex Instruction Set Computer 11/26/2019

CISC : Complex Instruction Set Computer In the early days of computing, silicon was expensive Bigger program, more memory storage, more silicon, more costly (money) – so there were only few instructions As time progressed, more and more facilities were required, so more and more instructions were added However, according to the 20-80 rule, 20% of the available instructions are likely to be used 80% of the time, with some instructions only used very rarely. Some of these instructions are very complex. CISC provides a large and powerful range of instructions, which is less flexible to implement Because of the costly memory, it was needed to reduce the number of instructions per program Number of instructions are reduced by having multiple operations within a single instruction 11/26/2019

RISC : Reduced Instruction Set Computer The RISC concept is to identify the sub-components in CISC instructions, and use them Hence each instruction performs less work, but the instruction has fixed length and the execution time is fixed As these are much simpler operations, they can be implemented directly in silicon, so will run at the maximum possible speed The complexity is removed from the hardware into the domain of the assembly programmer/compiler (software) www.seas.upenn.edu/~palsetia/cit595s07/RISCvsCISC.pdf http://www.heyrick.co.uk/assembler/riscvcisc.html 11/26/2019

Instruction Set Comparison: CISC vs. RISC CISC Example: The 8086 microprocessor family has 32 jump (branch) instructions: JA - Jump if Above JAE - Jump if Above or Equal JB - Jump if Below JPO - Jump if Parity Odd JZ - Jump if Zero, … 8051 has 255 different instructions… RISC Example: The PIC16F family has only 4 jump (branch) instructions: BTFSC - Bit Test File & Skip if Clear BTFSS - Bit Test File & Skip if Set, … PIC16FXXX has 35 different instruction… 11/26/2019

What is a Microcontroller??? A microcontroller (sometimes abbreviated µC, uC or MCU) is a small computer on a single integrated circuit containing a processor core, memory, and programmable input/output peripherals. Program memory in the form of NOR flash or OTP ROM is also often included on chip, as well as a typically small amount of RAM. Microcontrollers are designed for embedded applications, in contrast to the microprocessors used in personal computers or other general purpose applications. 11/26/2019

What is a Microcontroller??? • Microprocessor: refers to LSI circuit implementation of a CPU • Microcomputer: microprocessor + memory + I/O • Microcontroller: Microcomputer on single chip 11/26/2019

Microcontroller Architectures 11/26/2019

Instruction Set Samples 8051 68HC11 PIC Machine dependency!!! 11/26/2019 18

Fundamental Concepts… Lecture 1 1 Fundamental Concepts… RAM/RWM – Random access memory/read-write memory. Volatile, loss of contents when power is removed. ROM – Read only memory. Programmed at factory. PROM – Programmable (by user) read only memory. EPROM – Erasable (by UV light) PROM. OTP EPROM – One-time programmable EPROM (no UV window, hardly erasable!) EEPROM – Electrically erasable PROM. Flash – EEPROM that is erased and written in blocks, faster than EEPROM. Byte (8 bits), nibble/nybble (4 bits), word (16 bits on our processor). 11/26/2019 19

Instruction Set Samples Lecture 1 1 Instruction Set Samples 11/26/2019 20