A Design Example An Exact Calculator. Exact Calculator Manipulating Large Integer Values Operations: – +, -, *, /, %, And, Or, Xor, Not, Power Functions.

Slides:



Advertisements
Similar presentations
Chapter 2 (cont.) An Introduction to the 80x86 Microprocessor Family Objectives: The different addressing modes and instruction types available The usefulness.
Advertisements

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.
8088/86 Microprocessors and Supporting Chips
DOS and BIOS Interrupts DOS and BIOS interrupts are used to perform some very useful functions, such as displaying data to the monitor, reading data from.
S04: MSP430 Microarchitecture
ECE 2211 Microprocessor and Interfacing Chapter 8 The 8088/8086 Microprocessors and their memory and I/O interfaces Br. Athaur Rahman Bin Najeeb Room.
Khaled A. Al-Utaibi 8086 Bus Design Khaled A. Al-Utaibi
Interrupt Controller Introduction to 8259.
MICROPROCESSORS TWO TYPES OF MODELS ARE USED :  PROGRAMMER’S MODEL :- THIS MODEL SHOWS FEATURES, SUCH AS INTERNAL REGISTERS, ADDRESS,DATA & CONTROL BUSES.
Programmable Interval Timer
Programmable Keyboard/ Display Interface: 8279
Chapter 2 HARDWARE SUMMARY
8086.  The 8086 is Intel’s first 16-bit microprocessor  The 8086 can run at different clock speeds  Standard 8086 – 5 MHz  –10 MHz 
Chapter 2 Number conversion (BCD) 8086 microprocessor Internal registers Making of Memory address.
University of Tehran 1 Microprocessor System Design Interrupt Omid Fatemi
Lecture 2 Presented By Dr. Shazzad Hosain Asst. Prof. EECS, NSU.
Set 20 Interrupts. INTERRUPTS The Pentium has a mechanism whereby external devices can interrupt it. Devices such as the keyboard, the monitor, hard disks.
4-1 ECE 424 Design of Microprocessor-Based Systems Haibo Wang ECE Department Southern Illinois University Carbondale, IL Hardware Detail of Intel.
3-1 ECE 424 Design of Microprocessor-Based Systems Haibo Wang ECE Department Southern Illinois University Carbondale, IL Intel 8088 (8086) Microprocessor.
Kip Irvine: Assembly Language for Intel-Based Computers
P Address bus Data bus Read-Only Memory (ROM) Read-Write Memory (RAM)
INTEL 8086 Software & Hardware Architecture
Microcomputer & Interfacing Lecture 2
به نام یکتای هستی بخش درس ریزپردازنده یک گروه دکتر ثنایی جلسه اول.
CPU Interfacing Memory.
Address Decoding Memory/IO.
8086/8088 Hardware Specifications A Course in Microprocessor Electrical Engineering Dept. University of Indonesia.
Basic I/O Interface A Course in Microprocessor
Input/Output Interface Circuits and LSI Peripheral Devices
CoE3DJ4 Digital Systems Design Hardware summary. Microprocessors vs. Microcontrollers Microprocessors are single-chip CPU used in microcomputers Microcontrollers.
MICROPROCESSORS AND APPLICATIONS
BIOS and DOS Programming in DOS INT 10 and 21H. Interrupts There are some extremely useful subroutines within BIOS or DOS that are available to the user.
8086/8088 Hardware Specifications Power supply:  +5V with tolerance of ±10%;  360mA. Input characteristics:  Logic 0 – 0.8V maximum, ±10μA maximum;
1 Microprocessor-based Systems Course 8 Design of input/output interfaces.
Minimum System Requirements Clock Generator Memory Interfacing.
8279 KEYBOARD AND DISPLAY INTERFACING
Chapter 11Chapter 12 Memory system designI/O system design Objectives: The importance of bus buffering How the 8088 addresses (accesses) memory - I/O ports.
Interrupts Useful in dealing with: The interface: Random processes;
8086/8088 Hardware System. Typical Microprocessor Memory System CPU Memory Control Address Data.
Programmable Peripheral Interface Parallel port Interface 8255
8279 KEYBOARD AND DISPLAY INTERFACING
A Design Example A Programmable Calculator. Programmable Calculator Working in Exact Mode Receiving Program from RS232 Port Saving Programs using RS232.
Block diagram of 8086.
EEL 3801 Part IV The Assembler. OFFSET Operator Returns address of variable used as operand. Actually, it represents the offset from the beginning of.
Khaled A. Al-Utaibi  I/O Ports  I/O Space VS Memory Space  80x86 I/O Instructions − Direct I/O Instructions − Indirect I/O Instructions.
8086 Microprocessor J Srinivasa Rao.
8 085Microprocessor Temp Reg (8) Accumulator (A reg) Flag flip flops(8) Instruction Register (8) Arithmetic Logic Unit ALU Instruction Decoder and Machine.
I NTEL 8086 M icroprocessor بسم الله الرحمن الرحيم 1.
Seminar On 8085 microprocessor
Lecture 2 Programming of 8086 Лектор: Люличева И.А. 1.
Presentation on Real Mode Memory Addressing
Microprocessor and Assembly Language
Introduction to the processor and its pin configuration
COURSE OUTCOMES OF Microprocessor and programming
8086 MICROPROCESSOR ARCHITECTURE & SEGMENTATION
EE3541 Introduction to Microprocessors
Interfacing 64Kb EPROM with 8085
Basic Microprocessor Architecture
Machine control instruction
Assembly Language Programming Part 2
Intel 8088 (8086) Microprocessor Structure
שפת סף וארכיטקטורה של מעבד 8086
Timer.
Memory organization On- chip memory Off-chip memory
Intel 8088 (8086) Microprocessor Structure
Microprocessor Lab CSL1543 0:0:2
Unit:08 Software Interrupts
8085 Microprocessor Architecture
UNIT-II Assembly Language Programs Involving Logical
PIC &PPI PPI Mode 2 with PIC(8259).
Presentation transcript:

