1 Classical Universal Computer 3

Size: px
Start display at page:

Download "1 Classical Universal Computer 3"

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

Chapter 2. Anatomy of a computer

Chapter 2. Anatomy of a computer Christian Jacob Chapter 2 Anatomy of a computer 2.1 Layers of Virtual Machines 2.2 The Register Machine Model 2.2.1 Main components of a von Neumann computer architecture 2.2.2 CPU and RAM 2.2.3 Execution

More information

Computer Organization I. Lecture 3: von Neumann Architecture (Part I) von Neumann Architecture

Computer Organization I. Lecture 3: von Neumann Architecture (Part I) von Neumann Architecture Computer Organization I Lecture 3: von Neumann Architecture (Part I) von Neumann Architecture Overview General Architecture of von Neumann Machine - Memory Subsystem; - Arithmetic Logic Unit; - Control

More information

14.1 A CLOSER LOOK AT CENTRAL PROCESSING UNIT

14.1 A CLOSER LOOK AT CENTRAL PROCESSING UNIT FORM 5 COMPUTER STUDIES Chapter 14: The Central Processing Unit March, 01 14.1 A CLOSER LOOK AT CENTRAL PROCESSING UNIT Still remember what CPU is? If not, take a look of the following: CPU is a device

More information

Unit 5 Central Processing Unit (CPU)

Unit 5 Central Processing Unit (CPU) Unit 5 Central Processing Unit (CPU) Introduction Part of the computer that performs the bulk of data-processing operations is called the central processing unit (CPU). It consists of 3 major parts: Register

More information

Central Processing Unit (CPU)

Central 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 information

Administrative Issues

Administrative 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 information

Notes on Assembly Language

Notes 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 information

appendix a The LC-3 ISA

appendix a The LC-3 ISA A.1 Overview The Instruction Set Architecture (ISA) of the LC-3 is defined as follows: Memory address space 16 bits, corresponding to 2 16 locations, each containing one word (16 bits). Addresses are numbered

More information

MACHINE ARCHITECTURE & LANGUAGE

MACHINE 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 information

ORG ; ZERO. Introduction To Computing

ORG ; ZERO. Introduction To Computing Dec 0 Hex 0 Bin 00000000 ORG ; ZERO Introduction To Computing OBJECTIVES this chapter enables the student to: Convert any number from base 2, base 10, or base 16 to any of the other two bases. Add and

More information

CHAPTER 7: The CPU and Memory

CHAPTER 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 information

MICROPROCESSOR AND MICROCOMPUTER BASICS

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 information

Instruction Set Architecture (ISA)

Instruction 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 information

Introduction to digital computers

Introduction to digital computers Introduction to digital computers The Von Neumann Architecture Von Neumann Architecture Designing Computers All computers more or less based on the same basic design, the Von Neumann Architecture! 2 The

More information

8051 Programming. The 8051 may be programmed using a low-level or a high-level programming language.

8051 Programming. The 8051 may be programmed using a low-level or a high-level programming language. 8051 Programming The 8051 may be programmed using a low-level or a high-level programming language. Low-Level Programming Assembly language programming writes statements that the microcontroller directly

More information

Advanced Computer Architecture-CS501. Computer Systems Design and Architecture 2.1, 2.2, 3.2

Advanced 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 information

CPU- Internal Structure

CPU- Internal Structure ESD-1 Elettronica dei Sistemi Digitali 1 CPU- Internal Structure Lesson 12 CPU Structure&Function Instruction Sets Addressing Modes Read Stallings s chapters: 11, 9, 10 esd-1-9:10:11-2002 1 esd-1-9:10:11-2002

More information

Machine Architecture. ITNP23: Foundations of Information Technology Una Benlic 4B69

Machine Architecture. ITNP23: Foundations of Information Technology Una Benlic 4B69 Machine Architecture ITNP23: Foundations of Information Technology Una Benlic 4B69 ube@cs.stir.ac.uk Basic Machine Architecture In these lectures we aim to: Understand the basic architecture of a simple

More information

CPU Organisation and Operation

CPU 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

Introduction to Design of a Tiny Computer

