EE345 Chapter 2 Lecture 3 April 4. Quiz every Wednesday 1 quiz = 1% extra credit five quizzes before midterm  5% for midterm. five quizzes before final.

Slides:



Advertisements
Similar presentations
Chapter 2: Data Manipulation
Advertisements

Fetch Execute Cycle – In Detail -
Microprocessors.
EET 2261 Unit 3 Assembly Language; Load, Store, & Move Instructions  Read Almy, Chapters 5 and 6.  Homework #3 and Lab #3 due next week.  Quiz next.
Dr. Ken Hoganson, © August 2014 Programming in R COURSE NOTES 2 Hoganson Language Translation.
Programming 68HC11.
Chapter 2 Machine Language.
2.3) Example of program execution 1. instruction  B25 8 Op-code B means to change the value of the program counter if the contents of the indicated register.
EE 362 Microprocessor Systems and Interfacing © 1-1 Lecture 1: Introduction to Microprocessor Based Systems Microprocessor Architecture Microprocessor.
Processor Function Topic 3.
Processor System Architecture
© 2010 Kettering University, All rights reserved..
H. Huang Transparency No.1-1 The 68HC11 Microcontroller Chapter 1: Introduction to 68HC11 The 68HC11 Microcontroller.
Instruction Set Architecture & Design
Computer Processing CSCE 110 J. Michael Moore.
Room: E-3-31 Phone: Dr Masri Ayob TK 2633 Microprocessor & Interfacing Lecture 1: Introduction to 8085 Assembly Language.
Chapter 7 Low-Level Programming Languages. 2 Chapter Goals List the operations that a computer can perform Discuss the relationship between levels of.
Table 1. Software Hierarchy Levels.. Essential Tools An assembler is a program that converts source-code programs into a machine language (object file).
Basic Computer Organization, CPU L1 Prof. Sin-Min Lee Department of Computer Science.
8051 ASSEMBLY LANGUAGE PROGRAMMING
EET 2261 Unit 2 HCS12 Architecture
Computers Central Processor Unit. Basic Computer System MAIN MEMORY ALUCNTL..... BUS CONTROLLER Processor I/O moduleInterconnections BUS Memory.
ECE 265 – LECTURE 4 The M68HC11 Address Modes 8/14/ ECE265.
Lecture 13 - Introduction to the Central Processing Unit (CPU)
CPS120: Introduction to Computer Science
Lecture 8 Presented By Dr. Shazzad Hosain Asst. Prof. EECS, NSU.
Lecture 3. Diff b/w RAM and Registers Registers are used to hold data immediately applicable to the operation at hand Registers are used to hold data.
Physics 413 Chapter 1: Introduction to the HCS 12 Microcontroller.
Processor Design ELEC 418 Advanced Digital Systems Dr. Ron Hayne Images Courtesy of Thomson Engineering.
The CPU Central Processing Unit. 2 Reminder - how it fits together processor (CPU) memory I/O devices bus.
Operating Systems Lecture No. 2. Basic Elements  At a top level, a computer consists of a processor, memory and I/ O Components.  These components are.
Assembly Language A Brief Introduction. Unit Learning Goals CPU architecture. Basic Assembler Commands High level Programming  Assembler  Machine Language.
Cis303a_chapt04.ppt Chapter 4 Processor Technology and Architecture Internal Components CPU Operation (internal components) Control Unit Move data and.
DH2T 34 – HNC Computer Architecture 1 Lecture 14 The Fetch-Decode-Execute Cycle [1]. © C Nyssen/Aberdeen College 2003 All images © C Nyssen/Aberdeen College.
Computer Systems - Registers. Starter… Discuss in pairs the definition of the following Control Unit Arithmetic and Logic Unit Registers Internal clock.
Chapter 7 Low-Level Programming Languages (slides modified by Erin Chambers)
ECE 265 – LECTURE 5 The M68HC11 Basic Instruction Set 12/8/ ECE265.
CSC 235 Computer Organization. Computer Organizaton ä Top_Level Structure ä The von-Neumann Machine ä Stack Machine ä Accumulator Machine ä Load/Store.
Represents different voltage levels High: 5 Volts Low: 0 Volts At this raw level a digital computer is instructed to carry out instructions.
EE 345 Class Notes EE345 Midterm Review Dr. Jane Dong.
Chapter 7 Low-Level Programming Languages Nell Dale John Lewis.
1 Introduction to Microcontroller Microcontroller Fundamentals & Programming.
COMPUTER ORGANISATION Sri.S.A.Hariprasad Sr.Lecturer R.V.C.E Bangalore.
1 The Instruction Set Architecture September 27 th, 2007 By: Corbin Johnson CS 146.
CS61C L20 Datapath © UC Regents 1 Microprocessor James Tan Adapted from D. Patterson’s CS61C Copyright 2000.
Simple ALU How to perform this C language integer operation in the computer C=A+B; ? The arithmetic/logic unit (ALU) of a processor performs integer arithmetic.
1 Basic Processor Architecture. 2 Building Blocks of Processor Systems CPU.
EE345 Chapter 2 Lecture 3 April Instruction and addressing modes 1.Extended Addressing 2.Direct Addressing 3.Inherent Addressing 4.Immediate Addressing.
1 What we want: execute High Level Language (HLL) programs What we have: computer hardware (a glorified calculator)
ELEC 418 Advanced Digital Systems Dr. Ron Hayne
Computer Organization
Addressing Modes in Microprocessors
Gunjeet Kaur Dronacharya Group of institutions
ECE 3430 – Intro to Microcomputer Systems
ECE 3430 – Intro to Microcomputer Systems
Computer Architecture
CS-401 Assembly Language Programming
Data Representation – Instructions
The fetch-execute cycle
Introduction to Assembly Language
Number Representations and Basic Processor Architecture
ME4447/6405 Microprocessor Control of Manufacturing Systems and
Computer Programming Machine and Assembly.
Computer Organization and ASSEMBLY LANGUAGE
ECEG-3202 Computer Architecture and Organization
Introduction to Micro Controllers & Embedded System Design
Physics 413 Chapter 2.
8051 ASSEMBLY LANGUAGE PROGRAMMING
Program Execution.
Information Representation: Machine Instructions
Presentation transcript:

