8086 & Z80 µP Lec note 2.

Slides:



Advertisements
Similar presentations
8086 [2] Ahad. Internal! External? 8086 vs _bit Data Bus 20_bit Address 8_bit Data Bus 20_bit Address Only external bus of 8088 is.
Advertisements

Parul Polytechnic Institute
Dr. Rabie A. Ramadan Al-Azhar University Lecture 3
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 8085 Microprocessor Architecture
Microprocessor and Microcontroller
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
BLOCK DIAGRAM OF INTEL 8085 GURSHARAN SINGH TATLA
4-1 ECE 424 Design of Microprocessor-Based Systems Haibo Wang ECE Department Southern Illinois University Carbondale, IL Hardware Detail of Intel.
1 TK2633TK Microprocessor Architecture DR MASRI AYOB.
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.
Gursharan Singh Tatla Block Diagram of Intel 8086 Gursharan Singh Tatla 19-Apr-17.
Unit-1 PREPARED BY: PROF. HARISH I RATHOD COMPUTER ENGINEERING DEPARTMENT GUJARAT POWER ENGINEERING & RESEARCH INSTITUTE Advance Processor.
GURSHARAN SINGH TATLA PIN DIAGRAM OF 8085 GURSHARAN SINGH TATLA
ريزپردازنده ها Microprocessors Spring 2005.
Khaled A. Al-Utaibi  8086 Pinout & Pin Functions  Minimum & Maximum Mode Operations  Microcomputer System Design  Minimum Mode.
created by :Gaurav Shrivastava
8086/8088 Hardware Specifications Power supply:  +5V with tolerance of ±10%;  360mA. Input characteristics:  Logic 0 – 0.8V maximum, ±10μA maximum;
Microprocessor Dr. Rabie A. Ramadan Al-Azhar University Lecture 7.
MODES OF Details of Pins Pin 1GND –Connected Ground Pins 2-16 AD14-AD0–acts as both input/output. Outputs address at the first part of the cycle.
Microprocessor. Interrupts The processor has 5 interrupts. CALL instruction (3 byte instruction). The processor calls the subroutine, address of which.
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.
MICROPROCESSORS & ORGANIZATION OF 8085
Z80 Overview internal architecture and major elements of the Z80 CPU.
80386DX. Features of 80386DX It supports 8/16/32 bit data operands It has 32-bit internal registers It supports 32-bit data bus and 32-bit non-multiplexed.
80386DX functional Block Diagram PIN Description Register set Flags Physical address space Data types.
Computer Architecture Lecture 6 by Engineer A. Lecturer Aymen Hasan AlAwady 1/12/2013 University of Kufa - Informatics Center for Research and Rehabilitation.
EFLAG Register of The The only new flag bit is the AC alignment check, used to indicate that the microprocessor has accessed a word at an odd.
Computer and Information Sciences College / Computer Science Department CS 206 D Computer Organization and Assembly Language.
Introduction to Microprocessors - chapter3 1 Chapter 3 The 8085 Microprocessor Architecture.
Computer Architecture Lecture 4 by Engineer A. Lecturer Aymen Hasan AlAwady 17/11/2013 University of Kufa - Informatics Center for Research and Rehabilitation.
MACHINE CYCLE AND T-STATE
MICROPROCESSOR DETAILS 1 Updated April 2011 ©Paul R. Godin prgodin gmail.com.
The 8085 Microprocessor Architecture. What 8085 meant for? 80 - year of invention bit processor 5 - uses +5V for power.
1 Basic Processor Architecture. 2 Building Blocks of Processor Systems CPU.
8085 Microprocessor: Architecture & Support Components.
8085 INTERNAL ARCHITECTURE.  Upon completing this topic, you should be able to: State all the register available in the 8085 microprocessor and explain.
Multiplex of Data and Address Lines in 8088 Address lines A0-A7 and Data lines D0-D7 are multiplexed in These lines are labelled as AD0-AD7. –By.
Gandhinagar Institute of Technology
8 085Microprocessor Temp Reg (8) Accumulator (A reg) Flag flip flops(8) Instruction Register (8) Arithmetic Logic Unit ALU Instruction Decoder and Machine.
Architecture of 8085 Nitin Mishra. Registers Microprocessor Instruction Cache Arithmetic & Logic Unit Control Unit Bus Interface Unit Data Cache Instruction.
The 8085A is a general-purpose microprocessor with low hardware overhead requirements. Within the 8085A are contained the functions of clock generation,
Unit Microprocessor.
8085 Microprocessor Architecture
Seminar On 8085 microprocessor
COURSE OUTCOMES OF Microprocessor and programming
BLOCK DIAGRAM OF INTEL 8085.
8085 INTRODUCTION The features of INTEL 8085 are :
Everybody.
The 8085 Microprocessor Architecture
Introduction to the processor and its pin configuration
The 8085 Microprocessor Architecture
Introduction of microprocessor
Dr. Michael Nasief Lecture 2
Basic Microprocessor Architecture
8086/8088 Hardware Specifications
8085 microprocessor.
8085 Microprocessor Architecture
The 8085 Microprocessor Architecture
An Introduction to Microprocessor Architecture using intel 8085 as a classic processor
ROM ROM Capacity : PROM EEPROM : Output Enable connect to RD of uP
8085 Microprocessor Architecture
X1 & X2 These are also called Crystal Input Pins.
Md. Mojahidul Islam Lecturer Dept. of Computer Science & Engineering
Md. Mojahidul Islam Lecturer Dept. of Computer Science & Engineering
The 8085 Microprocessor Architecture
8085 Microprocessor Architecture
Computer Operation 6/22/2019.
8086 microprocessior PIN OUT DIAGRAM OF  Power supply and frequency signals  It uses 5V DC supply at V CC pin 40, and uses ground at V SS pin.
Presentation transcript:

8086 & Z80 µP Lec note 2

Outline Microprocessors History Data width 8086 vs 8088 8086 pin description Z80 Pin description

Microprocessors Microprocessors come in all kinds of varieties from the very simple to the very complex Depend on data bus and register and ALU width µP could be 4-bit , 8-bit , 16-bit, 32-bit , 64-bit We will discuss two sample of it Z80 as an 8-bit µP and 8086/88 as an 16-bit µP All µPs have Address bus Data bus Control Signals: RD, WR, CLK , RST, INT, . . .

History 4 bit 8 bit 16 bit 32 bit 64 bit Company intel 4004 4040 8008 Bus width Company 4 bit 8 bit 16 bit 32 bit 64 bit intel 4004 4040 8008 8080 8085 8088/6 80186 80286 80386 80486 80860 pentium zilog Z80 Z8000 Z8001 Z8002 Motorola 6800 6802 6809 68006 68008 68010 68020 68030 68040

Internal and External Bus Internal bus is a pathway for data transfer between registers and ALU in the µPs External bus is available externally to connect to RAM, ROM and I/O Int. and Ext. Bus width may be different For example In 8088 Int. Bus is 16-bit , Ext. bus is 8-bit In 8086 Int. Bus is 16-bit , Ext. bus is 16-bit Data Width is the width of the ALU. An 8-bit ALU can add/subtract/multiply/etc. two 8-bit numbers, while a 32-bit ALU can manipulate 32-bit numbers. An 8-bit ALU would have to execute four instructions to add two 32-bit numbers, while a 32-bit ALU can do it in one instruction. In many cases, the external data bus is the same width as the ALU, but not always. The 8088 had a 16-bit ALU and an 8-bit bus, while the modern Pentiums fetch data 64 bits at a time for their 32-bit ALUs.

8086 vs 8088 Only external bus of 8088 is 8_bit 8088 8086 8_bit Data Bus 20_bit Address 16_bit Data Bus 20_bit Address 8086 8088

8086 Pin Assignment

8086 Pin Description Vcc (pin 40) : Power Gnd (pin 1 and 20) : Ground AD0..AD7 , A8..A15 , A19/S6, A18/S5, A17/S4, A16/S3 : 20 -bit Address Bus MN/MX’ (input) : Indicates Operating mode READY (input , Active High) : take µP to wait state CLK (input) : Provides basic timing for the processor RESET (input, Active High) : At least 4 clock cycles Causes the µP immediately terminate its present activity. TEST’ (input , Active Low) : Connect this to HIGH HOLD (input , Active High) : Connect this to LOW (BR) HLDA (output , Active High) : Hold Ack (BG) INTR (input , Active High) : Interrupt request INTA’ (output , Active Low) : Interrupt Acknowledge NMI (input , Active High) : Non-maskable interrupt

