بنام خدا ريز پردازنده ها Microprocessors Reference Books منابع : v Title: The Z80 Microprocessor, Hardware, Software, programming & interfacing v Author:

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
Memory & IO Interfacing to CPU
MICROPROCESSORS TWO TYPES OF MODELS ARE USED :  PROGRAMMER’S MODEL :- THIS MODEL SHOWS FEATURES, SUCH AS INTERNAL REGISTERS, ADDRESS,DATA & CONTROL BUSES.
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
Department of Computer Engineering
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
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.
Chapter 10 Hardware Details on the 8088 Objectives: The general specification on the 8088 microprocessors The processor’s control signal names and specifications.
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.
8086 & Z80 µP Lec note 2.
GURSHARAN SINGH TATLA PIN DIAGRAM OF 8085 GURSHARAN SINGH TATLA
ريزپردازنده ها Microprocessors Spring 2005.
Microcomputer & Interfacing Lecture 2
Khaled A. Al-Utaibi  8086 Pinout & Pin Functions  Minimum & Maximum Mode Operations  Microcomputer System Design  Minimum Mode.
University of Tehran 1 Microprocessor System Design Omid Fatemi Memory Interfacing
Khaled A. Al-Utaibi  Intel Peripheral Controller Chips  Basic Description of the 8255  Pin Configuration of the 8255  Block Diagram.
Higher Computing Computer Systems S. McCrossan 1 Higher Grade Computing Studies 2. Computer Structure Computer Structure The traditional diagram of a computer...
Introduction to Computing: Lecture 4
created by :Gaurav Shrivastava
Computer Architecture
8086/8088 Hardware Specifications Power supply:  +5V with tolerance of ±10%;  360mA. Input characteristics:  Logic 0 – 0.8V maximum, ±10μA maximum;
Minimum System Requirements Clock Generator Memory Interfacing.
Microprocessor & Interfacing Techniques. HISTORY OF MICROPROCESSORS  Computers are accessible to ever-increasing sectors of the world's population. 
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.
Z80 Overview internal architecture and major elements of the Z80 CPU.
Computer Architecture Lecture 6 by Engineer A. Lecturer Aymen Hasan AlAwady 1/12/2013 University of Kufa - Informatics Center for Research and Rehabilitation.
MICROPROCESSORS AND APPLICATIONS
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.
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.
Capability of processor determine the capability of the computer system. Therefore, processor is the key element or heart of a computer system. Other.
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.
MICROPROCESSOR AMARTYA ROY-72 ANGSHUMAN CHATTERJEE-80 ASHISH LOHIA-70 MOLOY CHAKRABORTY-60.
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.
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.
Memory Interface EEE 365 [FALL 2014] LECTURER 12 ATANU K SAHA BRAC UNIVERSITY.
Unit Microprocessor.
8085 Microprocessor Architecture
Seminar On 8085 microprocessor
EEE /INSTR/CS F241 ES C263 Microprocessor Programming and Interfacing
COURSE OUTCOMES OF Microprocessor and programming
Introduction to the processor and its pin configuration
The 8085 Microprocessor Architecture
Introduction of microprocessor
Dr. Michael Nasief Lecture 2
8085 microprocessor.
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
Architecture of Microprocessor (Intel 8085) Unit-I
Introduction to Microprocessors and Microcontrollers
Number Representations and Basic Processor Architecture
Architecture & Support Components
8085 Microprocessor Architecture
X1 & X2 These are also called Crystal Input Pins.
The 8085 Microprocessor Architecture
8085 Microprocessor Architecture
Computer Operation 6/22/2019.
Presentation transcript:

بنام خدا ريز پردازنده ها Microprocessors

Reference Books منابع : v Title: The Z80 Microprocessor, Hardware, Software, programming & interfacing v Author: Barry B. Brey v Translator: Hossein Nia v Publisher: Astane Ghodse Razavi ( Beh Nashr )

Reference Books منابع : v Z80 Family DATABOOK v Publisher: ZILOG Corp. v Copyright 2004

Introduction مقدمه : v Microprocessor / (uP) / (MPU) u A uP is a CPU on a single chip. u Components of CPU ALU, instruction decoder, registers, bus control circuit, etc. v Micro-computer (u-Computer) u small computer u uP + peripheral I/O + memory specifically for data acquisition and control applications v Microcontroller (uC) u u-Computer on a single chip of silicon