EE345 Chapter 2 Lecture 3 April 4

Quiz every Wednesday 1 quiz = 1% extra credit five quizzes before midterm  5% for midterm. five quizzes before final exam  5% for final exam. each quiz: 2 to 3 problems, 10 to 15 mins; review quiz problems. turn in (corrected version if there are any mistakes) perfect answers on following Monday. receive 1%.

Take quiz (10 to 15 mins) on Wednesday review quiz problems together in class (5 to 10 mins) turn in perfect quiz on following Monday receive 1% of extra credit

Levels of Programming Languages High level ex. C, C++, Java, JavaScript, C#, … Assembly Language 68HC11, MIPS, ARM, … machine code c=3; d = c + a; LDAA $34 ABA (NA) We like Computer likes

Storage - Memory

Working station - CPU

2.1 The 68HC11 Computer Operation Processor Model Memory Model D X Y A SP B PC SXHINZV N B6 C C23A C23B FFFF C239 (P.50)

The Programming Model Some terms A computer is a collection of registers and some other hardware that manipulate numbers and move numbers around among those registers. mnemonic is an abbreviation or symbol designed to make the abbreviation easy to remember. (P51) syntax: in wiki, the arrangement of words and phrases to create well-formed sentences in a language. Format (grammar) of command. instruction: command to create an operation (in assembly level). (P.50)

The Programming Model D (16 bits) X Y A (8 bits) SP B (8 bits) PC 8-bit accumulators A & B 16-bit accumulator D Index Register X Index Register Y Stack Pointer Program Counter Condition Code Register SXHINZV C (P.50) Figure 2-1 Motorola 68HC11 programming model.

An Instruction Format B6 C Figure 2-2 Memory model. C23A C23B FFFF C239 (P.51)

An Instruction Format (another example) FF D3 11 B6 C Another Example of Memory model. FFFF NA

B6 C C100 Figure 2-3 Example of an instruction code – Load Accumulator A. C102 C200 C101 Op code of LDAA Operand: value or address of data (it’s address in this instruction) Data number (P.52)