Introduction to Design of a Tiny Computer Introduction to Design of a Tiny Computer (Background of LAB#4) Objective In this lab, we will build a tiny computer in Verilog. The execution results will be displayed in the HEX[3:0] of your board. Unlike

More information

Lecture 3: MIPS Instruction Set

Lecture 3: MIPS Instruction Set Lecture 3: MIPS Instruction Set Today s topic: More MIPS instructions Procedure call/return Reminder: Assignment 1 is on the class web-page (due 9/7) 1 Memory Operands Values must be fetched from memory

More information

The LC-3. University of Texas at Austin CS310H - Computer Organization Spring 2010 Don Fussell

The LC-3. University of Texas at Austin CS310H - Computer Organization Spring 2010 Don Fussell The LC-3 University of Texas at Austin CS310H - Computer Organization Spring 2010 Don Fussell Instruction Set Architecture ISA = All of the programmer-visible components and operations of the computer

More information

(Refer Slide Time: 00:01:16 min)

(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 information

William Stallings Computer Organization and Architecture

William Stallings Computer Organization and Architecture William Stallings Computer Organization and Architecture Chapter 12 CPU Structure and Function Rev. 3.3 (2009-10) by Enrico Nardelli 12-1 CPU Functions CPU must: Fetch instructions Decode instructions

More information

The Von Neumann Model. University of Texas at Austin CS310H - Computer Organization Spring 2010 Don Fussell

The Von Neumann Model. University of Texas at Austin CS310H - Computer Organization Spring 2010 Don Fussell The Von Neumann Model University of Texas at Austin CS310H - Computer Organization Spring 2010 Don Fussell The Stored Program Computer 1943: ENIAC Presper Eckert and John Mauchly -- first general electronic

More information

Instruction 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 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 information

2 Programs: Instructions in the Computer

2 Programs: Instructions in the Computer 2 2 Programs: Instructions in the Computer Figure 2. illustrates the first few processing steps taken as a simple CPU executes a program. The CPU for this example is assumed to have a program counter (PC),

More information

CPU Organization and Assembly Language

CPU 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 information

SESSION 8 MARIE. ISE218 Fundamentals of Information Technology. Robert F. Kelly,

SESSION 8 MARIE. ISE218 Fundamentals of Information Technology. Robert F. Kelly, SESSION 8 MARIE Reading: Sections 4.8-4.11 ISE218 Fundamentals of Information Technology 2 Objectives Better understand the operations of a computer by examining a very simple processor that includes many

More information

Programming the Basic Computer. lecture 8

Programming the Basic Computer. lecture 8 Programming the Basic Computer lecture 8 Programming the Basic Computer A computer system includes both hardware and software. Hardware consist of the physical components. Software refers to computer programs.

More information

Introduction to Computer System

Introduction to Computer System Representation of Basic Information Introduction to Computer System The basic functional units of computer are made of electronics circuit and it works with electrical signal. We provide input to the computer

More information

Feature of 8086 Microprocessor

Feature of 8086 Microprocessor 8086 Microprocessor Introduction 8086 is the first 16 bit microprocessor which has 40 pin IC and operate on 5volt power supply. which has twenty address limes and works on two modes minimum mode and maximum.

More information

Lecture 3 Addressing Modes, Instruction Samples, Machine Code, Instruction Execution Cycle

Lecture 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 information

Processing Unit. Backing Store

Processing Unit. Backing Store SYSTEM UNIT Basic Computer Structure Input Unit Central Processing Unit Main Memory Output Unit Backing Store The Central Processing Unit (CPU) is the unit in the computer which operates the whole computer

More information

1 Computer Architecture Question Bank Part A Questions

1 Computer Architecture Question Bank Part A Questions 1 Computer Architecture Part A Questions 1. What is stored program concept? 2. Differentiate memory write and I/O write. 3. What are the various methods of accessing data from memory? 4. Define memory

More information

8085 INSTRUCTION SET

8085 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 information

Chapter 5 The LC-3. Instruction Set Architecture

Chapter 5 The LC-3. Instruction Set Architecture Instruction Set rchitecture Chapter 5 The LC-3 ased on slides McGraw-Hill dditional material 2004/2005 Lewis/Martin IS = Programmer-visible components & operations Memory organization ddress space -- how

More information

Summary of the MARIE Assembly Language

Summary 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 information

The Von Neumann Model

The Von Neumann Model Instructing the Computer To perform a task, the computer is provided with program The Von Neumann Model Based on slides McGraw-Hill Additional material 2004/2005 Lewis/Martin Modified by iana Palsetia

More information

Instruction Set Architecture

Instruction 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 information

a storage location directly on the CPU, used for temporary storage of small amounts of data during processing.

a 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 information

5 Computer Organization

5 Computer Organization 5 Computer Organization 5.1 Foundations of Computer Science Cengage Learning Objectives After studying this chapter, the student should be able to: List the three subsystems of a computer. Describe the

More information

Assembly Programming: Ch 7. Example LC-3 instruction. Example LC-3 instruction. Example LC-3 instruction. Machine language:

Assembly Programming: Ch 7. Example LC-3 instruction. Example LC-3 instruction. Example LC-3 instruction. Machine language: Assembly Programming: Ch 7 Computer Systems Microarchitectures Assembly Programming Input/Output Interfaces Instruction Set Architectures Computing Structures Logic Transistors Bits Is Src2 an immediate?:

More information

Assembly Language: Overview! Jennifer Rexford!

Assembly Language: Overview! Jennifer Rexford! Assembly Language: Overview! Jennifer Rexford! 1 Goals of this Lecture! Help you learn:! The basics of computer architecture! The relationship between C and assembly language! IA-32 assembly language,

More information

MICROPROCESSOR. Exclusive for IACE Students www.iace.co.in iacehyd.blogspot.in Ph: 9700077455/422 Page 1

MICROPROCESSOR. 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 information

PART B QUESTIONS AND ANSWERS UNIT I

PART 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 information

Lecture 3 A Very Simple Processor. Memory MPU I/O. Memory. Memory, registers and ALU. Memory

Lecture 3 A Very Simple Processor. Memory MPU I/O. Memory. Memory, registers and ALU. Memory Lecture 3 A Very Simple Processor Based on von Neumann model Instruction for the microprocessor (stored program) and the data for computation are both stored in memory Microprocessing Unit (MPU) contains:

More information

Basic Concepts of Microprocessors

Basic Concepts of Microprocessors MICROPROCESSOR 8085 Reference Book: Ramesh S. Goankar, Microprocessor Architecture, Programming and Applications with 8085, 5 th Edition, Prentice Hall Week 1 Basic Concept and Ideas about Microprocessor.

More information

A single register, called the accumulator, stores the. operand before the operation, and stores the result. Add y # add y from memory to the acc

A 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 information

BLOCK DIAGRAM OF A COMPUTER SYSTEM

BLOCK DIAGRAM OF A COMPUTER SYSTEM BLOCK DIAGRAM OF A COMPUTER SYSTEM Analysis of CPU In order to work, a computer needs some sort of "brain" or "calculator". At the core of every computer is a device roughly the size of a large postage

More information

Compilers I - Chapter 4: Generating Better Code

Compilers 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 information

Instruction Set Design

Instruction 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

CS 16: Assembly Language Programming for the IBM PC and Compatibles

CS 16: Assembly Language Programming for the IBM PC and Compatibles CS 16: Assembly Language Programming for the IBM PC and Compatibles First, a little about you Your name Have you ever worked with/used/played with assembly language? If so, talk about it Why are you taking

More information

OAMulator. 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 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 information

Assembly language programs are made up of statements. Each statement may be composed of constants, literals, names, mnemonics, operands, and comments.

Assembly language programs are made up of statements. Each statement may be composed of constants, literals, names, mnemonics, operands, and comments. CS221 Assembly Language Fundamentals : Irvine Chapter 3 While debug is good for writing very small programs and experimenting with memory, interrupts, and function calls, it is not very good for larger

More information

Computer 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. 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 information

Lecture 1: Introduction to Microcomputers

Lecture 1: Introduction to Microcomputers Lecture 1: Introduction to Microcomputers Today s Topics What is a microcomputers? Why do we study microcomputers? Two basic types of microcomputer architectures Internal components of a microcomputers

More information

Computer organization

Computer 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 information

CHAPTER 4 MARIE: An Introduction to a Simple Computer

CHAPTER 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 information

Chapter 7D The Java Virtual Machine

Chapter 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 information

PART OF THE PICTURE: Computer Architecture

PART OF THE PICTURE: Computer Architecture PART OF THE PICTURE: Computer Architecture 1 PART OF THE PICTURE: Computer Architecture BY WILLIAM STALLINGS At a top level, a computer consists of processor, memory, and I/O components, with one or more

More information

Department of Computer and Mathematical Sciences. Assigment 4: Introduction to MARIE

Department of Computer and Mathematical Sciences. Assigment 4: Introduction to MARIE Department of Computer and Mathematical Sciences CS 3401 Assembly Language 4 Assigment 4: Introduction to MARIE Objectives: The main objective of this lab is to get you familiarized with MARIE a simple

More information

Computer Organization and Architecture

Computer 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 information

PROBLEMS (Cap. 4 - Istruzioni macchina)

PROBLEMS (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 information

UNIVERSITY 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 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 information

CS101 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. 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 information

Chapter 4 Integer JAVA Virtual Machine

Chapter 4 Integer JAVA Virtual Machine Processor Block Diagram Chapter 4 Integer JAVA Virtual Machine 1 of 14 ECE 357 Register Definitions PC MBR MAR MDR SP LV CPP TOS OPC H Program Counter: Access Data in Method Area Memory Branch Register:

More information

Z80 Instruction Set. Z80 Assembly Language

Z80 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 information

Microprocessor Overview

Microprocessor Overview EE25M Introduction to microprocessors original author: Feisal Mohammed updated: 16th January 2002 CLR Part I Microprocessor Overview Central processing units (CPU s) for early computers, were originally

More information

A3 Computer Architecture

A3 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 information

Transferring Data Among Registers. Serial Data Register Transfer

Transferring Data Among Registers. Serial Data Register Transfer Transferring Data Among Registers Point-to-Point Transfer Serial Transfer: Shift Registers Parallel Transfer Control (Strobing Signal) Clocking Multiplexing Bus Transfer Avoids Using Multiplexers Destination

More information

Introduction to Microcontrollers. ECE473/573 Microprocessor System Design, Dr. Shiue

Introduction to Microcontrollers. ECE473/573 Microprocessor System Design, Dr. Shiue Introduction to Microcontrollers 1 Introduction It is hard to imagine the present world of electronic devices without the microprocessor. Cash register, scales, ovens, washing machine, alarm clock, thermostats,

More information

Simplified Instructional Computer (SIC)

Simplified Instructional Computer (SIC) Simplified Instructional Computer (SIC) A hypothetical computer that includes the hardware features most often found on real machines SIC standard model SIC/XE Upward compatible Programs for SIC can run

More information

Week Assembly Language Programming Chapter 2

Week Assembly Language Programming Chapter 2 Week 2 8051 Assembly Language Programming Chapter 2 1 Outline 2.1 Inside the 8051 2.2 Introduction to 8051 Assembly programming 2.3 Assembling and running an 8051 program 2.4 The program counter and ROM

More information

Chapter 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 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 information

EC 362 Problem Set #2

EC 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 information

Tutorial. Introduction to 8085 Architecture and Programming

Tutorial. Introduction to 8085 Architecture and Programming Tutorial On Introduction to 8085 Architecture and Programming Contents 1. Internal architecture of 8085 microprocessor 2. 8085 system bus 3. 8085 pin description. 4. 8085 functional description. 5. Programming

More information

Chapter 5. Processing Unit Design

Chapter 5. Processing Unit Design Chapter 5 Processing Unit Design 5.1 CPU Basics A typical CPU has three major components: Register Set, Arithmetic Logic Unit, and Control Unit (CU). The register set is usually a combination of general-purpose

More information

SUMMER 13 EXAMINATION

SUMMER 13 EXAMINATION Page 1 of 28 Important Instructions to examiners: 1) The answers should be examined by key words and not as word-to-word as given in the model answer scheme. 2) The model answer and the answer written

More information

George M. Georgiou and Brian Strader. California State University, San Bernardino. August 2005

George M. Georgiou and Brian Strader. California State University, San Bernardino. August 2005 11 0011 101 01 10 111 10 11 0011100 11000 0010 11 010 11 00 0110001 00101 1101 11010 0011011010 10011101 01100101111 001 00 01110 00100 10100101 11101111001110 10001 11 011 0110 0110 101101 0110111110000000110001000000100100101010

More information

what operations can it perform? how does it perform them? on what kind of data? where are instructions and data stored?

what 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 information

High level code and machine code

High 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 information

CHAPTER 4 MARIE: An Introduction to a Simple Computer

CHAPTER 4 MARIE: An Introduction to a Simple Computer CHAPTER 4 MARIE: An Introduction to a Simple Computer 4.1 Introduction 145 4.1.1 CPU Basics and Organization 145 4.1.2 The Bus 147 4.1.3 Clocks 151 4.1.4 The Input/Output Subsystem 153 4.1.5 Memory Organization

More information

2) Write in detail the issues in the design of code generator.

