1.01k likes | 1.4k Views
Microcomputer Principle and Interface Technology - Introduction. 计算机学院 李征 Tel : 13882153765 Email : lizheng@cs.scu.edu.cn OICQ: 1340915. Course Content. Architecture and Mechanism of 8088/8086 CPU 8088/8086 Instruction System and Programming with Assembler Language
E N D
Microcomputer Principle and Interface Technology - Introduction 计算机学院 李征 Tel:13882153765 Email:lizheng@cs.scu.edu.cn OICQ: 1340915
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 • Bus • Memory • I/O Interface • I/O Device • Five essential parts are necessary for all computers.
General Architecture of Computer CPU Memory Bus(Data, Address, Control) I/O Interface I/O Interface I/O Interface I/O Device I/O Device 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 维持 置1 清0 非法 SD RD Qn Qn+1 Q Q 1 1 0 1 1 0 1 1 0 0 1 1 0 0 1 1 1 1 0 0 0 0 0 1 0 1 0 1 0 1 0 1 1 1 0 0 1* 1* 1 1 0 1 1 0 SD RD 0 1
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 4 80386 Pentium 8088CPU
(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 PCIBus ISABus
(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 System Bus Address Bus ( AB) Bus Generator Data Bus (DB) Control Bus (CB) CPU Subsystem Memory I/O Interface I/O Device Microcomputer Architecture
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.
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.
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.
time T Clock
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 Address Decoder Output:<=2n Input: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.