A Design Example An Exact Calculator

Exact Calculator Manipulating Large Integer Values Operations: – +, -, *, /, %, And, Or, Xor, Not, Power Functions – Biggest Divisor, Smallest Multiplicand, Factoriel,.. Memory Options – Save (M1 – Mn), Retrieve, X, Y, X  Y

Hardware Specifications Keyboard with 64 (8x8) Keys 8 Seven-Segment Display Timer Options: hh – mm – ss 8086 in Minimum Mode Half of Address Space for RAM and the other half for EPROM 5MHz Crystal for Clock

CPU Pins in Minimum Mode Min Mode Vcc

8086 System Minimum mode Latch Buffer

8284 Clock Generator for 8086 an 18-pin chip specially designed to be used with 8088/86 microprocessors, It provides the clock and synchronization for the microprocessor, also provides the READY signal for the insertion of wait states into the CPU bus cycle.

5MHz

8 Fully Buffered 8086

Bank Write and Bank Read Control Logic Bank Write Control Logic Bank Read Control Logic BHE WR RD A0 2 EPROMs Each 256KB = 256Kx8 = Eight or SRAMs Each 256KB = 256Kx8 = Eight or Total 1M

A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12 A13 A14 A15 D0 D1 D2 D3 D4 D5 D6 D7 CS OE WE A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12 A13 A14 A15 D0 D1 D2 D3 D4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A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12 A13 A14 A15 D0 D1 D2 D3 D4 D5 D6 D7 CS OE A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12 A13 A14 A15 D0 D1 D2 D3 D4 D5 D6 D7 CS OE A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12 A13 A14 A15 D0 D1 D2 D3 D4 D5 D6 D7 CS OE D0 - D7 D8 - D15 A1-A16 Y0 Y1 Y2 Y3 Y4 Y5 Y6 Y7 A0 A1 A2 G1 G2 A17 A18 A19 A0 DEN Y0 Y1 Y2 Y3 Y4 Y5 Y6 Y7 A0 A1 A2 G1 G2 A17 A18 A19 BHE DEN RD EPROMs

Main Program ORG 0FFF0H ;Address FFFF0 XOR AX,AX ;AX=0 MOV DS,AX ;DS=0 MOV AH,80H ;AX=8000H MOV SS,AX ;STACK From 80000H MOV SP,0FFFFH JMP 0F000H:100 ORG 100H;Address F0100 CLI CALL INIT_KEYBOARD CALL INIT_DISPLAY CALL INIT_TIMER CALL INIT_8259 STI Main_LOOP: CALL GETCH ;Scan Code Available in AL CALL Process_Key JMP Main_LOOP It’s for the Segment F000

