Presentation is loading. Please wait.

Presentation is loading. Please wait.

BITS Pilani Pilani Campus Pawan Sharma Lecture 8-9 19/22-01-2013 ES C263 INSTR/CS/EEE F241 Microprocessor Programming and Interfacing.

Similar presentations


Presentation on theme: "BITS Pilani Pilani Campus Pawan Sharma Lecture 8-9 19/22-01-2013 ES C263 INSTR/CS/EEE F241 Microprocessor Programming and Interfacing."— Presentation transcript:

1 BITS Pilani Pilani Campus Pawan Sharma Lecture 8-9 19/22-01-2013 ES C263 INSTR/CS/EEE F241 Microprocessor Programming and Interfacing

2 BITS Pilani, Pilani Campus  Disk Organization  Interpretation of Boot sector  File Allocation Table  Root Directory  Example Last Lecture

3 BITS Pilani, Pilani Campus  8086 architecture  Programmers Model Today’s Lecture

4 BITS Pilani, Pilani Campus 8086 Architecture

5 BITS Pilani, Pilani Campus 8086 Data Bus Control signals Add Bus A 0 A 19 D 0 D 15

6 BITS Pilani, Pilani Campus Memory Address Space A 19 ……………A 0 0……………….0 00000 H 1……………….1 FFFFF H Memory Address Space 00000 H FFFFF H

7 BITS Pilani, Pilani Campus  Allows the microprocessor to address only the first 1MB of memory space, even if it is Core2 or i5 or i7 microprocessor.  First 1MB of memory is called the DOS memory system. DOS requires the CPU to work in real mode.  Real mode is characterized by a 20 bit segmented memory address space (giving exactly 1 MB of addressable memory) and unlimited direct software access to all memory (no protection), I/O addresses and peripheral hardware. Real Mode Memory Addressing

8 BITS Pilani, Pilani Campus BIU ALU Control & Timing EU Address bus RAMROM I/o Ports Discs Video Data Bus CLK System Block Diagram

9 BITS Pilani, Pilani Campus  BIU (Bus Interface Unit)  provides hardware functions for generation of the memory and I/O addresses for the transfer of data between itself and the outside world  (Queue, segment registers & IP)  EU (Execution Unit)  receives program instruction codes and data from the BIU, executes these instructions and stores the results in the general- purpose registers  (Control ckt, Instruction decoder, ALU, GP registers, SP,SI,DI,BP) CPU Components

10 BITS Pilani, Pilani Campus IP 16bit CS DS ES SS Code Segment register Data Segment register Extra Segment register Stack Segment register Instruction Pointer Programmers Model : CPU H/W which is Program visible: referenced directly during application programming CPU H/W which is Program invisible: can not be referenced directly by programmer but internally involved

11 BITS Pilani, Pilani Campus  Laundry Example  Four persons each have one load of clothes to wash, dry, and fold  Washer takes 30 minutes  Dryer takes 40 minutes  “Folder” takes 20 minutes Pipelining: Its Natural! ABCD

12 BITS Pilani, Pilani Campus Sequential Laundry ABCD 304020304020304020304020 6 PM 789 10 11 Midnight TaskOrderTaskOrder Time

13 BITS Pilani, Pilani Campus Pipelined Laundry :Start work ASAP ABCD 6 PM 789 10 11 Midnight TaskOrderTaskOrder Time 3040 20 Pipelined laundry takes 3.5 hours for 4 loads

14 BITS Pilani, Pilani Campus Key Definitions  Pipelining is a key implementation technique used to build fast processors. It allows the execution of multiple instructions to overlap in time.  The throughput of an instruction pipeline is the measure of how often an instruction exits the pipeline.

15 BITS Pilani, Pilani Campus  Pipelining doesn’t help latency of single task, it helps throughput of entire workload  Pipeline rate limited by slowest pipeline stage  Multiple tasks operating simultaneously  Potential speedup = Number pipe stages  Unbalanced lengths of pipe stages reduces speedup  Time to “fill” pipeline and time to “drain” it reduces speedup Pipelining Lessons ABCD 6 PM 789 TaskOrderTaskOrder Time 3040 20

16 BITS Pilani, Pilani Campus  BIU stores pre-fetched bytes (six instruction bytes for the following instructions) in a FIFO register called the queue register.  Helps CPU execute instructions much faster  In case of JMP or CALL instructions, the queue needs to be dumped.  Fetching the next instruction while the current instruction executes is called pipelining. Queue Register

17 BITS Pilani, Pilani Campus IP = 3000 H CS = 2000 H Base address Offset address Physical address = 20000 H + 3000 H 23000 H 2000 H : 3000 H Segment-Offset Addressing Scheme

18 BITS Pilani, Pilani Campus Example Segment Addresses Segment Register Starting AddressEnding Addresses 2000 H 2001 H 2100 H AB00 H 1234 H 20000 H 20010 H 21000 H AB000 H 12340 H 2FFFF H 3000F H 30FFF H BAFFF H 2233F H

19 BITS Pilani, Pilani Campus Data Code Stack Extra 4900 ES 3400 SS 1000DS 2000 SS 00000 H 10000 H 20000 H 1FFFF H 2FFFF H 34000 H 43FFF H 49000 H 58FFF H Memory Segmentation

20 BITS Pilani, Pilani Campus AX BX CX DX SP BP SI DI Count Data Stack Pointer Base Pointer Source Index Destination Index Programmers Model (EU): Accumulator Base Index

21 BITS Pilani, Pilani Campus AX AH (8 bit) AL (8 bit) BX BHBL CX CHCL DX DHDL (Accumulator) (Base Register) (Used as a counter) (Used to point to data in I/O operations)

22 BITS Pilani, Pilani Campus MULTIPURPOSE REGISTERS AX, BX, CX, DX, BP, DI, SI SPECIAL PURPOSE REGISTERS IP, SP, FLAGS CS, DS, SS, ES ( Segment Registers )

23 BITS Pilani, Pilani Campus 8086 – Default 16 bit segment and offset address combinations Segment offset special purpose CS SS DS ES IP SP (or) BP BX,DI,SI an 8-bit number 16 – bit number DI for string Instructions Instruction Address Stack address Data address String destination address

24 BITS Pilani, Pilani Campus EAX AX EBX BX ECX CX EDX DX ESP SP EBP BP 32-bit registers in 80386 through Core2

25 BITS Pilani, Pilani Campus ESI SI EDI DI EIP IP EFLAGS Flags

26 BITS Pilani, Pilani Campus  A flag is a flip flop that indicates some condition produced by the execution of an instruction or controls certain operations of the execution unit.  A 16-bit flag register in the EU contains nine active flags.  Conditional Flags /Status Flags  C (Carry)  P (Parity)  Z (Zero)  S (Sign)  A (Auxiliary Carry)  O (Overflow)  Control Flags  I (Interrupt)  D (Direction)  T (Trace) Flags

27 BITS Pilani, Pilani Campus ODITSZAPC 110 8086 (8088/186/188) 80286 14 bits 80386 17 bits 80486 18 bits Pentium/ Pentium IV 21 bits

28 BITS Pilani, Pilani Campus ES CS SS DS IP  1 2 3 4 5 6 Control & Timing Memory Interface ALU Operands Flags AHAL BHBL SP BP SI DI CHCL DHDL EU BIU Instruction Queue Block Diagram of 8086


Download ppt "BITS Pilani Pilani Campus Pawan Sharma Lecture 8-9 19/22-01-2013 ES C263 INSTR/CS/EEE F241 Microprocessor Programming and Interfacing."

Similar presentations


Ads by Google