uP vs. uC ريزپردازنده و ريزكنترلر : v A uP u Only is a single-chip CPU u Bus is available u RAM capacity u ROM is smaller than RAM (usually) u number of I/O ports is selectable A uC u Contains a CPU and RAM,ROM,Peripherals, I/O ports in a single IC u Internal hardware is fixed u Communicate by port u ROM is larger than RAM (usually) u Small power consumption u Single chip, small board u Implementation is easy u Low cost

uP vs. uC – cont. ريزپردازنده و ريزكنترلر : v Applications: u uCs are suitable to control of I/O devices in designs requiring a minimum component u uPs are suitable to processing information in computer systems

uP vs. uC – cont. ريزپردازنده و ريزكنترلر : v uC is easy to use and design. u Only single chip can be a complete system u interfacing to other devices, for example, motors, displays, sensors, and communicate with PC. v In contrast, similar system that builds from uP would require a lot of additional units, u such as RAM, UART, I/O, TIMER and etc.

uC is a Reusable Hardware ريزكنترلر قابل برنامه ريزي مجدد است : v Logic circuit provides limited function for one single design. In order to change circuit’s functionality, we need to redesign the circuits. v uC can reprogram and change functionality of every port, input to output or digital to analog on the fly.

uCs v Many uCs are existing right now. u 8051, 68HC11, MSP430, ARM series, and etc. v We may widely divide it with how it is designed u RISC/CISC architecture. v What is the main difference between RISC/CISC? v Does it make any difference to our application?

The Microprocessor (MPU) v The uP is the ‘ brain of the microcomputer ’ v Is a single chip which is capable of u processing data u controlling all of the components which make up the microcomputer system v µP used to sequence executions of instructions that is in memory v uP Fetch, Decode, and Execute the instruction v The internal architecture of the microprocessor is complex.

The Microprocessor (MPU) v microprocessor (MPU) typically contains u Registers: Temporary storage locations for program instruction or data. u The Arithmetic Logic unit (ALU): This part of the MPU performs both arithmetic and logical operations u Timing and Control Circuits: that keep all of the other parts of system (Regs, ALU, memory & I/O) working together in the right time sequence

Microcomputers ريزكامپيوترها : v All Microcomputers consist of (at least) : u 1. Microprocessor Unit (MPU) u 2. Program Memory (ROM) u 3. Data Memory (RAM) u 4. Input / Output ports u 5. Bus System u (and Software) v MPU is the brain of microcomputer

Parts of a Computer CPU control ALU MemoryI/O Instruct. data bus

System Architecture CPU Memory Bus I/O ports I/O devices

Microcomputers ريزكامپيوترها :

The Input/Output (I/O) System ورودي / خروجي : v I/O is the link between the MPU and the outside world. v An input port is a circuit through which an external device can send signals (data?) to the MPU. v An output port is a circuit that allows the MPU to send signals (data?) to external devices. v I/O ports connect both digital and analogue devices by DAC and ADC

Bus گذرگاهها ( مسيرهاي عمومي ): v A Bus is a common communications pathway used to carry information between the various elements of a computer system v The term BUS refers to a group of wires or conduction tracks on a printed circuit board (PCB) though which binary information is transferred from one part of the microcomputer to another v The individual subsystems of the digital computer are connected through an interconnecting BUS system

Bus گذرگاهها ( مسيرهاي عمومي ): v There are three main bus groups u ADDRESS BUS u DATA BUS  CONTROL BUS

Data Bus گذرگاه داده : v The Data Bus carries the data which is transferred throughout the system. ( bi-directional) v Examples of data transfers u Program instructions being read from memory into MPU. u Data being sent from MPU to I/O port u Data being read from I/O port going to MPU u Results from MPU sent to Memory v These are called read and write operations

Address Bus گذرگاه آدرس : v An address is a binary number that identifies a specific memory storage location or I/O port involved in a data transfer v The Address Bus is used to transmit the address of the location to the memory or the I/O port. v The Address Bus is unidirectional ( one way ): addresses are always issued by the MPU.

Control Bus گذرگاه كنترل : v The Control Bus: is another group of signals whose functions are to provide synchronization ( timing control ) between the MPU and the other system components. v Control signals are unidirectional, and are mainly outputs from the MPU. v Example Control signals u RD: read signal asserted to read data into MPU u WR: write signal asserted to write data from MPU