The Microprocessor Model Accumulators. A general-purpose register in a microprocessor that holds a data number. the data is created by an instruction Program Counter. The microprocessor register that holds the address of the next instruction to be fetched from memory. Instruction register. The register in the microprocessor that holds an instruction code number as it is fetched from memory. (P.52)

The Microprocessor Model PC IR A B Figure 2-4 The Microprocessor model. (P.53)

B6 C C100 Figure 2-5 Programming model with an instruction in memory. C102 C200 C101LDAA (P.54) C IR A B PC

Instruction fetch B6 C C100 Figure 2-6 Beginning of the fetch phase of an instruction. C102 C200 C101LDAA C IR A B PC (P.55)

B6 C C100 Figure 2-7 First byte of instruction has been fetched. C102 C200 C101LDAA C100 B IR A B PC (P.50)

B6 C C100 Figure 2-8 The second byte of the instruction has been fetched. C102 C200 C101LDAA C101 B IR A B PC (P.56)

B6 C C100 Figure 2-9 The second byte of the instruction has been fetched. C102 C200 C101LDAA C101 B6C IR A B PC (P.56)

B6 C C100 Figure 2-10 The program counter has been incremented after the second clock tick. C102 C200 C101LDAA C102 B6C IR A B PC (P.57)

B6 C C100 Figure 2-11 The third byte of the instruction has been fetched. C102 C200 C101LDAA C102 B6C IR A B PC (P.57)

B6 C C100 Figure 2-12 The fetch operation is complete after the third clock tick. C102 C200 C101LDAA C103 B6C IR A B PC (P.58)

B6 C C100 Figure 2-13 The data number has been put into the accumulator. C102 C200 C101LDAA C103 B6C IR A B PC (P.59)

B6 C C100 Figure 2-14 At the completion of LDAA instruction after four clock ticks. C102 C200 C101LDAA C103 B6C IR A B PC (P.59)

Instruction set table Source FormOperationBoolean Expression Machine Code Bytes Op CodeOperand ADDA Add Memory to A A + M  A BBhh ll3 LDAA Load Accumulator A M  A B6hh ll3 STAA Store Accumulator A A  M B7Hh ll3 STOP Stop program in trainer 3F 1 (P.60-61) Operation: description Boolean Expression: logical expression Machine Code Op Code Machine Code Operand Bytes The table on page 13 in Motorola 68HC11 manual.

Machine Language: the binary numbers that form a program in the memory of the computer are called machine language. Program loading: put the instructions numbers and data numbers into the memory.

Use manual to work on this type of problems B6 C2 0B BB C2 0C B7 C2 C200 C202 C206 C201 LDAA 0D 3F FF ADDA (P.63) Figure 2-16 The first machine language program. (At very beginning, hasn’t fetched yet.) STAA STOP N1 N2 N3 instructions data C203 C205 C204 C207 C209 C208 C20A C20C C20B C20D C20F C20E C210 C200 FF A B PC FF here are some arbitrary data generated from previous instructions

B6 C2 0B BB C2 0C B7 C2 C200 C202 C206 C201 LDAA 0D 3F FF ADDA (P.64) Figure 2-17 Machine Language program – one instruction executed STAA STOP N1 N2 N3 instructions labels C203 C205 C204 C207 C209 C208 C20A C20C C20B C20D C20F C20E C210 C FF A B PC

B6 C2 0B BB C2 0C B7 C2 C200 C202 C206 C201 LDAA 0D 3F FF ADDA (P.64) Figure 2-18 Machine Language program – two instructions executed STAA STOP N1 N2 N3 instructions labels C203 C205 C204 C207 C209 C208 C20A C20C C20B C20D C20F C20E C210 C206 2B FF A B PC

B6 C2 0B BB C2 0C B7 C2 C200 C202 C206 C201 LDAA 0D 3F B ADDA (P.65) Figure 2-19 Machine Language program – three instructions executed STAA STOP N1 N2 SUM instructions labels C203 C205 C204 C207 C209 C208 C20A C20C C20B C20D C20F C20E C210 C209 2B FF A B PC