Peripherals 8255 (Keyboard) 8255 (Display) Timer Interrupt Controller

Address Decoding for the Peripherals A PPI A0 A1 Latch (‘373) Display Y0 Y1 Y2 Y3 Y4 Y5 Y6 Y7 X0 X1 X2 A0 A1 A2 A3 A4 A5 A6 A7 CS 8259 A0 CS AD0-AD7 D0-D7 Buffer ALE Keyboard Address: 000XXPP0 Timer Address: 010XXPP0 Display Address: 011XXPP Address: 110XXXP0 IR0 IR1 Keyboard Timer 8259

Address Assignment DISPLAY_SEGMENTS EQU 0 DISPLAY_GND EQU 2 DISPLAY_CTRL EQU 6 KEYBOARD_ROW EQU 40H KEYBOARD_COL EQU 42H KEYBOARD_CTRL EQU 46H TIMER_CH0 EQU 80H TIMER_CH1 EQU 82H TIMER_CH2 EQU 84H TIMER_CTRL EQU 86H P8259_0EQU b P8259_1EQU b

Keys ;Scan Codes. There are 64 keys. codes are from 32 to 95 ;These codes are Available: ; 32=space 33=! 37=% 38=& 42=* 43=+ 45=- 46=. 47=/ 48-57=0-9 61== 65-90=A-Z 94=^ RIGHT_ARROW EQU 34 PAGE_RIGHT EQU 35 END_OF_RIGHT EQU 36 LEFT_ARROW EQU 39 PAGE_LEFT EQU 40 END_OF_LEFT EQU 41 TOMEMORY EQU 44 RECALLMEMORY EQU 45 LogicalOR EQU 58 POWER EQU 59 BiggestDivisor EQU 60 SmallestDivisor EQU 62 Factorial EQU 63 CLEAR EQU 64 CLEARALL EQU 91

Data ORG 2000H X_VALUE DB 1000H DUP(?) Y_VALUE DB 1000H DUP(?) M_VALUE DB 8000H DUP(?) ;Eight KEY_BUFF DB 16 DUP(?) DISPLAY_DATA DB 8 DUP (?) KEY_head DB 0 KEY_tail DB 0 DISPLAY_Counter DB 0 ;Identifies which segment should be shown GND_DRIVER DB B X_SIZE DW 0 ; Size of X register in bytes Y_SIZE DW 0 M_SIZE DW 8 DUP (0) DISPLAY_START DW 0

8255 Control Word

Keyboard Initialization INIT_KEYBOARD: MOV AL, B ;Mode0 output for A ;Mode 0 input for B ;input for C OUT KEYBOARD_CTRL,AL MOV AL,0FFH ;OFF All Rows OUT KEYBOARD_ROW,AL XOR AL,AL ;Reset FIFO MOV [Key_head],AL MOV [Key_tail],AL RET

Keyboard Scanning SCAN_KEYBOARD: MOVBL,0 ;The scan code MOV AH, B ;Row activation Number Next_Row: MOV AL,AH OUT KEYBOARD_ROW,AL IN AL,KEYBOARD_COL CMP AL,0FFH JNE Detect_Key ROL AH,1 ADD BL,8 CMP BL,64 JNE Next_Row MOV BL,0FFH RET Detect_Key: INC BL RCR AL,1 JC Detect_Key ADD BL,31 ;To have codes from 32 to 95 RET

Keyboard Interrupt KEYBOARD_INT: PUSH AX PUSH BX CALL SCAN_KEYBOARD JE END_KEY MOV AL,BL ;Saving scan code MOV BX,offset KEY_BUFF MOV BL,[KEY_head] MOV [BX],AL INC BL AND BL,0FH ;Only 16 bytes are saved MOV [Key_head],BL END_KEY: POP BX POP AX IRET

GETCH GETCH: MOV BX,KEY_BUFF MOV BL,[KEY_tail] wait_for_key: MOV AL,[Key_head] CMP AL,BL JE Wait_for_key MOV AL,[BX] INC BL MOV [Key_tail],BL RET

Key Processing Process_key: MOVBX,Function_Table SUBAL,32 MULAL,2 MOVAH,0 ADDBX,AX MOVBX,[BX] JMP[BX] Function_Table DWoffset SPACE_PROCESS DWoffset NOT_PROCESS