8086 Pin Description DEN’ (output) : Data Enable. It is LOW when processor wants to receive data or processor is giving out data (to74245) DT/R’ (output) : Data Transmit/Receive. When High, data from µP to memory When Low, data is from memory to µP (to74245 dir) IO/M’ (output) : If High µP access I/O Device. If Low µP access memory RD’ (output) : When Low, µP is performing a read operation WR’ (output) : When Low, µP is performing a write operation ALE (output) : Address Latch Enable , Active High Provided by µP to latch address When HIGH, µP is using AD0..AD7, A19/S6, A18/S5, A17/S4, A16/S3 as address lines

Z80 CPU Pin Assignment

Z80 Pin Description A15-A0 : D7-D0 : RD: WR: Address bus (output, active high, 3-state). Used for accessing the memory and I/O ports During the refresh cycle the I is put on this bus. D7-D0 : Data Bus (input/output, active high, 3-state). Used for data exchanges with memory, I/O and interrupts. RD: Read (output, active Low, 3-state) indicates that the CPU wants to read data from memory or I/O WR: Write (output, active Low, 3-state) indicates that the CPU data bus holds valid data to be stored at the addressed memory or I/O location.

Z80 Pin Description MREQ IORQ M1 RFSH Memory Request (output, active Low, 3-state). Indicates memory read/write operation. See M1 IORQ Input/Output Request(output,active Low,3-state) Indicates I/O read/write operation. See M1 M1 Machine Cycle One (output, active Low). Together with MREQ indicates opcode fetch cycle Together with IORQ indicates an Int Ack cycle RFSH Refresh (output, active Low). Together with MREQ indicates refresh cycle. Lower 7-bits address is refresh address to DRAM

Z80 Pin Description INT’ Interrupt Request (input, active Low). generated by I/O devices. Checked at the end of current instruction If flip-flop (IFF) is enabled. NMI’ Non-Maskable Interrupt (Input, negative edge-triggered). Checked at the end of current Instruction Higher priority than INT. Independent from IFF Status Forces CPU restart at 0066H.

Z80 Pin Description BUSREQ’ Bus Request (input, active Low). higher priority than NMI recognized at the end of current machine cycle forces the CPU address bus, data bus, and MREQ, IORQ, RD, and WR to high-imp. BUSACK’ Bus Acknowledge (output, active Low) indicates to the requesting device that address, data, and control signals have entered their high-impedance states.

Z80 Pin Description RESET’ Reset (input, active Low). Must be active for three clock cycles Initializes the CPU as follows: Resets the IFF Clears the PC and I and R Sets the interrupt to Mode 0 During reset time: address and data go high-impedance all control (out) signals go inactive state

Z80 CPU

Z80 Programming Model

Register Set A : Accumulator Register F : Flag register Two sets of six general-purpose registers may be used as 8-bit A F B C D E H L (A’ F’ B’ C’ D’ E’ H’ L’) or in pairs as 16-bit AF BC DE HL (AF’ BC’ DE’ HL’) The Alternative registers (A’ F’ B’ C’ D’ E’ H’ L’) not visible to the programmer but can access via: EXX (BC)<->(BC') , (DE)<->(DE') , (HL)<->(HL') EX AF, AF ’ (AF)<->(AF') what is this instruction useful for?

Register Set(cont) 4 (16-bit) registers hold memory address (pointers) index registers (IX) and (IY) are 16-bit memory pointers 16 bit stack pointer (SP) Program counter (PC) PC points to the next opcode to be fetched from ROM when the µP places an address on the address bus to fetch the byte from memory, it then increments the program counter by one to the next location Special purpose registers I : Interrupt vector register. R : memory Refresh register