Main memory حافظه اصلي : v The duties of the memory are : u To store programs u To provide data to the MPU on request u To accept result from the MPU for storage v Main memory Types u ROM : read only memory. Contains program (Firmware). does not lose its contents when power is removed (Non-volatile) u RAM : random access memory (read/write memory) used as variable data, loses contents when power is removed volatile. When power up will contain random data values

Read-Only Memory حافظه فقط خواندني : v uP can read instructions from ROM quickly v Cannot write new data to the ROM v ROM remembers the data, even after power cycled v Typically, when the power is turned on, the microprocessor will start fetching instructions from the still-remembered program in ROM (bootstrap )

Available ROMs : ROM انواع v Masked ROM or just ROM v PROM or programmable ROM (once only) v EPROM (erasable via ultraviolet light) v Flash (can be erased and re-written about times, usually must write a whole block not just 1 byte or 2 bytes, slow writing, fast reading)  EEPROM (electrically erasable read-only memory, also known as EEROM—both reading and writing are very slow but can program millions of times…useless for storing a program but good for say configuration information.

.. ROM A0 A1 A2 Am D0 Dn D1 D2 n+1 bit Data Capacity : m+1 bit Address : Output Enable connect to RD of uP : Chip Enable to Address decoder ROM PROM EEPROM

v.v. Timing Diagram for a Typical ROM A0-Am D0-Dn OE falls to data valid Addr. valid to data valid

v.v. 27XX EPROM 16 kbit 2 kbyte 32 kbit 4 kbyte 64 kbit 8 kbyte PGM and VPP are used to programming

27XXX EPROM 128 kbit 16 kbyte 256 kbit 32 kbyte 512 kbit 64 kbyte 1024 kbit 128 kbyte

256 kbit 32 kbyte 64 kbit 8 kbyte 1026 kbit 128 kbyte 4096 kbit 512 kbyte 16 kbit 2 kbyte 28XX E2PROM

RAM (Random Access Memory) حافظه خواندني / نوشتني : v The uP can read the data from RAM quickly, v The uP can write new data quickly to RAM v RAM forgets its data if power is turned off v Two type of is available : u Static RAM(SRAM): ff base, fast, expensive, low cap / vol, applied for cache, no refresh. u Dynamic RAM (DRAM): cap base, slow, low cost high capacity/volume, applied for main memory(pc) need refresh.

RAM(Static) A0 A1 A2 Am D0 Dn D1 D2 n+1 bit Data Capacity : m+1 bit Address : Chip Select to Address decoder RAM : Read signal connect to MemRD of uP : Write signal connect to MemWR of uP Data bus is Bidirectional

Session 2 v Microprocessors v History v Data width v 8086 vs 8088 v 8086 pin description v Z80 Pin description

Microprocessors v Microprocessors come in all kinds of varieties from the very simple to the very complex v Depend on data bus and register and ALU width uP could be 4-bit, 8-bit, 16-bit, 32-bit, 64-bit v We will discuss two sample of it u Z80 as an 8-bit uP u and 8086/88 as an 16-bit uP v All uPs have u the address bus u the data bus u RD, WR, CLK, RST, INT,...

History تاريخچه : Company4 bit8 bit16 bit32 bit64 bit Intel / Pentium ZilogZ80 Z8000 Z8001 Z8002 Motorola

Internal and External Bus v Internal bus is a pathway for data transfer between registers and ALU in the uPs v External bus is available externally to connect to RAM, ROM and I/O v Int. and Ext. Bus width may be different v For example u In 8088 Int. Bus is 16-bit, Ext. bus is 8-bit u In 8086 Int. Bus is 16-bit, Ext. bus is 16-bit

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

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 uP to wait state CLK (input) : Provides basic timing for the processor RESET (input, Active High) : At least 4 clock cycles Causes the uP immediately terminate its present activity. TEST’ (input, Active Low) : Connect this to HIGH HOLD (input, Active High) : Connect this to LOW HLDA (output, Active High) : Hold Ack 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 (to ) DT/R’ (output) : Data Transmit/Receive. When High, data from uP to memory When Low, data is from memory to uP (to74245 dir) IO/M’ (output) : If High uP access I/O Device. If Low uP access memory RD’ (output) : When Low, uP is performing a read operation WR’ (output) : When Low, uP is performing a write operation ALE (output) : Address Latch Enable, Active High Provided by uP to latch address When HIGH, uP is using AD0..AD7, A19/S6, A18/S5, A17/S4, A16/S3 as address lines

Z80 CPU Pin Assignment : Z80 پايه هاي

Z80 Pin Description A15-A0 : 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 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).  Interrupt Request is generated by I/O devices.  Checked at the end of the current instruction  If flip-flop (IFF) is enabled.  NMI  Non- Maskable Interrupt  (Input, negative edge-triggered).  Higher priority than INT.  Recognized at the end of the current Instruction  Independent of the status of IFF  Forces the CPU to restart at location 0066H.

