1 Classical Universal Computer 3
|
|
- Virginia Powers
- 8 years ago
- Views:
Transcription
1 Chapter 6: Machine Language and Assembler Christian Jacob 1 Classical Universal Computer Von Neumann Architecture CPU and RAM Arithmetic Logical Unit (ALU) Arithmetic Logical Unit (ALU) 7 2 Machine Language Hypothetical Machine Machine Language Execution of Machine Programs 15 3 Assembler Language Structure of Assembler Commands From Assembler to Machine Code Operand Addressing Stack Symbolic Names 29 TOC 1 Back
2 Chapter 6: Machine Language and Assembler Christian Jacob 4 Programming in Assembler Alternatives Loops Sub-routines Macros Registers 41 TOC 2 Back
3 Classical Universal Computer Chapter 6: Machine Language and Assembler Christian Jacob 1 Classical Universal Computer 1.1 Von Neumann Architecture Control Unit Input Unit Memory Output Unit ALU Burks, Goldstine, von Neumann (Princeton, 1946/47) First Back TOC 3 Prev Next Last
4 Classical Universal Computer Chapter 6: Machine Language and Assembler Christian Jacob Von Neumann Architecture The computer architecture is problem-independent. --> Universal Computer: - Arithmetic Logical Unit - Memory - Control Unit - Input / Output Unit Program and data both reside in memory. Each memory location has an address, through which its contents can be accessed. In general, program commands are stored in consecutive memory locations. There are jump commands. There are conditional jumps. The binary number system is used. First Back TOC 4 Prev Next Last
5 Classical Universal Computer Chapter 6: Machine Language and Assembler Christian Jacob 1.2 CPU and RAM RAM Random Access Memory RAM contains data and instructions (programs) how to process the data Data bus transports data from RAM to the CPU for processing Data bus transports the processed data to RAM, so it can be displayed, output, or stored on disk CPU Central Processing Unit The CPU processes data First Back TOC 5 Prev Next Last
6 Classical Universal Computer Chapter 6: Machine Language and Assembler Christian Jacob 1.3 Arithmetic Logical Unit (ALU) Data RAM Result ALU Register 1 Register 2 Control Unit op Accumulator First Back TOC 6 Prev Next Last
7 Classical Universal Computer Chapter 6: Machine Language and Assembler Christian Jacob 1.4 Arithmetic Logical Unit (ALU) Data RAM Result ALU Register 1 Register Control Unit Addition + 9 Accumulator First Back TOC 7 Prev Next Last
8 Classical Universal Computer Chapter 6: Machine Language and Assembler Christian Jacob ALU / RAM Performance: 1. The data to be processed arrives from RAM and is held in registers. 2. A signal from the Control Unit indicates which arithmetic or logical operation to perform. 3. The ALU performs the operation and places the result in the accumulator. 4. The results are usually sent to RAM so that they can be output or stored on disk. First Back TOC 8 Prev Next Last
9 Classical Universal Computer Chapter 6: Machine Language and Assembler Christian Jacob A more detailed look at a von Neumann architecture machine Control Unit Memory Unit Arithmetic Logical Unit I/O Unit Command IP ALU Unit MR MSR MR OP AP LC IOR OD Memory ACC QR OC RAM Feedback / Control Signals OP: operator part OC: operation control LC: logical circuits AP: address part MR: memory register ACC: accumulator IP: instruction pointer MSR: memory selection reg. QR: quotient register OD: operator decoding MR: multiplier register IOR: input/output reg. First Back TOC 9 Prev Next Last
10 Machine Language Chapter 6: Machine Language and Assembler Christian Jacob 2 Machine Language Elementary operations: - data transfer - program control - arithmetic and logic operations - move operations - interrupt handling Binary command representation regular structure of all the commands First Back TOC 10 Prev Next Last
11 Machine Language Chapter 6: Machine Language and Assembler Christian Jacob command formats: - 1-address command Operation Address of Operand 2-2-address command Operation Address of Operand 1 & Result Address of Operand 2-3-address command Operation Address of Operand 1 Address of Operand 2 Address of Result First Back TOC 11 Prev Next Last
12 Machine Language Chapter 6: Machine Language and Assembler Christian Jacob 2.1 Hypothetical Machine Word length: 16 bit Structure of a memory cell (1-address command) Op Code D Mod Address / Value Op Code: command code for an operation D: label for a double word Mod: Address/value: modification part (using index registers) contains address or value of the operand First Back TOC 12 Prev Next Last
13 Machine Language Chapter 6: Machine Language and Assembler Christian Jacob 2.2 Machine Language Opcode dual hex. Description of the Operation Mnemo Halt. End of program execution HLT Load operand to accumulator LOA Store accumulator at designated address STI Add operand to accumulator ADD Subtract operand from accumulator SUB Multiply operand with accumulator MUL Divide accumulator by operand DIV Unconditional jump JMP Jump if accumulator = 0 JEZ Jump if accumulator > 0 JGZ 1010 A Jump if accumulator < 0 JLZ 1100 C Stack commands D Jump to subroutine JSR 1110 E Return from subroutine RET 1111 F Index commands - First Back TOC 13 Prev Next Last
14 Machine Language Chapter 6: Machine Language and Assembler Christian Jacob Example: The word in a memory cell can be decimal number: command: : add operand to accumulator - 0: one word command - 100: constant operand ( immediate operand ) : > Add 157 to the contents of the accumulator. First Back TOC 14 Prev Next Last
15 Machine Language Chapter 6: Machine Language and Assembler Christian Jacob 2.3 Execution of Machine Programs Load jump address Instruction Pointer Program address 1 Load data address Fetch opcode and mod Increment instruction pointer Memory Addressing Control Unit RAM ALU Accu 4 Load constant Load/store data Load instruction 2 Address / Operator Constant Instruction Register First Back TOC 15 Prev Next Last
16 Assembler Language Chapter 6: Machine Language and Assembler Christian Jacob 3 Assembler Language Disadvantages of machine language: - Binary / hexadecimal representation of operations and operands - Use of fixed addresses - No commentary Assembler - Mnemo-technical names of operations - Various number systems - Commentaries - Macros Example machine language: assembler: ADD, #157 First Back TOC 16 Prev Next Last
17 Assembler Language Chapter 6: Machine Language and Assembler Christian Jacob 3.1 Structure of Assembler Commands Label - characterizes an assembler command - jump commands can use this label as destination - usually a string consisting of 4 to 8 letters - is not inserted into the (generated) machine code Operation - mnemo-technical representation of the Op-code Operand(s) - contains the operands of the assembler command (value of the operand or an address) - (constant) expressions may be allowed Register field - for machines with 2-address commands: reference to a register which contains one of the operands First Back TOC 17 Prev Next Last
18 Assembler Language Chapter 6: Machine Language and Assembler Christian Jacob Index field - refers to the register, the contents of which is to be added to the operand address. Commentary - remarks and comments on the program text - not inserted into the (generated) machine code Formating of assembler code fixed structure, column-oriented or fields separated by special characters (example: labels by :, comments by ; ) or field separators (tabs, space, ) First Back TOC 18 Prev Next Last
19 Assembler Language Chapter 6: Machine Language and Assembler Christian Jacob 3.2 From Assembler to Machine Code Assembler: label operator operand register field commentary index register Machine code: operator mod operand(s) First Back TOC 19 Prev Next Last
20 Assembler Language Chapter 6: Machine Language and Assembler Christian Jacob 3.3 Operand Addressing Effective address = address generated by interpreting (or by address calculation) or the modification field Immediate operand commands - the address field contains the operand as a constant - labelled by # - machine code: Mod = bit (24 bit for 2-word commands) --> integer numbers between -128 and Example: ADD, #26 ; add 26 to accumulator Accumulator x Accumulator x+26 First Back TOC 20 Prev Next Last
21 Assembler Language Chapter 6: Machine Language and Assembler Christian Jacob Direct address - effective address = contents of address field - labelled - machine code: Mod = 0 - bits 8 and 9 (Mod) are used as additional address bits --> 2 10 = 1024 memory cells are directly addressable - Example: ; store accu at address 649 Accumulator RAM First Back TOC 21 Prev Next Last
22 Assembler Language Chapter 6: Machine Language and Assembler Christian Jacob Relative addressing - effective address = command address + address field --> the program is relocatable in memory without any recalculation of the addresses - no labelling - machine code: Mod = Example: ADD, 148 ; add value at relative address 148 Accumulator x+123 RAM 100 ADD, First Back TOC 22 Prev Next Last
23 Assembler Language Chapter 6: Machine Language and Assembler Christian Jacob Indirect addressing - effective address = value at the address given in the address field - labelled by (...) - machine code: Mod = Example: STI, (148) ; indirect addressing Accumulator RAM First Back TOC 23 Prev Next Last
24 Assembler Language Chapter 6: Machine Language and Assembler Christian Jacob Index register addressing - effective address = address field + contents of index register --> Without any program changes, all effective addresses can be changed by modifying the contents of the index register. - labelled by % - machine code: Mod = Example: LOA, %128 ; use index register Accumulator 123 Index Register RAM First Back TOC 24 Prev Next Last
25 Assembler Language Chapter 6: Machine Language and Assembler Christian Jacob - special index register commands: Opcode Mod Ass. Description CLI Load 0 to index register LDI Load accu into index register LIA Load index register into accu INC Increment index register by DEC Decrement index register by LDX Load operand into index register. First Back TOC 25 Prev Next Last
26 Assembler Language Chapter 6: Machine Language and Assembler Christian Jacob Example: Programming with an index register ; load index register with contents ; of memory cell 1030 LOA, #15 ; load 15 to accumulator ADD, %3 ; add the contents of memory cell ; 3+index register to the accu STI, (1031) ; store the result at the address ; contained in memory cell 1031 HLT ; end of program Step Index reg. Accu Memory : : : : 32 First Back TOC 26 Prev Next Last
27 Assembler Language Chapter 6: Machine Language and Assembler Christian Jacob 3.4 Stack LIFO principle (Last In, First Out) Push A Push B Push C Pop Pop Pop C B B B A A A A A For binary operations: - first operand is the second element from the top of stack - second operand is the top of stack element - the operation result replaces the two top-most stack elements First Back TOC 27 Prev Next Last
28 Assembler Language Chapter 6: Machine Language and Assembler Christian Jacob Stack Commands: Opcode Mod Ass. Description PUSHAC Load accumulator to stack POPAC Load top stack element to accumulator and remove from stack ADDST Addition SUBST Subtraction MULST Multiplication DIVST Division PUSH Load operand to stack POP Store top stack element at designated address and remove from stack First Back TOC 28 Prev Next Last
29 Assembler Language Chapter 6: Machine Language and Assembler Christian Jacob 3.5 Symbolic Names Symbolic names can be associated with an address: Value The name is associated to a numerical value. Example: NUMB EQUIVALENT Labels Labels are symbolic names associated to an assembler command. Example: START: LOA, #5 First Back TOC 29 Prev Next Last
30 Assembler Language Chapter 6: Machine Language and Assembler Christian Jacob Data definitions and memory allocation Example: MUL, #2 HLT CONST: DATA, #300; memory cell initialized ; with a value of 300 ARRAY: BLOCK,20 ; array of 20 memory cells First Back TOC 30 Prev Next Last
31 Programming in Assembler Chapter 6: Machine Language and Assembler Christian Jacob 4 Programming in Assembler 4.1 Alternatives if ( <condition> ) <command A> else <command B> Example: if ( x < y ) A else B Assembler: ; accu = x ; accu = x-y ; x-y < 0? <B> LABELA: <A> CONTINUE: First Back TOC 31 Prev Next Last
32 Programming in Assembler Chapter 6: Machine Language and Assembler Christian Jacob 4.2 Loops Example: C++: do { x = 4*a; a = a+k; } while ( a <= endvalue ); First Back TOC 32 Prev Next Last
33 Programming in Assembler Chapter 6: Machine Language and Assembler Christian Jacob Assembler: LOOP: LOA, #4 ; accu = 4 ; accu = 4*a ; x = 4*a ; accu = a ; accu = a+k ; a = a+k accu = a-endvalue ; a < endvalue? ; a = endvalue? do { x = 4*a; a = a+k; } while ( a <= endvalue ); First Back TOC 33 Prev Next Last
34 Programming in Assembler Chapter 6: Machine Language and Assembler Christian Jacob 4.3 Sub-routines main program... call of subroutine JSR... end of program RET sub routine... return to main Two Problems: Where to store the return address? Passing of parameters and return of results First Back TOC 34 Prev Next Last
35 Programming in Assembler Chapter 6: Machine Language and Assembler Christian Jacob Return Addresses: - store in memory cell before or after the subroutine code - use a stack First Back TOC 35 Prev Next Last
36 Programming in Assembler Chapter 6: Machine Language and Assembler Christian Jacob 1000 Using a stack for storing return addresses main program call of A... sub routine A... call of B... return sub routine B... call of C Command Instruction Pointer Stack Start main program Call subroutine A Jump to subroutine A Call subroutine B Jump to subroutine B Return from subroutine B Continue in subroutine A Return from subroutine B Continue in main program return Note: Intermediate commands not related to subroutine calls are not listed in this table. First Back TOC 36 Prev Next Last
37 Programming in Assembler Chapter 6: Machine Language and Assembler Christian Jacob Passing of Parameters and Return of Subroutine Results Parameter passing using the accumulator or another register --> number of parameters is limited Store parameters at specific memory addresses and reading in from within the subroutine --> complex memory management, hard to keep up with used memory space Use memory section prior to the subroutine --> enables relative addressing of the parameters within the subroutine Use memory section after the subroutine --> enables relative addressing, too Parameter passing using a stack First Back TOC 37 Prev Next Last
38 Programming in Assembler Chapter 6: Machine Language and Assembler Christian Jacob Parameter Passing Using a Stack ; Main program PUSH, #7 ; return address UP1: ; subroutine ; subroutine calc. RET First Back TOC 38 Prev Next Last
39 Programming in Assembler Chapter 6: Machine Language and Assembler Christian Jacob 4.4 Macros Macros perform textual substitutions Macros are expanded before the assembler is started Program Text Macro Generator Assembler Commands Assembler Program in Machine Code Example: MACRO, sum ; macro head ; macro body MACROEND First Back TOC 39 Prev Next Last
40 Programming in Assembler Chapter 6: Machine Language and Assembler Christian Jacob Application of the macro sum: LOA, #1024 sum LOA, # First Back TOC 40 Prev Next Last
41 Programming in Assembler Chapter 6: Machine Language and Assembler Christian Jacob 4.5 Registers Today s computers have many more registers --> The assembler must be able to address these registers. Extension of assembler language: Example: LOA, First Back TOC 41 Prev Next Last
MICROPROCESSOR AND MICROCOMPUTER BASICS
Introduction MICROPROCESSOR AND MICROCOMPUTER BASICS At present there are many types and sizes of computers available. These computers are designed and constructed based on digital and Integrated Circuit
More informationAdvanced Computer Architecture-CS501. Computer Systems Design and Architecture 2.1, 2.2, 3.2
Lecture Handout Computer Architecture Lecture No. 2 Reading Material Vincent P. Heuring&Harry F. Jordan Chapter 2,Chapter3 Computer Systems Design and Architecture 2.1, 2.2, 3.2 Summary 1) A taxonomy of
More informationCentral Processing Unit (CPU)
Central Processing Unit (CPU) CPU is the heart and brain It interprets and executes machine level instructions Controls data transfer from/to Main Memory (MM) and CPU Detects any errors In the following
More informationCHAPTER 7: The CPU and Memory
CHAPTER 7: The CPU and Memory The Architecture of Computer Hardware, Systems Software & Networking: An Information Technology Approach 4th Edition, Irv Englander John Wiley and Sons 2010 PowerPoint slides
More informationAdministrative Issues
CSC 3210 Computer Organization and Programming Introduction and Overview Dr. Anu Bourgeois (modified by Yuan Long) Administrative Issues Required Prerequisites CSc 2010 Intro to CSc CSc 2310 Java Programming
More informationInstruction Set Architecture (ISA)
Instruction Set Architecture (ISA) * Instruction set architecture of a machine fills the semantic gap between the user and the machine. * ISA serves as the starting point for the design of a new machine
More informationMACHINE ARCHITECTURE & LANGUAGE
in the name of God the compassionate, the merciful notes on MACHINE ARCHITECTURE & LANGUAGE compiled by Jumong Chap. 9 Microprocessor Fundamentals A system designer should consider a microprocessor-based
More informationNotes on Assembly Language
Notes on Assembly Language Brief introduction to assembly programming The main components of a computer that take part in the execution of a program written in assembly code are the following: A set of
More informationCPU Organisation and Operation
CPU Organisation and Operation The Fetch-Execute Cycle The operation of the CPU 1 is usually described in terms of the Fetch-Execute cycle. 2 Fetch-Execute Cycle Fetch the Instruction Increment the Program
More information(Refer Slide Time: 00:01:16 min)
Digital Computer Organization Prof. P. K. Biswas Department of Electronic & Electrical Communication Engineering Indian Institute of Technology, Kharagpur Lecture No. # 04 CPU Design: Tirning & Control
More informationCPU Organization and Assembly Language
COS 140 Foundations of Computer Science School of Computing and Information Science University of Maine October 2, 2015 Outline 1 2 3 4 5 6 7 8 Homework and announcements Reading: Chapter 12 Homework:
More informationLecture 3 Addressing Modes, Instruction Samples, Machine Code, Instruction Execution Cycle
Lecture 3 Addressing Modes, Instruction Samples, Machine Code, Instruction Execution Cycle Contents 3.1. Register Transfer Notation... 2 3.2. HCS12 Addressing Modes... 2 1. Inherent Mode (INH)... 2 2.
More informationSummary of the MARIE Assembly Language
Supplement for Assignment # (sections.8 -. of the textbook) Summary of the MARIE Assembly Language Type of Instructions Arithmetic Data Transfer I/O Branch Subroutine call and return Mnemonic ADD X SUBT
More informationInstruction Set Architecture. or How to talk to computers if you aren t in Star Trek
Instruction Set Architecture or How to talk to computers if you aren t in Star Trek The Instruction Set Architecture Application Compiler Instr. Set Proc. Operating System I/O system Instruction Set Architecture
More informationa storage location directly on the CPU, used for temporary storage of small amounts of data during processing.
CS143 Handout 18 Summer 2008 30 July, 2008 Processor Architectures Handout written by Maggie Johnson and revised by Julie Zelenski. Architecture Vocabulary Let s review a few relevant hardware definitions:
More information8085 INSTRUCTION SET
DATA TRANSFER INSTRUCTIONS Opcode Operand Description 8085 INSTRUCTION SET INSTRUCTION DETAILS Copy from source to destination OV Rd, Rs This instruction copies the contents of the source, Rs register
More informationMICROPROCESSOR. Exclusive for IACE Students www.iace.co.in iacehyd.blogspot.in Ph: 9700077455/422 Page 1
MICROPROCESSOR A microprocessor incorporates the functions of a computer s central processing unit (CPU) on a single Integrated (IC), or at most a few integrated circuit. It is a multipurpose, programmable
More informationPART B QUESTIONS AND ANSWERS UNIT I
PART B QUESTIONS AND ANSWERS UNIT I 1. Explain the architecture of 8085 microprocessor? Logic pin out of 8085 microprocessor Address bus: unidirectional bus, used as high order bus Data bus: bi-directional
More informationA single register, called the accumulator, stores the. operand before the operation, and stores the result. Add y # add y from memory to the acc
Other architectures Example. Accumulator-based machines A single register, called the accumulator, stores the operand before the operation, and stores the result after the operation. Load x # into acc
More informationCS101 Lecture 26: Low Level Programming. John Magee 30 July 2013 Some material copyright Jones and Bartlett. Overview/Questions
CS101 Lecture 26: Low Level Programming John Magee 30 July 2013 Some material copyright Jones and Bartlett 1 Overview/Questions What did we do last time? How can we control the computer s circuits? How
More informationZ80 Instruction Set. Z80 Assembly Language
75 Z80 Assembly Language The assembly language allows the user to write a program without concern for memory addresses or machine instruction formats. It uses symbolic addresses to identify memory locations
More informationOAMulator. Online One Address Machine emulator and OAMPL compiler. http://myspiders.biz.uiowa.edu/~fil/oam/
OAMulator Online One Address Machine emulator and OAMPL compiler http://myspiders.biz.uiowa.edu/~fil/oam/ OAMulator educational goals OAM emulator concepts Von Neumann architecture Registers, ALU, controller
More informationUNIVERSITY OF CALIFORNIA, DAVIS Department of Electrical and Computer Engineering. EEC180B Lab 7: MISP Processor Design Spring 1995
UNIVERSITY OF CALIFORNIA, DAVIS Department of Electrical and Computer Engineering EEC180B Lab 7: MISP Processor Design Spring 1995 Objective: In this lab, you will complete the design of the MISP processor,
More informationInstruction Set Architecture
Instruction Set Architecture Consider x := y+z. (x, y, z are memory variables) 1-address instructions 2-address instructions LOAD y (r :=y) ADD y,z (y := y+z) ADD z (r:=r+z) MOVE x,y (x := y) STORE x (x:=r)
More informationPROBLEMS (Cap. 4 - Istruzioni macchina)
98 CHAPTER 2 MACHINE INSTRUCTIONS AND PROGRAMS PROBLEMS (Cap. 4 - Istruzioni macchina) 2.1 Represent the decimal values 5, 2, 14, 10, 26, 19, 51, and 43, as signed, 7-bit numbers in the following binary
More informationComputer Architecture Lecture 2: Instruction Set Principles (Appendix A) Chih Wei Liu 劉 志 尉 National Chiao Tung University cwliu@twins.ee.nctu.edu.
Computer Architecture Lecture 2: Instruction Set Principles (Appendix A) Chih Wei Liu 劉 志 尉 National Chiao Tung University cwliu@twins.ee.nctu.edu.tw Review Computers in mid 50 s Hardware was expensive
More informationEmbedded Systems. Review of ANSI C Topics. A Review of ANSI C and Considerations for Embedded C Programming. Basic features of C
Embedded Systems A Review of ANSI C and Considerations for Embedded C Programming Dr. Jeff Jackson Lecture 2-1 Review of ANSI C Topics Basic features of C C fundamentals Basic data types Expressions Selection
More informationComputer organization
Computer organization Computer design an application of digital logic design procedures Computer = processing unit + memory system Processing unit = control + datapath Control = finite state machine inputs
More informationInstruction Set Design
Instruction Set Design Instruction Set Architecture: to what purpose? ISA provides the level of abstraction between the software and the hardware One of the most important abstraction in CS It s narrow,
More informationİSTANBUL AYDIN UNIVERSITY
İSTANBUL AYDIN UNIVERSITY FACULTY OF ENGİNEERİNG SOFTWARE ENGINEERING THE PROJECT OF THE INSTRUCTION SET COMPUTER ORGANIZATION GÖZDE ARAS B1205.090015 Instructor: Prof. Dr. HASAN HÜSEYİN BALIK DECEMBER
More informationComputer Organization and Architecture
Computer Organization and Architecture Chapter 11 Instruction Sets: Addressing Modes and Formats Instruction Set Design One goal of instruction set design is to minimize instruction length Another goal
More informationCHAPTER 4 MARIE: An Introduction to a Simple Computer
CHAPTER 4 MARIE: An Introduction to a Simple Computer 4.1 Introduction 195 4.2 CPU Basics and Organization 195 4.2.1 The Registers 196 4.2.2 The ALU 197 4.2.3 The Control Unit 197 4.3 The Bus 197 4.4 Clocks
More informationCompilers I - Chapter 4: Generating Better Code
Compilers I - Chapter 4: Generating Better Code Lecturers: Paul Kelly (phjk@doc.ic.ac.uk) Office: room 304, William Penney Building Naranker Dulay (nd@doc.ic.ac.uk) Materials: Office: room 562 Textbook
More informationCentral Processing Unit Simulation Version v2.5 (July 2005) Charles André University Nice-Sophia Antipolis
Central Processing Unit Simulation Version v2.5 (July 2005) Charles André University Nice-Sophia Antipolis 1 1 Table of Contents 1 Table of Contents... 3 2 Overview... 5 3 Installation... 7 4 The CPU
More informationChapter 7D The Java Virtual Machine
This sub chapter discusses another architecture, that of the JVM (Java Virtual Machine). In general, a VM (Virtual Machine) is a hypothetical machine (implemented in either hardware or software) that directly
More informationwhat operations can it perform? how does it perform them? on what kind of data? where are instructions and data stored?
Inside the CPU how does the CPU work? what operations can it perform? how does it perform them? on what kind of data? where are instructions and data stored? some short, boring programs to illustrate the
More informationChapter 01: Introduction. Lesson 02 Evolution of Computers Part 2 First generation Computers
Chapter 01: Introduction Lesson 02 Evolution of Computers Part 2 First generation Computers Objective Understand how electronic computers evolved during the first generation of computers First Generation
More informationA3 Computer Architecture
A3 Computer Architecture Engineering Science 3rd year A3 Lectures Prof David Murray david.murray@eng.ox.ac.uk www.robots.ox.ac.uk/ dwm/courses/3co Michaelmas 2000 1 / 1 6. Stacks, Subroutines, and Memory
More information1. Convert the following base 10 numbers into 8-bit 2 s complement notation 0, -1, -12
C5 Solutions 1. Convert the following base 10 numbers into 8-bit 2 s complement notation 0, -1, -12 To Compute 0 0 = 00000000 To Compute 1 Step 1. Convert 1 to binary 00000001 Step 2. Flip the bits 11111110
More informationEC 362 Problem Set #2
EC 362 Problem Set #2 1) Using Single Precision IEEE 754, what is FF28 0000? 2) Suppose the fraction enhanced of a processor is 40% and the speedup of the enhancement was tenfold. What is the overall speedup?
More informationMicrocontroller Basics A microcontroller is a small, low-cost computer-on-a-chip which usually includes:
Microcontroller Basics A microcontroller is a small, low-cost computer-on-a-chip which usually includes: An 8 or 16 bit microprocessor (CPU). A small amount of RAM. Programmable ROM and/or flash memory.
More information2) Write in detail the issues in the design of code generator.
COMPUTER SCIENCE AND ENGINEERING VI SEM CSE Principles of Compiler Design Unit-IV Question and answers UNIT IV CODE GENERATION 9 Issues in the design of code generator The target machine Runtime Storage
More informationHigh level code and machine code
High level code and machine code Teacher s Notes Lesson Plan x Length 60 mins Specification Link 2.1.7/cde Programming languages Learning objective Students should be able to (a) explain the difference
More information150127-Microprocessor & Assembly Language
Chapter 3 Z80 Microprocessor Architecture The Z 80 is one of the most talented 8 bit microprocessors, and many microprocessor-based systems are designed around the Z80. The Z80 microprocessor needs an
More informationMachine Architecture and Number Systems. Major Computer Components. Schematic Diagram of a Computer. The CPU. The Bus. Main Memory.
1 Topics Machine Architecture and Number Systems Major Computer Components Bits, Bytes, and Words The Decimal Number System The Binary Number System Converting from Decimal to Binary Major Computer Components
More informationChapter 2 Topics. 2.1 Classification of Computers & Instructions 2.2 Classes of Instruction Sets 2.3 Informal Description of Simple RISC Computer, SRC
Chapter 2 Topics 2.1 Classification of Computers & Instructions 2.2 Classes of Instruction Sets 2.3 Informal Description of Simple RISC Computer, SRC See Appendix C for Assembly language information. 2.4
More informationHow It All Works. Other M68000 Updates. Basic Control Signals. Basic Control Signals
CPU Architectures Motorola 68000 Several CPU architectures exist currently: Motorola Intel AMD (Advanced Micro Devices) PowerPC Pick one to study; others will be variations on this. Arbitrary pick: Motorola
More information1 Description of The Simpletron
Simulating The Simpletron Computer 50 points 1 Description of The Simpletron In this assignment you will write a program to simulate a fictional computer that we will call the Simpletron. As its name implies
More informationMICROPROCESSOR BCA IV Sem MULTIPLE CHOICE QUESTIONS
MICROPROCESSOR BCA IV Sem MULTIPLE CHOICE QUESTIONS 1) Which is the microprocessor comprises: a. Register section b. One or more ALU c. Control unit 2) What is the store by register? a. data b. operands
More informationChapter 2 Basic Structure of Computers. Jin-Fu Li Department of Electrical Engineering National Central University Jungli, Taiwan
Chapter 2 Basic Structure of Computers Jin-Fu Li Department of Electrical Engineering National Central University Jungli, Taiwan Outline Functional Units Basic Operational Concepts Bus Structures Software
More informationChapter 5 Instructor's Manual
The Essentials of Computer Organization and Architecture Linda Null and Julia Lobur Jones and Bartlett Publishers, 2003 Chapter 5 Instructor's Manual Chapter Objectives Chapter 5, A Closer Look at Instruction
More informationThe previous chapter provided a definition of the semantics of a programming
Chapter 7 TRANSLATIONAL SEMANTICS The previous chapter provided a definition of the semantics of a programming language in terms of the programming language itself. The primary example was based on a Lisp
More informationBASIC COMPUTER ORGANIZATION AND DESIGN
1 BASIC COMPUTER ORGANIZATION AND DESIGN Instruction Codes Computer Registers Computer Instructions Timing and Control Instruction Cycle Memory Reference Instructions Input-Output and Interrupt Complete
More information2011, The McGraw-Hill Companies, Inc. Chapter 3
Chapter 3 3.1 Decimal System The radix or base of a number system determines the total number of different symbols or digits used by that system. The decimal system has a base of 10 with the digits 0 through
More informationEE282 Computer Architecture and Organization Midterm Exam February 13, 2001. (Total Time = 120 minutes, Total Points = 100)
EE282 Computer Architecture and Organization Midterm Exam February 13, 2001 (Total Time = 120 minutes, Total Points = 100) Name: (please print) Wolfe - Solution In recognition of and in the spirit of the
More informationM6800. Assembly Language Programming
M6800 Assembly Language Programming 1 3. MC6802 MICROPROCESSOR MC6802 microprocessor runs in 1MHz clock cycle. It has 64 Kbyte memory address capacity using 16-bit addressing path (A0-A15). The 8-bit data
More informationChapter 4 Register Transfer and Microoperations. Section 4.1 Register Transfer Language
Chapter 4 Register Transfer and Microoperations Section 4.1 Register Transfer Language Digital systems are composed of modules that are constructed from digital components, such as registers, decoders,
More informationComputer Science 281 Binary and Hexadecimal Review
Computer Science 281 Binary and Hexadecimal Review 1 The Binary Number System Computers store everything, both instructions and data, by using many, many transistors, each of which can be in one of two
More informationMACHINE INSTRUCTIONS AND PROGRAMS
CHAPTER 2 MACHINE INSTRUCTIONS AND PROGRAMS CHAPTER OBJECTIVES In this chapter you will learn about: Machine instructions and program execution, including branching and subroutine call and return operations
More informationLC-3 Assembly Language
LC-3 Assembly Language Programming and tips Textbook Chapter 7 CMPE12 Summer 2008 Assembly and Assembler Machine language - binary Assembly language - symbolic 0001110010000110 An assembler is a program
More informationLSN 2 Computer Processors
LSN 2 Computer Processors Department of Engineering Technology LSN 2 Computer Processors Microprocessors Design Instruction set Processor organization Processor performance Bandwidth Clock speed LSN 2
More informationLABORATORY MANUAL EE0310 MICROPROCESSOR & MICROCONTROLLER LAB
LABORATORY MANUAL EE0310 MICROPROCESSOR & MICROCONTROLLER LAB DEPARTMENT OF ELECTRICAL & ELECTRONICS ENGINEERING FACULTY OF ENGINEERING & TECHNOLOGY SRM UNIVERSITY, Kattankulathur 603 203 1 LIST OF EXEPRIMENTS
More informationASSEMBLY PROGRAMMING ON A VIRTUAL COMPUTER
ASSEMBLY PROGRAMMING ON A VIRTUAL COMPUTER Pierre A. von Kaenel Mathematics and Computer Science Department Skidmore College Saratoga Springs, NY 12866 (518) 580-5292 pvonk@skidmore.edu ABSTRACT This paper
More informationCOMPUTERS ORGANIZATION 2ND YEAR COMPUTE SCIENCE MANAGEMENT ENGINEERING JOSÉ GARCÍA RODRÍGUEZ JOSÉ ANTONIO SERRA PÉREZ
COMPUTERS ORGANIZATION 2ND YEAR COMPUTE SCIENCE MANAGEMENT ENGINEERING UNIT 1 - INTRODUCTION JOSÉ GARCÍA RODRÍGUEZ JOSÉ ANTONIO SERRA PÉREZ Unit 1.MaNoTaS 1 Definitions (I) Description A computer is: A
More informationBCD (ASCII) Arithmetic. Where and Why is BCD used? Packed BCD, ASCII, Unpacked BCD. BCD Adjustment Instructions AAA. Example
BCD (ASCII) Arithmetic We will first look at unpacked BCD which means strings that look like '4567'. Bytes then look like 34h 35h 36h 37h OR: 04h 05h 06h 07h x86 processors also have instructions for packed
More informationAn Introduction to Assembly Programming with the ARM 32-bit Processor Family
An Introduction to Assembly Programming with the ARM 32-bit Processor Family G. Agosta Politecnico di Milano December 3, 2011 Contents 1 Introduction 1 1.1 Prerequisites............................. 2
More informationSystems I: Computer Organization and Architecture
Systems I: Computer Organization and Architecture Lecture : Microprogrammed Control Microprogramming The control unit is responsible for initiating the sequence of microoperations that comprise instructions.
More informationCPU Sim 3.1: A Tool for Simulating Computer Architectures for CS3 classes
CPU Sim 3.1: A Tool for Simulating Computer Architectures for CS3 classes DALE SKRIEN Colby College CPU Sim 3.1 is an educational software package written in Java for use in CS3 courses. CPU Sim provides
More informationZ80 Microprocessors Z80 CPU. User Manual UM008006-0714. Copyright 2014 Zilog, Inc. All rights reserved. www.zilog.com
Z80 Microprocessors Z80 CPU UM008006-0714 Copyright 2014 Zilog, Inc. All rights reserved. www.zilog.com ii Warning: DO NOT USE THIS PRODUCT IN LIFE SUPPORT SYSTEMS. LIFE SUPPORT POLICY ZILOG S PRODUCTS
More informationIntroduction to Microcontrollers
Introduction to Microcontrollers Motorola M68HC11 Specs Assembly Programming Language BUFFALO Topics of Discussion Microcontrollers M68HC11 Package & Pinouts Accumulators Index Registers Special Registers
More informationDEPARTMENT OF COMPUTER SCIENCE & ENGINEERING Question Bank Subject Name: EC6504 - Microprocessor & Microcontroller Year/Sem : II/IV
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING Question Bank Subject Name: EC6504 - Microprocessor & Microcontroller Year/Sem : II/IV UNIT I THE 8086 MICROPROCESSOR 1. What is the purpose of segment registers
More informationHC12 Assembly Language Programming
HC12 Assembly Language Programming Programming Model Addressing Modes Assembler Directives HC12 Instructions Flow Charts 1 Assembler Directives In order to write an assembly language program it is necessary
More informationChapter 2 Assemblers http://www.intel.com/multi-core/demos.htm
Chapter 2 Assemblers http://www.intel.com/multi-core/demos.htm Source Program Assembler Object Code Linker Executable Code Loader 1 Outline 2.1 Basic Assembler Functions A simple SIC assembler Assembler
More information18-447 Computer Architecture Lecture 3: ISA Tradeoffs. Prof. Onur Mutlu Carnegie Mellon University Spring 2013, 1/18/2013
18-447 Computer Architecture Lecture 3: ISA Tradeoffs Prof. Onur Mutlu Carnegie Mellon University Spring 2013, 1/18/2013 Reminder: Homeworks for Next Two Weeks Homework 0 Due next Wednesday (Jan 23), right
More informationChapter 2 Logic Gates and Introduction to Computer Architecture
Chapter 2 Logic Gates and Introduction to Computer Architecture 2.1 Introduction The basic components of an Integrated Circuit (IC) is logic gates which made of transistors, in digital system there are
More informationToday. Binary addition Representing negative numbers. Andrew H. Fagg: Embedded Real- Time Systems: Binary Arithmetic
Today Binary addition Representing negative numbers 2 Binary Addition Consider the following binary numbers: 0 0 1 0 0 1 1 0 0 0 1 0 1 0 1 1 How do we add these numbers? 3 Binary Addition 0 0 1 0 0 1 1
More information8051 MICROCONTROLLER COURSE
8051 MICROCONTROLLER COURSE Objective: 1. Familiarization with different types of Microcontroller 2. To know 8051 microcontroller in detail 3. Programming and Interfacing 8051 microcontroller Prerequisites:
More informationComp 255Q - 1M: Computer Organization Lab #3 - Machine Language Programs for the PDP-8
Comp 255Q - 1M: Computer Organization Lab #3 - Machine Language Programs for the PDP-8 January 22, 2013 Name: Grade /10 Introduction: In this lab you will write, test, and execute a number of simple PDP-8
More informationASSEMBLY LANGUAGE PROGRAMMING (6800) (R. Horvath, Introduction to Microprocessors, Chapter 6)
ASSEMBLY LANGUAGE PROGRAMMING (6800) (R. Horvath, Introduction to Microprocessors, Chapter 6) 1 COMPUTER LANGUAGES In order for a computer to be able to execute a program, the program must first be present
More informationAn Overview of Stack Architecture and the PSC 1000 Microprocessor
An Overview of Stack Architecture and the PSC 1000 Microprocessor Introduction A stack is an important data handling structure used in computing. Specifically, a stack is a dynamic set of elements in which
More informationB.Sc.(Computer Science) and. B.Sc.(IT) Effective From July 2011
NEW Detailed Syllabus of B.Sc.(Computer Science) and B.Sc.(IT) Effective From July 2011 SEMESTER SYSTEM Scheme & Syllabus for B.Sc. (CS) Pass and Hons. Course Effective from July 2011 and onwards CLASS
More informationl C-Programming l A real computer language l Data Representation l Everything goes down to bits and bytes l Machine representation Language
198:211 Computer Architecture Topics: Processor Design Where are we now? C-Programming A real computer language Data Representation Everything goes down to bits and bytes Machine representation Language
More informationHigh-Level Programming Languages. Nell Dale & John Lewis (adaptation by Michael Goldwasser)
High-Level Programming Languages Nell Dale & John Lewis (adaptation by Michael Goldwasser) Low-Level Languages What are disadvantages of low-level languages? (e.g., machine code or assembly code) Programming
More informationUnpacked BCD Arithmetic. BCD (ASCII) Arithmetic. Where and Why is BCD used? From the SQL Server Manual. Packed BCD, ASCII, Unpacked BCD
BCD (ASCII) Arithmetic The Intel Instruction set can handle both packed (two digits per byte) and unpacked BCD (one decimal digit per byte) We will first look at unpacked BCD Unpacked BCD can be either
More informationOct: 50 8 = 6 (r = 2) 6 8 = 0 (r = 6) Writing the remainders in reverse order we get: (50) 10 = (62) 8
ECE Department Summer LECTURE #5: Number Systems EEL : Digital Logic and Computer Systems Based on lecture notes by Dr. Eric M. Schwartz Decimal Number System: -Our standard number system is base, also
More informationX86-64 Architecture Guide
X86-64 Architecture Guide For the code-generation project, we shall expose you to a simplified version of the x86-64 platform. Example Consider the following Decaf program: class Program { int foo(int
More informationInstruction Set Architecture. Datapath & Control. Instruction. LC-3 Overview: Memory and Registers. CIT 595 Spring 2010
Instruction Set Architecture Micro-architecture Datapath & Control CIT 595 Spring 2010 ISA =Programmer-visible components & operations Memory organization Address space -- how may locations can be addressed?
More informationAddressing The problem. When & Where do we encounter Data? The concept of addressing data' in computations. The implications for our machine design(s)
Addressing The problem Objectives:- When & Where do we encounter Data? The concept of addressing data' in computations The implications for our machine design(s) Introducing the stack-machine concept Slide
More informationDivide: Paper & Pencil. Computer Architecture ALU Design : Division and Floating Point. Divide algorithm. DIVIDE HARDWARE Version 1
Divide: Paper & Pencil Computer Architecture ALU Design : Division and Floating Point 1001 Quotient Divisor 1000 1001010 Dividend 1000 10 101 1010 1000 10 (or Modulo result) See how big a number can be
More informationAssembly Language Programming
Assembly Language Programming Assemblers were the first programs to assist in programming. The idea of the assembler is simple: represent each computer instruction with an acronym (group of letters). Eg:
More informationIBCM: The Itty Bitty Computing Machine
Chapter 1 IBCM: The Itty Bitty Computing Machine The child receives data through the sense organs; the child also has some inborn processing capacities otherwise it would not be able to learn but in addition,
More informationCentral Processing Unit
Chapter 4 Central Processing Unit 1. CPU organization and operation flowchart 1.1. General concepts The primary function of the Central Processing Unit is to execute sequences of instructions representing
More information1 Computer hardware. Peripheral Bus device "B" Peripheral device. controller. Memory. Central Processing Unit (CPU)
1 1 Computer hardware Most computers are organized as shown in Figure 1.1. A computer contains several major subsystems --- such as the Central Processing Unit (CPU), memory, and peripheral device controllers.
More informationCSCI 4717 Computer Architecture. Function. Data Storage. Data Processing. Data movement to a peripheral. Data Movement
CSCI 4717/5717 Computer Architecture Topic: Functional View & History Reading: Sections 1.2, 2.1, & 2.3 Function All computer functions are comprised of four basic operations: Data processing Data storage
More informationWe will use the accumulator machine architecture to demonstrate pass1 and pass2.
Accumulator machine We will use the accumulator machine architecture to demonstrate pass1 and pass2. The accumulator machine - has one processor register: the accumulator - all other operands are in memory,
More informationCSE 141L Computer Architecture Lab Fall 2003. Lecture 2
CSE 141L Computer Architecture Lab Fall 2003 Lecture 2 Pramod V. Argade CSE141L: Computer Architecture Lab Instructor: TA: Readers: Pramod V. Argade (p2argade@cs.ucsd.edu) Office Hour: Tue./Thu. 9:30-10:30
More informationThe stack and the stack pointer
The stack and the stack pointer If you google the word stack, one of the definitions you will get is: A reserved area of memory used to keep track of a program's internal operations, including functions,
More informationBasic Computer Organization
Chapter 2 Basic Computer Organization Objectives To provide a high-level view of computer organization To describe processor organization details To discuss memory organization and structure To introduce
More informationIn this Chapter you ll learn:
Now go, write it before them in a table, and note it in a book. Isaiah 30:8 To go beyond is as wrong as to fall short. Confucius Begin at the beginning, and go on till you come to the end: then stop. Lewis
More information