Microcomputer Principle and Interface Technology - Introduction 计算机学院 李征 Tel : 13882153765 : OICQ: 1340915.

Slides:



Advertisements
Similar presentations
System Integration and Performance
Advertisements

Instruction Classification and Addressing Mode 计算机学院 李征 Tel : : OICQ:
Parul Polytechnic Institute
Dr. Rabie A. Ramadan Al-Azhar University Lecture 3
Chapter 8: Central Processing Unit
Khaled A. Al-Utaibi 8086 Bus Design Khaled A. Al-Utaibi
8086.  The 8086 is Intel’s first 16-bit microprocessor  The 8086 can run at different clock speeds  Standard 8086 – 5 MHz  –10 MHz 
The Intel Microprocessors. --from 8086 to Pentium
The 8085 Microprocessor Architecture
The 8085 Microprocessor Architecture. Contents The 8085 and its Buses. The address and data bus ALU Flag Register Machine cycle Memory Interfacing The.
Processor System Architecture
Lecturer: Mu Lingling (穆玲玲)
Introduction to Computers and Programming. Some definitions Algorithm: –A procedure for solving a problem –A sequence of discrete steps that defines such.
Recap – Our First Computer WR System Bus 8 ALU Carry output A B S C OUT F 8 8 To registers’ input/output and clock inputs Sequence of control signal combinations.
I/O Subsystem Organization and Interfacing Cs 147 Peter Nguyen
Group 5 Alain J. Percial Paula A. Ortiz Francis X. Ruiz.
Input / Output CS 537 – Introduction to Operating Systems.
Khaled A. Al-Utaibi  Intel Peripheral Controller Chips  Basic Description of the 8255  Pin Configuration of the 8255  Block Diagram.
An Interactive Web-Based Simulation of a General Computer Architecture
Basic Microcomputer Design. Inside the CPU Registers – storage locations Control Unit (CU) – coordinates the sequencing of steps involved in executing.
Lecture 8 Presented By Dr. Shazzad Hosain Asst. Prof. EECS, NSU.
created by :Gaurav Shrivastava
CS 1308 Computer Literacy and the Internet Computer Systems Organization.
Electrical Engineering Department Engineering College Prince Sattam bin Abdul Aziz University Text Book: - Triebel and Singh, "The 8088 and 8086 Microprocessors",
Information Representation: Machine Instructions
MICROPROCESSOR INPUT/OUTPUT
Chapter 5: Computer Systems Organization Invitation to Computer Science, Java Version, Third Edition.
Computer Systems Organization CS 1428 Foundations of Computer Science.
Computers organization & Assembly Language Chapter 0 INTRODUCTION TO COMPUTING Basic Concepts.
Computer Architecture Lecture10: Input/output devices Piotr Bilski.
CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University1 Input/Output CS 342 – Operating Systems Ibrahim Korpeoglu Bilkent University.
Microprocessor Dr. Rabie A. Ramadan Al-Azhar University Lecture 2.
Fall 2012 Chapter 2: x86 Processor Architecture. Irvine, Kip R. Assembly Language for x86 Processors 6/e, Chapter Overview General Concepts IA-32.
Chapter 3 Programming Languages Unit 1 The Development of Programming Languages.
Lecture 14 Today’s topics MARIE Architecture Registers Buses
Accessing I/O Devices Processor Memory BUS I/O Device 1 I/O Device 2.
8085. Microcomputer Major components of the computer - the processor, the control unit, one or more memory ICs, one or more I/O ICs, and the clock Major.
Introduction to Microprocessors
INTRODUCTION.  Upon completing this topic, you should be able to: Illustrate a basic elements of digital computer system and their functions, Depicts.
Z80 Overview internal architecture and major elements of the Z80 CPU.
Computer Hardware A computer is made of internal components Central Processor Unit Internal External and external components.
CS 1308 Computer Literacy and the Internet. Objectives In this chapter, you will learn about:  The components of a computer system  Putting all the.
Computer and Information Sciences College / Computer Science Department CS 206 D Computer Organization and Assembly Language.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Control Unit.
Introduction to Microprocessors - chapter3 1 Chapter 3 The 8085 Microprocessor Architecture.
Computer operation is of how the different parts of a computer system work together to perform a task.
بسم الله الرحمن الرحيم MEMORY AND I/O.
The 8085 Microprocessor Architecture. What 8085 meant for? 80 - year of invention bit processor 5 - uses +5V for power.
8088 CPU External Pins, Timing, and IBM PC BUS 四川大学计算机学院 李征 Tel: Oicq:
1 Basic Processor Architecture. 2 Building Blocks of Processor Systems CPU.
Capability of processor determine the capability of the computer system. Therefore, processor is the key element or heart of a computer system. Other.
The Processor & its components. The CPU The brain. Performs all major calculations. Controls and manages the operations of other components of the computer.
8085 INTERNAL ARCHITECTURE.  Upon completing this topic, you should be able to: State all the register available in the 8085 microprocessor and explain.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Control Unit.
Computer Operation. Binary Codes CPU operates in binary codes Representation of values in binary codes Instructions to CPU in binary codes Addresses in.
Recap – Our First Computer WR System Bus 8 ALU Carry output A B S C OUT F 8 8 To registers’ read/write and clock inputs Sequence of control signal combinations.
8 085Microprocessor Temp Reg (8) Accumulator (A reg) Flag flip flops(8) Instruction Register (8) Arithmetic Logic Unit ALU Instruction Decoder and Machine.
Unit Microprocessor.
COURSE OUTCOMES OF Microprocessor and programming
COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE
Lecture on Microcomputer
A Closer Look at Instruction Set Architectures
An Introduction to Microprocessor Architecture using intel 8085 as a classic processor
Interfacing Memory Interfacing.
Morgan Kaufmann Publishers Computer Organization and Assembly Language
ECEG-3202 Computer Architecture and Organization
The 8085 Microprocessor Architecture
ECEG-3202 Computer Architecture and Organization
Computer Operation 6/22/2019.
Chapter 10 Instruction Sets: Characteristics and Functions
Presentation transcript:

Microcomputer Principle and Interface Technology - Introduction 计算机学院 李征 Tel : : OICQ:

Course Content Architecture and Mechanism of 8088/8086 CPU 8088/8086 Instruction System and Programming with Assembler Language Architecture and Mechanism of PC System (PC Bus) Basic I/O Interface and Basic Programming for I/O Interface

Content of this chapter 1. Basic architecture of microcomputer 2. Basic signals and temporal procedure in microcomputer 3. Machine instruction and assembler language

Essential Parts of Computer Center Process Unit BusMemory I/O Interface I/O Device Five essential parts are necessary for all computers.

General Architecture of Computer CPU Bus ( Data, Address, Control ) Memory I/O Interface I/O Device

Essential Storage Cell in Computer Register in CPU Memory Cell I/O Port (Register in I/O Interface) Three types of essential storage cell in all computers. Questions: 1. What is the main function of the bus? 2. What do our programs mainly do?

Address Every storage cell has an unique address. The address must be provided on the bus before a storage cell can be operated.

Binary Information Although we use decimal numbers in the program design, all information in computer is binary. There only two signal types in computer, which is 0 and 1. The basic unit of a storage cell is bit.

Basic storage unit SDSD RDRD QnQn Q n * RDRD SDSD QQ 维持置1置1 清0清0 非法

Basic storage unit

Basic Address Unit - Byte Byte is composed of 8 bits. In microcomputer, every unique storage cell in memory is a byte which has an unique address. Word length is the maximal bit number which CPU can process synchronously.

(1) Center Process Unit Pentium Pentium CPU

(1) Center Process Unit (1) CPU control other parts of computer with temporal logic automatically. (2) CPU execute programs in the memory.

Temporal Procedure Temporal procedure is the control procedure performed step by step and orderly. Two types of temporal procedure are performed by CPU.

Temporal Procedure 1) Non-instruction execution: reading instruction bytes from memory, Interrupt procedure, etc. 2) Instruction execution (Program is composed of instructions stored in memory)

Most operations in temporal procedure reading or writing registers in CPU, memory cell, or I/O port performing arithmetic or logic operation with ALU (Arithmetic Logic Unit)