Z80 Pin Description  BUSREQ  Bus Request (input, active Low).  higher priority than NMI  recognized at the end of the 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 MREQ, IORQ, RD, and WR have entered their high-impedance states.

Z80 Pin Description RESET Reset (input, active Low). RESET initializes the CPU as follows: Resets the IFF Clears the PC and registers I and R Sets the interrupt status to Mode 0. During reset time, the address and data bus go to a high-impedance state And all control output signals go to the inactive state. must be active for a minimum of three full clock cycles before the reset operation is complete.

بلوك دياگرام Z80 Z80 CPU

Z80 Programming Model

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

Register Set(cont) v 4 16-bit registers hold memory address (pointers) u index registers (IX) and (IY) are 16-bit memory pointers u 16 bit stack pointer (SP) u Program counter (PC) v Program counter (PC) u PC points to the next opcode to be fetched from ROM u 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 v Special purpose registers u I : Interrupt vector register. u R : memory Refresh register

Flag Register ثبات پرچم ها : SSign Flag (1:negativ)* ZZero Flag (1:Zero) HHalf Carry Flag (1: Carry from Bit 3 to Bit 4)** PParity Flag (1: Even) VOverflow Flag (1:Overflow)* NOperation Flag (1:previous Operation wassubtraction)** CCarry 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 before DAAafter DAA OpNCBits 4-7HBits 0-3A=A+..C ADD ADC A-F A-F F0A-F661 00A-F A-F SUB SBC NEG FFA0 117-F00-9A F1 9A1 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:

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

Basic CPU Timing Example

Opcode Fetch Bus Timings (M1 Cycle)

The R register v Is increased at every first machine cycle (M1). v 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 v Bit 7 can be changed using the LD R,A instruction. v LD A,R and LD R,A access the R register after it is increased v 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 v Takes 4T to 6Ts v Z80 includes built in circuitry for refreshing DRAM v This simplifies the external interfacing hardware v DRAM consists of MOS transistors, which store Information as capacitive charges; each cell needs to be periodically refreshed v 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 v the Z80 samples the wait signal during T2 if low then Z80 adds wait v states to extend the machine cycle v used to interface memories with slow response time v Slow memory is low cost

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

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

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

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

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

Minimal Configuration of a Z80 Microcomputer

Z80 Memory Connection v CPU 16 bit address bus  64 k memory (max) v CPU 8 bit data bus  8 bit data width v Generally should be connected u Data to Data u Address to Address u WR to WR u RD to RD u MREQ to CS

Memory connection (cont.) RAM 64 kb Z80 CPU D7~D0 A15~A0  If only one RAM chip Full size (64 kb capacity)

Memory connection (cont.) RAM 32 kb Z80 CPU D7~D0 A14~A0 A15  If RAM capacity was 32 kb  A15 composed with MREQ  RAM area is from 0000h to 7FFFh

Memory connection (cont.) v There is two 32 kb RAM v Problem: Bus Conflict. The two memory chips will provide data at the same time when microprocessor performs a memory read. v Solution: Use address line A15 as an “arbiter”. If A15 outputs a logic “1” the upper memory is enabled (and the lower memory is disabled) and vice-versa.

Memory connection (cont.) RAM 32 kb Z80 CPU D7~D0 A14~A0 RAM 32 kb D7~D0 A14~A0 A15  There is two 32 kb RAM  A15 applied to select one RAM chip  Two RAM area is from 0000h to 7FFFh (RAM1) and 8000h to FFFFh (RAM1)

