ECE291 Lecture 1 All about computers. ECE 291 Lecture 1Slide 2 of 45 Lecture outline Errata from yesterday Class and Lab Schedules Top-down view of computers.

Slides:



Advertisements
Similar presentations
Register In computer architecture, a processor register is a small amount of storage available on the CPU whose contents can be accessed more quickly than.
Advertisements

COMP 2003: Assembly Language and Digital Logic
Computer Architecture and Operating Systems CS 3230 :Assembly Section Lecture 2 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
MICROPROCESSORS TWO TYPES OF MODELS ARE USED :  PROGRAMMER’S MODEL :- THIS MODEL SHOWS FEATURES, SUCH AS INTERNAL REGISTERS, ADDRESS,DATA & CONTROL BUSES.
Khaled A. Al-Utaibi  Computers are Every Where  What is Computer Engineering?  Design Levels  Computer Engineering Fields  What.
CEN 226: Computer Organization & Assembly Language :CSC 225 (Lec#3) By Dr. Syed Noman.
Azir ALIU 1 What is an assembly language?. Azir ALIU 2 Inside the CPU.
1 Hardware and Software Architecture Chapter 2 n The Intel Processor Architecture n History of PC Memory Usage (Real Mode)
© 2006 Pearson Education, Upper Saddle River, NJ All Rights Reserved.Brey: The Intel Microprocessors, 7e Chapter 2 The Microprocessor and its Architecture.
1 ICS 51 Introductory Computer Organization Fall 2006 updated: Oct. 2, 2006.
3-1 ECE 424 Design of Microprocessor-Based Systems Haibo Wang ECE Department Southern Illinois University Carbondale, IL Intel 8088 (8086) Microprocessor.
Assembly Language for Intel-Based Computers Chapter 2: IA-32 Processor Architecture Kip Irvine.
ICS312 Set 3 Pentium Registers. Intel 8086 Family of Microprocessors All of the Intel chips from the 8086 to the latest pentium, have similar architectures.
Microprocessor Systems Design I Instructor: Dr. Michael Geiger Spring 2012 Lecture 2: 80386DX Internal Architecture & Data Organization.
80x86 Processor Architecture
© 2006 Pearson Education, Upper Saddle River, NJ All Rights Reserved.Brey: The Intel Microprocessors, 7e Chapter 2 The Microprocessor and its Architecture.
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.
Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.
The 8086 Microprocessor The 8086, announced in 1978, was the first 16-bit microprocessor introduced by Intel Corporation 8086 is 16-bit MPU. Externally.
Monday, October 4 Assignment(s) due: Assignment #5: COMPLEMENT ARITHMETIC Assignment #6: DEBUG EXERCISES Quiz(zes) due:Quiz #5: Base Arithmetic Quiz #6.
An Introduction to 8086 Microprocessor.
The Pentium Processor.
The Pentium Processor Chapter 3 S. Dandamudi To be used with S. Dandamudi, “Introduction to Assembly Language Programming,” Second Edition, Springer,
1 Fundamental of Computer Suthida Chaichomchuen : SCC
Fall 2012 Chapter 2: x86 Processor Architecture. Irvine, Kip R. Assembly Language for x86 Processors 6/e, Chapter Overview General Concepts IA-32.
INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMING
The x86 Architecture Lecture 15 Fri, Mar 4, 2005.
ECE291 Lecture 1 All about computers. ECE 291 Lecture 1Page 2 of 41 Lecture outline Top-down view of computers Processor architecture RegistersMemoryPeripherals.
(-133)*33+44* *33+44*14 Input device memory calculator Output device controller Control bus data bus memory.
Chapter 2 Parts of a Computer System. 2.1 PC Hardware: Memory.
Computers organization & Assembly Language Chapter 1 THE 80x86 MICROPROCESSOR.
Block diagram of 8086.
Intel 8086 (8088) Microprocessor Structure
X86 Assembly Language We will be using the nasm assembler (other assemblers: MASM, as, gas)
INTRODUCTION TO INTEL X-86 FAMILY
MODULE 5 INTEL TODAY WE ARE GOING TO DISCUSS ABOUT, FEATURES OF 8086 LOGICAL PIN DIAGRAM INTERNAL ARCHITECTURE REGISTERS AND FLAGS OPERATING MODES.
Microprocessor Fundamentals Week 2 Mount Druitt College of TAFE Dept. Electrical Engineering 2008.
Lecture 2 About Computers Dr. Dimitrios S. Nikolopoulos CSL/UIUC.
Internal Programming Architecture or Model
1 x86 Programming Model Microprocessor Computer Architectures Lab Components of any Computer System Control – logic that controls fetching/execution of.
Intel 8086 MICROPROCESSOR ARCHITECTURE
BITS Pilani Pilani Campus Pawan Sharma Lecture / ES C263 INSTR/CS/EEE F241 Microprocessor Programming and Interfacing.
Microprocessors CSE- 341 Dr. Jia Uddin Assistant Professor, CSE, BRAC University Dr. Jia Uddin, CSE, BRAC University.
Intel MP Organization. Registers - storage locations found inside the processor for temporary storage of data 1- Data Registers (16-bit) AX, BX, CX, DX.
I NTEL 8086 M icroprocessor بسم الله الرحمن الرحيم 1.
Microprocessors CSE- 341 Dr. Jia Uddin Assistant Professor, CSE, BRAC University Dr. Jia Uddin, CSE, BRAC University.
Chapter Overview General Concepts IA-32 Processor Architecture
Homework Reading Lab with your assigned section starts next week
Assembly language.
Format of Assembly language
x86 Processor Architecture
UNIT Architecture M.Brindha AP/EIE
Introduction to 8086 Microprocessor
8086 Microprocessor.
Assembly IA-32.
Intel 8088 (8086) Microprocessor Structure
Homework Reading Continue work on mp1
Basic of Computer Organization
Introduction to Assembly Language
Intel 8088 (8086) Microprocessor Structure
8086 Registers Module M14.2 Sections 9.2, 10.1.
CS-401 Computer Architecture & Assembly Language Programming
Morgan Kaufmann Publishers Computer Organization and Assembly Language
CS 301 Fall 2002 Computer Organization
The Microprocessor & Its Architecture
Computer Architecture CST 250
Unit-I 80386DX Architecture
Computer Architecture and System Programming Laboratory
Microprocessor Lecture 7 (8086 Registers).
Presentation transcript:

ECE291 Lecture 1 All about computers

ECE 291 Lecture 1Slide 2 of 45 Lecture outline Errata from yesterday Class and Lab Schedules Top-down view of computers Processor architecture RegistersMemoryPeripherals Assembly primer

ECE 291 Lecture 1Slide 3 of 45 HW0 Answers First Transistor: 1948 First Intel Microprocessor: 1985

ECE 291 Lecture 1Slide 4 of 45 Clarification on Sign Contraction Yesterday I said, “A number can be sign contracted if the bits that are to removed are all the same” “A number can be sign contracted if the bits that are to removed are all the same” I should have said, “A number can be sign contracted if the bits that are to removed and the sign bit of the resultant number are all the same” “A number can be sign contracted if the bits that are to removed and the sign bit of the resultant number are all the same”Example: 0001h = 1  01h = 1OK 0001h = 1  01h = 1OK FF80h = -128  80h = -128OK FF80h = -128  80h = -128OK FF40h = -192  40h = 64NO FF40h = -192  40h = 64NO 0080h = 128  80h = -128NO 0080h = 128  80h = -128NO

ECE 291 Lecture 1Slide 5 of 45 Class and Lab Schedules and This is what we decided on This is what we decided on Any comments, suggestions for improvement, or sarcastic retorts? Any comments, suggestions for improvement, or sarcastic retorts?

ECE 291 Lecture 1Slide 6 of 45 Computers from 50,000 feet Basic components Mouse Mouse Keyboard Keyboard Monitor Monitor Printer Printer Scanner Scanner Joystick Joystick “The box” “The box”

ECE 291 Lecture 1Slide 7 of 45 Computers from 10,000 feet Sound card Serial SCSI Parallel Keyboard/MouseUSBExpansionVGA Network Power

ECE 291 Lecture 1Slide 8 of 45 Computers from 100 feet Cooling fan Power supply Memory Processor Expansion bus Motherboard IDE and SCSI cables and devices

ECE 291 Lecture 1Slide 9 of 45 Motherboard Computers from 10 feet CPU Memory Expansion Bus Peripherals Control Data Address

ECE 291 Lecture 1Slide 10 of 45 Motherboard Computers from 10 feet Processor dx /Pentium (Pro) Data Bus Address Bus Max Addressable Memory 1,048,576 (1Mb) 16,777,21(16Mb) 4,294,976,296 (4Gb)

ECE 291 Lecture 1Slide 11 of 45 Computers from 1 micron Central Processing Unit – The Processor Control BIU ALU Control registers General purpose registers Special (floating-point, flag, sse) Control Data Address

ECE 291 Lecture 1Slide 12 of 45 The processor It’s a state machine Has a set of hard-coded operations Each operation has an associated code; an “opcode” Each operation has an associated code; an “opcode” Some examples are MOV, ADD, SUB, AND Some examples are MOV, ADD, SUB, AND All it can do is move data or perform some calculation on data Very simple, right?

ECE 291 Lecture 1Slide 13 of 45 The processor - components CPU Registers Special memory locations constructed from flip-flops and implemented on-chip Special memory locations constructed from flip-flops and implemented on-chip E.g., accumulator, count register, flag register E.g., accumulator, count register, flag register Arithmetic and logic Unit (ALU) Where most of the action takes place inside the CPU Where most of the action takes place inside the CPU Bus Interface Unit (BIU) Responsible for controlling the address and data busses when accessing main memory and data in the cache Responsible for controlling the address and data busses when accessing main memory and data in the cache Control Unit and Instruction Set CPU has a fixed set of instructions CPU has a fixed set of instructions E.g. MOV, CMP, ADD, JMP E.g. MOV, CMP, ADD, JMP

ECE 291 Lecture 1Slide 14 of 45 The registers Small memory locations that are quickly accessible by the processor Located on the chip Hold data and results for operations Point to main memory locations Contain status information about the results of operations

ECE 291 Lecture 1Slide 15 of 45 80x86 registers Accumulator EAX AHAL AX Base EBX BHBL BX Count ECX CHCL CX Data EDX DHDL DX General Purpose Inst Pointer EIP IP Flags EFLAG FLAG Special Registers Stack Segment Code Segment CS Data Segment DS Extra Segment ES SS FSGS Segment Registers Stack Pointer ESP SP Base Pointer EBP BP Dest Index EDI DI Source Index ESI SI Index Registers

ECE 291 Lecture 1Slide 16 of 45 Register specifics Accumulator (AL, AH, AX, EAX) Usually stores results from the ALU Usually stores results from the ALU It “accumulates” totals from math operations It “accumulates” totals from math operations General purpose General purpose Base (BL, BH, BX, EBX) Usually holds addresses – points to memory locations Usually holds addresses – points to memory locations

ECE 291 Lecture 1Slide 17 of 45 Register specifics Count (CL, CH, CX, ECX) Counting and looping Counting and looping Certain instructions automatically decrement the count register Certain instructions automatically decrement the count register Data (DL, DH, DX, EDX) Usually contains data for instructions Usually contains data for instructions Used in multiplication/division instructions along with accumulator Used in multiplication/division instructions along with accumulator

ECE 291 Lecture 1Slide 18 of 45 Register specifics Source index (SI, ESI) Often used to address a source variable or array Often used to address a source variable or array Destination index (DI, EDI) Often used to address a destination variable or array Often used to address a destination variable or array

ECE 291 Lecture 1Slide 19 of 45 Register specifics Stack pointer (SP, ESP) Used by stack operations Used by stack operations Usually you don’t want to mess with this one Usually you don’t want to mess with this one Base pointer (BP, EBP) Addresses stack memory Addresses stack memory It’s better to mess with this one, though you can still get you in trouble It’s better to mess with this one, though you can still get you in trouble Can be used to read subroutine arguments Can be used to read subroutine arguments

ECE 291 Lecture 1Slide 20 of 45 Register Specifics Get in the habit of using these registers for their intended tasks as much as possible It will greatly help you (and us) in reading and debugging your code!

ECE 291 Lecture 1Slide 21 of 45 Register specifics Code segment (CS) Points to the area in memory where instructions are stored Points to the area in memory where instructions are stored Instruction pointer (IP) An index into the code segment that points to the next instruction to be executed An index into the code segment that points to the next instruction to be executed Data segment (DS) Points to the area in memory where data needed by a program is stored Points to the area in memory where data needed by a program is stored

ECE 291 Lecture 1Slide 22 of 45 Register specifics Stack segment (SS) Points to the area in memory containing the system’s FIFO stack. We’ll have a whole lecture on this. Points to the area in memory containing the system’s FIFO stack. We’ll have a whole lecture on this. ES, FS, GS Extra segment registers available to point to additional data segments should that be necessary. Extra segment registers available to point to additional data segments should that be necessary.

ECE 291 Lecture 1Slide 23 of 45 Memory System memory or RAM holds data and instruction opcodes that are being used by the CPU Organized in banks, usually even and odd Always byte addressable More on all this tomorrow

ECE 291 Lecture 1Slide 24 of 45 Memory access example CPU wants to read memory at address 12345h CPUMemory Read Signal Data 12345h

ECE 291 Lecture 1Slide 25 of 45 Memory organization AB 1 FF DE 0146 F124 E B D F A C E Odd BankEven Bank Data Bus (15:8)Data Bus (7:0)

ECE 291 Lecture 1Slide 26 of 45 Memory organization In Real Mode: The address bus is 20-bits for memory operations. The address bus is 20-bits for memory operations = 1MB = how much memory an x86 processor can address in real mode 2 20 = 1MB = how much memory an x86 processor can address in real mode The data bus is 16-bits which means it can transfer two bytes in one operation The data bus is 16-bits which means it can transfer two bytes in one operation Limited to 16-bit registers Limited to 16-bit registers

ECE 291 Lecture 1Slide 27 of 45 Memory organization In Protected Mode: The memory address bus is 32-bits The memory address bus is 32-bits 2 32 = 4GB = the maximum addressable amount of memory in modern x86 processors 2 32 = 4GB = the maximum addressable amount of memory in modern x86 processors Data bus is also 32-bits meaning four bytes can be transferred in a single operation Data bus is also 32-bits meaning four bytes can be transferred in a single operation Gain access to the 32-bit extended registers Gain access to the 32-bit extended registers

ECE 291 Lecture 1Slide 28 of 45 Peripherals In our context, things like printers, joysticks, and scanners aren’t peripherals Some examples are parallel, serial and USB ports, the internal timers, interrupt controllers, network interface cards Many helper devices inside the processor, on the motherboard, or in expansion slots

ECE 291 Lecture 1Slide 29 of 45 Peripheral I/O bus There is a separate set of address/data busses commonly used for communication with peripheral devices The I/O address bus is 16-bits wide, meaning you can address 65,535 different I/O ports. The I/O data bus is 16-bits Example: In real mode, The keyboard input (scan code) is read in on port 60h. Each scan code is one byte. In real mode, The keyboard input (scan code) is read in on port 60h. Each scan code is one byte.

ECE 291 Lecture 1Slide 30 of 45 Peripheral I/O Peripheral devices don’t have to use the I/O bus. They can be memory mapped. Video cards are an example They have a large amount of memory (VRAM) and that is typically mapped to a range of addresses in the memory space

ECE 291 Lecture 1Slide 31 of 45 Peripheral example Network card Input/Output Range CC00-CC7F Memory Range FB FB00007F This one is both memory mapped and I/O mapped

ECE 291 Lecture 1Slide 32 of 45 Peripherals All this really means to you is that sometimes you’ll use one set of instructions to access a device, and sometimes you’ll use a different set. We’ll talk about this again when we cover serial/parallel ports, timers, interrupts, and the video graphics adapter.

ECE 291 Lecture 1Slide 33 of 45 Intermission

ECE 291 Lecture 1Slide 34 of 45 Instruction processing Processing of an instruction by the microprocessor consists of three basic steps 1. fetch instruction from the memory 2. decode the instruction 3. execute (usually involves accessing the memory for getting operands and storing results) Operation of an early processor like the Intel 8085 Fetch 1 Decode 1 Execute 1 Fetch 2 Decode 2 Execute 2 …... Busy IdleBusy…... Busy IdleBusy Microprocessor Bus

ECE 291 Lecture 1Slide 35 of 45 Instruction processing Fetch 1 Fetch 2 Fetch 5 Fetch 3 Fetch 4 Modern microprocessors can process several instructions simultaneously at various stages of execution this ability is called pipelining this ability is called pipelining Operation of a pipelined microprocessor like the Intel Store 1 Fetch 6 Fetch 7 Read 2 Decode 1 Decode 2 Decode 3 Decode 4 Decode 5 Decode 6 Idle Execute 1 Idle Execute 2 Execute 3 Execute 4 Execute 5 Execute 6 Generate Address 1 Generate Address 2 Bus Unit Instruction Unit Execution Unit Address Unit

ECE 291 Lecture 1Slide 36 of 45 Assembly primer Everything in your assembly file is one of the following: A comment A comment A label A label An instruction or directive An instruction or directive Data Data

ECE 291 Lecture 1Slide 37 of 45 Assembly primer - comments ; Comments are denoted by semi-colons. ; These are comments ; Please comment your MP’s! ; It helps us figure out what you were doing ; It also helps you figure out what you were ; doing when you look back at code you ; wrote more than two minutes ago.

ECE 291 Lecture 1Slide 38 of 45 Assembly primer - labels You might be asking, “What about variables? Why aren’t they on the bulleted list?” You may also not care at all Variables are nothing more than labels that mark specific memory locations Labels can also mark the beginning of procedures or “jump to” locations in your code

ECE 291 Lecture 1Slide 39 of 45 Assembly primer - labels ; Labels can be global MyGlobalLabel:MyOtherGlobalLabel ; They can be local too.MyLocalLabel ; Local labels are good only back to the previous un-dotted label

ECE 291 Lecture 1Slide 40 of 45 Assembly primer - labels MyBigGlobalLabel.local_label1.local_label2MyNextBigGlobalLabel.local_label1; these are distinct.local_label2; to the ones above

ECE 291 Lecture 1Slide 41 of 45 Assembly primer - variables ; Let’s do something with labels now VAR1 DB 255 VAR2 DB 0FFh VAR3 DW 1234h ARR1 DB 12, 34, 56, 78, 90 ARR2 DW 12, 34, 56, 78, 90 STR1 DB ‘291 is awesome!!!’, 0 BUF1 RESB 80 labelsdirectivesdata

ECE 291 Lecture 1Slide 42 of 45 Assembly primer - directives EXTERN – allows you to declare external procedures so you can use them in your program. SEGMENT – lets you declare the beginning of a memory segment. We’ll talk in detail about memory segments tomorrow. EQU – lets you define pre-processor constants.

ECE 291 Lecture 1Slide 43 of 45 Assembly primer - directives ; Let’s declare some external functions EXTERN kbdine, dspout, dspmsg, dosxit ; Let’s begin our code segment SEGMENT code ; Normally variables would go here..start; This is a special label that ; denotes the execution starting ; point in NASM. The next instruction ; after..start will be the first ; to run when you execute your program

ECE 291 Lecture 1Slide 44 of 45 Assembly primer - instructions ; Here are some simple instructions mov ax, [VAR1] ; notice the brackets mov dx, STR1 ; notice the not brackets call dspmsg jmp done mov bx, [VAR2] ; this will never happen done

ECE 291 Lecture 1Slide 45 of 45 Example SEGMENT code var1db55h; 55 var2db0AAh; AA var3db12h; 12 str1db"Hello", 0; C 6C 6F 00..start moval,[var1]; A movbx,var3; BB incbx; 43 moval,[bx]; 8A 07

ECE 291 Lecture 1Slide 46 of 45 Assignments Keep working on MP0 and HW0