(2) System Bus PCI Bus ISA Bus

(2) System Bus Bus provide necessary signal connections between CPU, memory and I/O Interface. There are three types of bus in bus architecture, which are address bus, data bus and control bus.

(2) System Bus Microcomputer Architecture Control Bus (CB) Data Bus (DB) Address Bus ( AB) Bus Generator CPU Subsystem I/O Device I/O Interface Memory System Bus

Bus Operation in Temporal Procedure When memory cell or I/O port is to be operated, bus operation is necessary in temporal procedure. Operation of registers in CPU does not need system bus.

Address Bus Cell Address must be provided on address bus when cell is to be operated (reading or writing). Generally, higher part of address is for chip selection, and lower part of address is for cell selection. Address bus is unidirectional bus.

Data Bus When CPU write a binary data to a memory cell or I/O port, it output data signals to data bus. When CPU read a binary data from a memory cell or I/O port, it input data signals from data bus. Data bus is bidirectional.

Control Bus CPU send basic control signals by control bus to memory or I/O interface. (For example, RD and WR signals). I/O interface send basic status signals by control bus to CPU (For example, Interrupt signal). Observed individually, Control bus is unidirectional. As a whole, it is bidirectional.

(3) Memory

Memory is the storage center of computer. If a program is expected to be performed, it must be loaded in memory first. The instructions which form the program, and the data which used by program are all stored in memory.

(4) I/O Interface I/O interface is a circuit which connect the system bus and I/O device. Why there is an interface needed between bus and device? 1) Signal Difference: Signals in I/O devices is much different from signals in system bus. 2) Transfer Rate Difference: Data transfer rates of I/O device and CPU may be very different.

(4) I/O Interface

I/O Port Registers in I/O interface are called I/O ports in program design. There are three types of I/O port in interface, which are data, command, status port separately.

Functions of I/O Interface 1) It provides signal transformation between I/O device and system bus. 2) It provides data buffer to avoid data lost in transfer because of the transfer rate difference between device and CPU.

Functions of I/O Interface 3) It provides interaction ways between CPU and I/O devices. 4) It make devices can be controlled by program.

Signal Transformation 1) Transformation between Analog signal and Digital signal Example: Sound input and output 2) Transformation between different digital signals

Signal Transformation For input device, input signal is transformed to binary data, and stored in data port by interface, waiting for reading by CPU. For output device, CPU writes the output binary data into data port, waiting for outputting by interface.

Data Buffer For input device, if device provides an input when CPU is busy, the interface stored the input data in data port. For output device, if CPU provides an output when interface is busy, the interface stored the output data in data port.

Interaction between I/O interface and CPU 1) CPU send commands to interface with command port. For example: Setting the operation mode of interface or device

Interaction between I/O interface and CPU 2) CPU check the status of the interface with status port. For example: CPU check the input status to know if there is input data in data port. CPU check the output status to know if the output data in data port has been outputted.

Interaction between I/O interface and CPU 3) Interrupt (active status) For example: If there is input data in data port, interface send interrupt signal to CPU.

Programmable Interface CPU interacts with I/O interface by I/O port operations (mostly by I/O instructions). Generally, these I/O port operations are performed orderly and logically. If we make a program to perform these I/O port operations, this program is called a driver.

(5) I/O Device

Content of this chapter 1. Basic architecture of microcomputer 2. Basic signals and temporal procedure in microcomputer 3. Machine instruction and assembler language

Basic Signals Clock (CLK, sent by Clock Generator) Read (RD, sent by CPU) Write (WR, sent by CPU) Chip Select (CS, generated on Address Bus) Interrupt (INT, sent by interface) Interrupt Acknowledge (INTA sent by CPU)

Clock Clock: A periodic signal sent by clock generator, its cycle is called clock cycle (时钟周期,节拍). The clock signal is necessary for CPU temporal procedure. The clock cycle is the basic time unit in temporal procedure.

Clock T time

Clock Any temporal procedure is composed of multiple clock cycles. The clock cycle also used to describe the process speed of CUP. Shorter cycle implied faster processing.