Memory connection (cont.) ROM 32 kb Z80 CPU D7~D0 A14~A0 RAM 32 kb D7~D0 A14~A0 A15  32 kb ROM and 32 kb RAM  ROM doesn’t have wr signal

Memory connection (cont.) Z80 CPU There is 4 memory chip A14 and A15 applied to chip selection

Address Bit Map A15 to A0 (HEX) AA AAAA AAAA 7654 AAAA 3210 Memory Chip 0000h 3FFFh ROM 4000h 7FFFh RAM h BFFFh RAM 2 C000h FFFFh RAM 3 Selects chip Selects location within chips

Memory Map v Represents the memory type v Address area of each memory chip v Empty area 0000h 3FFFh ROM 16k 4000h 7FFFh RAM 1 16k 8000h BFFFh RAM 2 16k C000h FFFFh RAM 3 16k

Memory Map v Empty Area cann’t write and read v Read op. returns FFh value ( usualy ) v Write op. cann’t store any value on it 0000h 3FFFh ROM 4000h 7FFFh Empty 8000h BFFFh RAM 2 C000h FFFFh RAM 3 ROM 16 kb D7~D0 A13~A0 A15 RAM 16 kb D7~D0 A13~A0 RAM 16 kb D7~D0 A13~A0 A14 En S0 S1

Memory Map v Empty Area cann’t write and read v Read op. returns FFh value (usualy) v Write op. cann’t store any value on it 0000h 3FFFh ROM 4000h 7FFFh Empty 8000h BFFFh RAM C000h FFFFh Empty ROM 16 kb D7~D0 A13~A0 A15 RAM 16 kb D7~D0 A13~A0 A14 En S0 S1

Full and Partial Decoding v Full (exhaust) Decoding u All of the address lines are connected to any memory/device to perform selection u Absolute address : any memory location has one address v Partial Decoding u When some of the address lines are connected the memory/device to perform selection u Using this type of decoding results into roll- over addresses (fold back or shading). u roll-over address : any memory location has more than one address

Partial Decoding v A15~A12 has no connection v Then doesn’t play any role in addressing v What is the Memory and Address Bit map? RAM 4 kb Z80 CPU D7~D0 A11~A0 X A15~A12

Partial Decoding A15 to A0 (HEX) AAAA AAAA AAAA 7654 AAAA 3210 Memory Chip X000h XFFFh xxxx RAM 4 kb Z80 CPU D7~D0 A11~A0 X A15~A h 0FFFh RAM 1000h 1FFFh RAM’ 2000h 2FFFh RAM’ 3000h 3FFFh RAM’ F000h FFFFh RAM’  Every memory location has more than one address  For example first RAM location has addresses:  0000h  1000h  2000h  3000h …………….  F000h Roll-over Address

Partial Decoding v A12 only connected to RAM v A13 has no connection v What is the memory map? ROM 4 kb Z80 CPU D7~D0 A11~A0 A12~A0 RAM 8 kb D7~D0 A12~A0 A14 A15 X A13

Partial Decoding v 8 roll-over address for ROM v 4 roll-over address for RAM AAAA AAAA AAAA 7654 AAAA 3210 Memory Chip 0xxx ROM X0x0 X0x RAM ROM 4 kb Z80 CPU D7~D0 A11~A0 A12~A0 RAM 8 kb D7~D0 A12~A0 A14 A15 X A13

Partial Decoding AAAA AAAA AAAA 7654 AAAA 3210 Memory Chip 0xxx k ROM X0x0 X0x k RAM 0000h 1FFFh RAM’ 0000h 0FFFh ROM 1000h 1FFFh ROM’ 2000h 3FFFh RAM’ 2000h 2FFFh ROM’ 3000h 3FFFh ROM’ 4000h 5FFFh 4000h 4FFFh ROM’ 5000h 5FFFh ROM’ 6000h 7FFFh 6000h 6FFFh ROM’ 7000h 7FFFh ROM’ 8000h 9FFFh RAM F000h FFFFh A000h BFFFh RAM’ C000h DFFFh E000h FFFFh ROM 4 kb Z80 CPU D7~D0 A11~A0 A12~A0 RAM 8 kb D7~D0 A12~A0 A14 A15 X A13 Conflict

