Presentation is loading. Please wait.

Presentation is loading. Please wait.

Microprocessors and Programming Department of Mechatronics Engineering

Similar presentations


Presentation on theme: "Microprocessors and Programming Department of Mechatronics Engineering"— Presentation transcript:

1 Microprocessors and Programming Department of Mechatronics Engineering
Lecture 1 1 Microprocessors and Programming Dr. Kadir ERKAN Department of Mechatronics Engineering Fall : 2017 6/12/2018

2 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) 6/12/2018

3 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 6/12/2018

4 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 6/12/2018

5 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 6/12/2018

6 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 6/12/2018

7 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 6/12/2018

8 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 6/12/2018

9 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. :: 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 6/12/2018

10 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. 6/12/2018

11 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 6/12/2018

12 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 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 6/12/2018

13 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) 6/12/2018

14 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… 6/12/2018

15 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. 6/12/2018

16 What is a Microcontroller???
• Microprocessor: refers to LSI circuit implementation of a CPU • Microcomputer: microprocessor + memory + I/O • Microcontroller: Microcomputer on single chip 6/12/2018

17 Microcontroller Architectures
6/12/2018

18 Instruction Set Samples
8051 68HC11 PIC Machine dependency!!! 6/12/2018 18

19 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). 6/12/2018 19

20 Instruction Set Samples
Lecture 1 1 Instruction Set Samples 6/12/2018 20


Download ppt "Microprocessors and Programming Department of Mechatronics Engineering"

Similar presentations


Ads by Google