Read and Write The bus operations (temporal procedure with system bus) performed by CPU can be summarized as reading and writing. When CPU expect to read or write a memory cell or I/O port, it sends read or write signal to control bus.

Reading and Writing Cycle The time consumed in reading or writing procedure is always composed of multiple clock cycles. The time consumed in reading or writing procedure is called reading or writing cycles.

Chip Select When CPU expect to read or write a cell outside, cell address must be provided on the address bus. The address decoder (on address bus or in chips) decode the higher part of cell address to generate chip select signal. Chip select signal is used to select memory chip or I/O interface chip, and the lower part address is used to locate the cell.

Address Decoder Input : n Output : <=2 n

Chip Select Important: Only when chip select is valid for a chip, the cells in it can be operated.

Interrupt and Interrupt Acknowledge When an input device expect transfer input data to CPU or an output device expect output data from CPU, it can send interrupt signal to CPU with control bus.

Interrupt and Interrupt Acknowledge If interrupt acknowledge of CPU is allowed, and when the current instruction has been finished by CPU, CPU send interrupt acknowledge signal to I/O interface.

Interrupt and Interrupt Acknowledge If CPU does not accept the interrupt, the I/O interface maintain the interrupt on control bus until CPU accept it.

Interrupt Acknowledge Cycle The temporal procedure of interrupt acknowledge is complex. The time consumed in interrupt acknowledge procedure is called interrupt acknowledge cycle.

Temporal Procedure Temporal procedure is the control procedure (signal interaction procedure) performed step by step and orderly. Clock cycle is the basic time unit of temporal procedure, and each cycle finish a single step.

Temporal Procedure Example: Memory Reading Cycle T1 cycle : CPU put cell address on address bus, and the address decoding begins. T2 cycle: CPU send RD signal to control bus, and the CS (chip select) is valid.

Temporal Procedure T3 cycle: RD, address, and CS are all stable, and the data in memory cell is put on data bus. T4 cycle: Data on bus is stable, and CPU read it from the data bus.

Content of this chapter 1. Basic architecture of microcomputer 2. Basic signals and temporal procedure in microcomputer 3. Machine instruction and assembler language

Machine Instruction Machine instruction is a sort of binary code. Its code is corresponding with its function. All instructions supported by a CPU type form the instruction system of this CPU type.

Instruction Reading Cycle Originally, instructions are stored in memory cells. Before an instruction can be executed, it must be loaded in the CPU.

Instruction Reading Cycle The time consumed in reading instruction is called instruction reading cycle. Instruction reading cycle is executed by CPU automatically.

Instruction Executing Cycle When an instruction is loaded in CPU, CPU executed it automatically. The time consumed in instruction execution is called instruction executing cycle.

Instruction Executing Cycle 1) Instruction code is decoded (by instruction decoder) and all relative control signals are generated. 2) Based on the temporal logic provided by this instruction, control signals are send to bus step by step.

Instruction Executing Cycle When current instruction has been executed, and there is no instructions in CPU for execution, CPU automatically enter instruction reading cycle.

Some Problems Now, with the concept of instruction, what does CPU do all the time? Can program control when CPU read its instructions or execute them? So what can program control? Read and execute instructions one by one No, these temporal procedures are executed by CPU automatically. Temporal procedure prescribed by instruction

Atom Property of Instruction (1) Generally, the execution of instruction can not be disturbed. (except DMA request) When interrupt occurs, CPU will finish current instruction execution before it can accept interrupt.

Atom Property of Instruction (2) For temporal procedure in one single instruction, if it is executed, it must be executed integrally. An instruction may be executed integrally or may not be executed. But it can not be executed partly.

Instruction System In different CPU types, instruction decoders are different. So, instruction code, and temporal procedure of instruction are also different in different CPU types.

Assembler Instruction Machine instructions are binary codes, and they are difficult for programmers to remember. Assembler instruction is the character code of machine instruction. Because its clear meaning, assembler instruction is easy to remember.

Assembler Instruction For example: MOV : This instruction move data in one cell (register or memory cell) to the other. ADD : This instruction add data in one cell with the other.