Partial Decoding AAAA AAAA AAAA 7654 AAAA 3210 Memory Chip 0xxx k ROM X1x0 X1x k RAM 0000h 1FFFh 0000h 0FFFh ROM 1000h 1FFFh ROM’ 2000h 3FFFh 2000h 2FFFh ROM’ 3000h 3FFFh ROM’ 4000h 5FFFh RAM’ 4000h 4FFFh ROM’ 5000h 5FFFh ROM’ 6000h 7FFFh RAM’ 6000h 6FFFh ROM’ 7000h 7FFFh ROM’ 8000h 9FFFh F000h FFFFh A000h BFFFh C000h DFFFh RAM E000h FFFFh RAM’ ROM 4 kb Z80 CPU D7~D0 A11~A0 A12~A0 RAM 8 kb D7~D0 A12~A0 A14 A15 X A13 Conflict

Full (exhaustive) decoding Y0 Y1 Y2 Y3 Y6 Y4 Y7 Y5 C B A G2A G2B G EPROM 8k  8 D7~D0 A12~A RWM 2k  8 D7~D0 A10~A0 D7~D0 A12~A0 A10~A0 A13 A12 A11 A15 A h-07FFh 0800h-0FFFh 1000h-17FFh 1800h-1FFFh 2000h-27FFh AAAA AAAA AAAA 7654 AAAA 3210 Memory Chip ROM RAM

Partial decoding Y0 Y1 Y2 Y3 Y6 Y4 Y7 Y5 C B A G2A G2B G EPROM 8k  8 D7~D0 A12~A RWM 2k  8 D7~D0 A10~A0 D7~D0 A12~A0 A10~A0 A15 A14 A h-1FFFh 2000h-3FFFh AAAA AAAA AAAA 7654 AAAA 3210 Memory Chip ROM 001x x000 x RAM GND VCC

1 Bit Memory With Separated I/O 2147 RWM 4k  1 D out A11~A0 D in 2147 RWM 4k  1 D out A11~A0 D in 2147 RWM 4k  1 D out A11~A0 D in D0 D1D7 D7-D0 A11-A0

What is the memory (addr. bit) map D RWM 4k  1 D out A11~A0 D in 2147 RWM 4k  1 D out A11~A0 D in 2147 RWM 4k  1 D out A11~A0 D in D1 D7 D7-D0 A11-A EPROM 8k  8 D7~D0 A12~A Y0 Y1 Y2 Y3 Y6 Y4 Y7 Y5 C B A G2A G2B G1 0000h-1FFFh 2000h-3FFFh A15 A14 A13 GND VCC

Adding RAM & ROM

Minimum Z80 Computer System

Z80-µP-Family (Typical Environment)

Z80 Input Output  Z80 at most could have 256 input port and 256 output  8 bit port address is placed on A7–A0 pin to select the I/O device  OUT (n), A  n is 8 bit port address  Content of A is data  OUT (C), r  Content of C is a port address  r is a data register  IN A, (n)  n is 8 bit port address  Data is transferred to A  IN r (C)  Content of Reg C is a port address  Input data is transferred to r (data reg)

Remember IO read/write cycle

Z80 and simple output port OUT (03), A

Z80 and simple input port Z80 CPU A14 A0 : D7 D6 RD IORQ A15 D5 D4 D3 D2 D1 D0 A 7 A 6 A 5 A 4 A 3 A 2 A 1 A 0 IORD 74LS244 A0 A1 A2 A3 A4 A5 A6 A7 Y0 Y1 Y2 Y3 Y4 Y5 Y6 Y7 G1G2 5V IN A, (02)

8088 and simple output port A Minimum Mode A18 A0 : D7 D6 IOR IOW A19 D5 D4 D3 D2 D1 D0 A 1 4 A 1 3 A 1 2 A 1 1 A 1 0 A 9 A 8 A 7 A 6 A 5 A 4 A 3 A 2 A 1 A 0 IOW 74LS373 Q0 Q1 Q2 Q3 Q4 Q5 Q6 Q7 D0 D1 D2 D3 D4 D5 D6 D7 OELE