Flag Register S Sign Flag (1:negativ)* Z Zero Flag (1:Zero) H Half Carry Flag (1: Carry from Bit 3 to Bit 4)** P Parity Flag (1: Even) V Overflow Flag (1:Overflow)* N Operation Flag (1:previous Operation was subtraction)** C Carry Flag (1: Carry from Bit n-1 to Bit n, with n length of operand) *: 2-complement number representation **: used in DAA-operation for BCD-arithmetic

DAA - Decimal Adjust Accumulator Adjusts the content of the Accumulator A for BCD addition and subtraction operations such as ADD, ADC, SUB, SBC, and NEG according to the table: before DAA after DAA Op N C Bits 4-7 H Bits 0-3 A=A+.. ADD ADC 0-9 00 0-8 A-F 06 1 0-3 60 9-F 66 0-2 SUB SBC NEG 6-F FA 7-F A0 9A

Instruction cycles, machine cycles and “T-states” Instruction cycle is the time taken to complete the execution of an instruction Machine cycle is defined as the time required to complete one operation of accessing memory, accessing IO, etc. T-state = 1/f (f:Z80 Clock Frequency) f= 4MHZ  T-state=0.25 uS

Basic CPU Timing Example

Opcode Fetch Bus Timings (M1 Cycle)

The R register Is increased at every first machine cycle (M1). Bit 7 of it is never changed by this; only the lower 7 bits are included in the addition. So bit 7 stays the same Bit 7 can be changed using the LD R,A instruction. LD A,R a nd LD R,A access the R register after it is increased R is often used in programs for a random value, which is good but of course not truly random. the block instructions decrease the PC with two, so the instructions are re-executed.

Memory read/write cycle

Adding One Wait State to an M1 Cycle

Adding One Wait State to Any Memory Cycle

IO read/write cycle During I/O operations a single wait state is automatically inserted

Bus Request/Acknowledge Cycle

Interrupt Request/Acknowledge Cycle Two wait states are automatically added to this cycle

Non-Maskable Interrupt Request Operation

M1 Refresh Cycle Takes 4T to 6Ts Z80 includes built in circuitry for refreshing DRAM This simplifies the external interfacing hardware DRAM consists of MOS transistors, which store Information as capacitive charges; each cell needs to be periodically refreshed During T3 and T4 (when Z80 is performing internal ops), the low order address is used to supply a 7-bit address for refresh

Wait Signal the Z80 samples the wait signal during T2 if low then Z80 adds wait states to extend the machine cycle used to interface memories with slow response time Slow memory is low cost

Interrupts There are two types of interrupts: non mask-able (NMI) Could not be masked Jump to 0066H of memory mask-able(INT) Has 3 mode Can be set with the IM x Instruction IM 0 sets Interrupt mode 0 IM 1 sets Interrupt mode 1 IM 2 sets Interrupt mode 2

Interrupt Modes Mode 0: Mode 1: Mode 2: An 8 bit opcode is Fetched from Data BUS and executed The source interrupt device must put 8 bit opcode at data bus 8 bit opcode usually is RST p instructions Mode 1: A jump is made to address 0038h No value is required at data bus Mode 2: A jump is made to address (register I × 256 + value from interrupting device that puts at bus) I is high 8 bit of interrupt vector Value is low 8 bit of interrupt vector

Z80 CPU Instruction Description 158 different instruction types Including all 78 of the 8080A CPU. Instruction groups Load and Exchange Block Transfer and Search Arithmetic and Logical Rotate and Shift Bit Manipulation (Set, Reset, Test) Jump, Call, and Return Input/Output Basic CPU Control

Addressing Modes Immediate Immediate Extended Modified Page Zero Addressing (rst p) Relative Addressing Jump Relative (2 byte) One Byte Op Code 8-Bit Two’s Complement Displacement (A+2) Extended Addressing Absolute jump One byte opcode 2 byte address Indexed Addressing (Index Register + Displacement) (IX+d) 2 byte opcode 1 byte displacement

Addressing Modes(cont.) Register Addressing LD C,B Implied Addressing Op Code implies other operand(s) ADD E Register Indirect Addressing 16-bit CPU register pair as pointer (such as HL) ADD (HL) Bit Addressing set, reset, and test instructions. SET 3,A RES 7,B