Assembler Language Example: x, y, and z are three variables. If x+y-z>0, store the calculation result in variable var1; or else, store zero in var1. C program: if((var1=x+y-z)<=0) var1 = 0; if((var1=x+y-z)<=0) var1 = 0;

Feature of C program (1) simple, easy to read (2) can not observe the machine operation with this program

Assembler Language Assembler program: mov al, x mov al, x add al, y add al, y sub al, z sub al, z ja l1 ja l1 jmp l2 jmp l2 l1: mov var1, al jmp l3 jmp l3 l2: mov var1, 0 l3: ……

Feature of assembler program (1) complex, difficult to read (2) One instruction in one line, easy to understand the machine operation (3) Because use instructions directly in program, temporal and spatial efficiency is great.

Assembler program vs. C program 程序设计语言可执行程序占用字节数 高级语言 ( C ) CSUM.EXE4330 汇编语言 ( MASM ) ASMSUM.COM21 机器语言 ( IBM PC ) MACHINE.COM21

High-level Language Application oriented Easy to learn Development cycle is short Good portability Less efficient

Low-level Language Machine oriented Hard to learn Development cycle is long Bad portability More efficient

Assembler Language Based on assembler instruction system, assisted by other syntax, assembler language is a low-level and machine oriented language.

Why learn Assembler Language? (1) Because most temporal procedures are caused by instructions, understanding assembler language is basic and necessary to learn machine operation.

Why learn Assembler Language? (2) program analysis without source code (3) obtain most efficient design

Notation System in Assembler Language Decimal: 352 Binary: B Octal: 3765O Hex: 2A4FH

Data Code in Assembler Language Unsigned number: For byte, its range is 0~255 For word, its range is 0~65535 Complementary code (Signed number): For byte, its range is -128~127 For word, its range is ~32767

Complementary Code ( 补码 ) [X] 补 = M+X [X] 补 = M+X M=2 n M=2 n n is the binary data length n is the binary data length

Complementary Code ( 补码 ) The complementary code of positive integer and zero is the data itself. Example: [+59] 补 = = [+59] 补 = = = 1 (舍去) ( 8 位以内的部分为 补码) 1 (舍去) ( 8 位以内的部分为 补码)

Complementary Code ( 补码 ) However, the complementary code of negative integer is very different from the data. Example: [-59] 补 = ( ) = =

Complementary Code ( 补码 ) [A] 补 +[-A] 补 = [0] 补 Example: [+59] 补 +[-59] 补 = = = = 2 8

Fast Calculation of Complementary Code Example: 真值: 相反数: 变反: 加 1 :

Fast Calculation of Complementary Code 验算: = 0 (舍去第 8 位) 验算过程解释: (正数补码) (值变反的结果) +1 = 验算过程解释: (正数补码) (值变反的结果) +1 =

Fast Calculation of Complementary Code 总结变反加 1 方法可用的场合: 1 ) Obtain complementary code of negative data ( 求负数真值对应的补码 ) 2 ) Obtain data of negative complementary code ( 求负数补码对应的真值 ) 3 ) Obtain contrary complementary code ( 求 已知补码的相反数补码 )

Complementary Code ( 补码 ) [X] 补 +[Y] 补 = [X+Y] 补 [X] 补 -[Y] 补 = [X] 补 +[-Y] 补 = [X-Y] 补

Complementary Code ( 补码 ) Subtraction operation is not needed in ALU: Addition : [X] 补 +[Y] 补 Subtraction : [X] 补 -[Y] 补 =[X] 补 +[-Y] 补

Sign Expanding The sign bit of complementary code can be expanded without limit. Example: 0010 => =>

Multiple explanation of data code Example: (AL) = B (BL) = B ADD AL, BL

Multiple explanation of data code Explanation of unsigned number: = 257 Explanation of Complementary Code: 2+(-1) = 1

Reference 8086/8088 系列微型计算机 宏汇编语言程序设计, 电子科技大学出版社, 王正智 苟大举 徐洁 黄海 于 编著 汇编语言程序设计 —— 从 DOS 到 Windows , 清华 大学出版社, 张雪兰 等编著 16 / 32 位微机原理、汇编语言及接口技术, 机械 工业出版社, 钱晓捷、陈涛编著