8088 and simple input port A Minimum Mode A18 A0 : D7 D6 IOR IOW A19 D5 D4 D3 D2 D1 D0 A 1 4 A 1 3 A 1 2 A 1 1 A 1 0 A 9 A 8 A 7 A 6 A 5 A 4 A 3 A 2 A 1 A 0 IOW What is this? 74LS244 A0 A1 A2 A3 A4 A5 A6 A7 Y0 Y1 Y2 Y3 Y4 Y5 Y6 Y7 G1G2 5V

Simplified Drawing of 8088 Minimum Mode D7 - D0Q7 - Q0 OE LE 74LS373 D7 - D0Q7 - Q0 OE LE 74LS AD7 - AD0 A15 - A8 A19/S6 - A16/ S3 DEN DT / R IO / M RD WR ALE D7 - D4Q7 - Q4 OE LE 74LS373 D3 - D0Q3 - Q0 GND A7 - A0B7 - B0 E DIR 74LS245 MEMR MEMW IOR IOW A7-A0 A15-A8 A19-A16 D7-D0

Minimum Mode 2 20 bytes or 1MB memory 1 MB Memory D7 - D0 A19 - A0 RD WR Simplified Drawing of 8088 Minimum Mode D7 - D0 A19 - A0 MEMR MEMW CS

What are the memory locations of a 1MB (2 20 bytes) Memory? A19 to A0 (HEX) AAAA AAAA AAAA AAAA 7654 AAAA FFFFF1111 Example: 34FD

Minimum Mode 512 kB memory 512 kB Memory D7 - D0 A18 - A0 RD WR Simplified Drawing of 8088 Minimum Mode D7 - D0 A18 - A0 MEMR MEMW CS A19 What do we do with A19? 1)Don’t connect it 2)Connect to cs What is the difference?

512 kB Memory Map v Don’t connect it u A19 is not connected to the memory so even if the 8088 microprocessor outputs a logic “1”,the memory cannot “see” it. u A19=0 is the same as A19=1 for Memory v Connect to cs u If A19=0 Memory chip act normal function 00000h 7FFFFh 512k Mem 80000h FFFFFh 512k Mem’ 00000h 7FFFFh 512k Mem 80000h FFFFFh Empty

2  512 kB memory 512 kB RAM1 D7 - D0 A18 - A0 RD WR Simplified Drawing of 8088 Minimum Mode D7 - D0 A18 - A0 MEMR MEMW CS A19 MEMR MEMW 512 kB RAM2 D7 - D0 A18 - A0 RD WR MEMR MEMW CS

2  512 kB memory AAAA AAAA AAAA AAAA 7654 AAAA 3210 Memory Chip ROM RAM 00000h 7FFFFh 512k RAM h FFFFFh 512k RAM2 What are the memory locations of two consecutive 512KB (2 19 bytes) Memory?

Interfacing four 256K Memory Chips to the 8088 Microprocessor 8088 Minimum Mode A17 A0 : D7 D0 : MEMR MEMW A18 256KB #3 A17 A0 : D7 D0 : RD WR CS A19 256KB #2 A17 A0 : D7 D0 : RD WR CS 256KB #1 A17 A0 : D7 D0 : RD WR CS 256KB #4 A17 A0 : D7 D0 : RD WR CS

Interfacing four 256K Memory Chips to the 8088 Microprocessor

Memory chip#__ is mapped to: AAAA AAAA AAAA AAAA 7654 AAAA 3210 Memory Chip RAM#1 RAM#2 RAM#3 RAM#4

Interfacing several 8K Memory Chips to the 8088  P

Interfacing 128 8K Memory Chips to the 8088  P

8088 Minimum Mode A12 A0 : D7 D0 : MEMR MEMW A13 A14 8KB #2 A12 A0 : D7 D0 : RD WR CS 8KB #1 A12 A0 : D7 D0 : RD WR CS 8KB #128 A12 A0 : D7 D0 : RD WR CS A15 A16 A17 A18 A19 : :

Memory chip#__ is mapped to: AAAA AAAA AAAA AAAA 7654 AAAA 3210 Memory Chip RAM#1 RAM#2 RAM#126 RAM#127 RAM#128

What is the Memory and Address Bit map? Y0 Y1 Y2 Y3 Y6 Y4 Y7 Y5 C B A G2A G2B G1G EPROM 8k  8 D7~D0 A12~A RWM 2k  8 D7~D0 A10~A0 D7~D0 A12~A0 A10~A0 A14 A13 A12 A VCC INPUT