2) 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 information

Microcontroller 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: 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 information

İSTANBUL AYDIN UNIVERSITY

İ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 information

Basic Computer Organization

Basic Computer Organization SE 292 (3:0) High Performance Computing L2: Basic Computer Organization R. Govindarajan govind@serc Basic Computer Organization Main parts of a computer system: Processor: Executes programs Main memory:

More information

W4118 Operating Systems. Junfeng Yang

W4118 Operating Systems. Junfeng Yang W4118 Operating Systems Junfeng Yang Outline PC organization x86 instruction set gcc inline assembly and calling conventions PC organization One or more CPUs, memory, and device controllers connected through

More information

Chapter 2 : Central Processing Unit

Chapter 2 : Central Processing Unit Chapter 2 Central Processing Unit The part of the computer that performs the bulk of data processing operations is called the Central Processing Unit (CPU) and is the central component of a digital computer.

More information

MIPS Assembly Language Programming. Robert Britton Computer Science Department California State University, Chico Chico, California

MIPS Assembly Language Programming. Robert Britton Computer Science Department California State University, Chico Chico, California MIPS Assembly Language Programming Robert Britton Computer Science Department California State University, Chico Chico, California Instructors are granted permission to make copies of this beta version

More information

1. Convert the following base 10 numbers into 8-bit 2 s complement notation 0, -1, -12

1. 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 information

Chapter 1 Basic Concepts

Chapter 1 Basic Concepts Chapter 1 Basic Concepts 1.1 Welcome to Assembly Language 1 1.1.1 Good Questions to Ask 2 1.1.2 Assembly language Applications 5 1.1.3 Section Review 6 1.2 Virtual Machine Concept 7 1.2.1 History of PC

More information

Influence of Technology and Software on Instruction Sets: Up to the dawn of IBM 360

Influence of Technology and Software on Instruction Sets: Up to the dawn of IBM 360 1 Influence of Technology and Software on Instruction Sets: Up to the dawn of IBM 360 Computer Science and Artificial Intelligence Laboratory M.I.T. Based on the material prepared by and Krste Asanovic

More information

Introduction to Computer Science

Introduction to Computer Science Introduction to Computer Science 11/17/2008 1. (5%) How many bytes of memory are needed to store a full screen of data if the screen is made of 48 lines with 80 characteristics in each line? The system

More information

Chapter 4 Lecture 3 The Microarchitecture Level Integer JAVA Virtual Machine

Chapter 4 Lecture 3 The Microarchitecture Level Integer JAVA Virtual Machine Chapter 4 Lecture 3 The Microarchitecture Level Integer JAVA Virtual Machine This is a limited version of a hardware implementation to execute the JAVA programming language. 1 of 30 Review The Data Path

More information

Chapter 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 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 information

MICROPROCESSOR 2 marks questions and answers UNIT-I

MICROPROCESSOR 2 marks questions and answers UNIT-I MICROPROCESSOR 2 marks questions and answers 1. Define microprocessors? UNIT-I A semiconductor device(integrated circuit) manufactured by using the LSI technique. It includes the ALU, register arrays,

More information

Central Processing Unit

Central Processing Unit Central Processing Unit General Register Organization Stack Organization Instruction Formats Addressing Modes Data Transfer and Manipulation Micro Programmed Control Reduced Instruction Set Computer Parallel

More information

Embedded Systems. Review of ANSI C Topics. A Review of ANSI C and Considerations for Embedded C Programming. Basic features of C

Embedded 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 information

Chapter 8. Arithmetic in C++

Chapter 8. Arithmetic in C++ Christian Jacob Chapter 8 Arithmetic in C++ 8.1 The C++ Vocabulary 8.2 Variables and Types 8.2.1 Data Objects 8.2.2 Variables 8.2.3 Declaration of Variables 8.3 Elementary C++ Data Types 8.3.1 Integers

More information