QUIZ. Name all the 4 parts of the fetch-execute cycle.

Size: px
Start display at page:

Download "QUIZ. Name all the 4 parts of the fetch-execute cycle."

Transcription

1 QUIZ Name all the 4 parts of the fetch-execute cycle. 1

2 Solution Name all the 4 parts of the fetch-execute cycle. 2

3 QUIZ Name two fundamental differences between magnetic drives and optical drives: 3

4 QUIZ Define Embedded Systems 4

5 QUIZ What are two ways to create a non-vn architecture? What are the 3 parallel architectures we covered? 5

6 Solution What are two ways to create a non-vn architecture? A: By using more than one MM, or by using more than one CPU. What are the 3 parallel architectures we covered? Pipelined CPUs Synchronous CPUs Parallel (non-synchronous) CPUs 6

7 QUIZ Pipelining A computer pipeline has 4 processors, as shown above. Each processor takes 15 ms to execute, and each instruction must go sequentially through all 4 processors. A program has 10 instructions. Calculate how long it takes to run it: without pipelining with pipelining 7

8 Extra-credit QUIZ 8

9 Low-level software Components Circuits Gates Transistors

10 Abstractions and more abstractions You are here 10

11 6.1 Computer Operations Computer = programmable electronic device that can store, retrieve, and process data Von Neumann architecture: Data and instructions to manipulate the data are represented in the same way (binary) and are stored in the same place (memory) For processing, both data and instructions have to be brought into the CPU (fetch-execute cycle) 11

12 6.2 Machine Language Machine language = The language made up of binary coded instructions built into the hardware of a particular computer and used directly by the computer Why would anyone use machine language? (Hint: they had no choice. Why?) Image source: 12

13 Remember: The Fetch-Execute Cycle According to the CPU s machine language 13

14 Characteristics of machine language: Every processor type has its own set of specific machine instructions The relationship between the processor and the instructions it can carry out is completely integrated Each machine-language instruction does only one very low-level task 14

15 Pep/8 Virtual Computer Virtual computer A hypothetical machine designed to contain the important features of a real machine Pep/8 A virtual computer designed by Stanley Warford that has 39 machine-language instructions (We re going to cover only a few of them!) 15

16 Extra-credit 16

17 Pep/8 Registers The program counter (PC) (contains the address of the next instruction to be executed) The instruction register (IR) (contains a copy of the instruction being executed) The accumulator (register A) The memory unit is made up of 65,636 Bytes of storage Can you figure out how long the Pep/8 address is? 17

18 QUIZ The previous version of Pep, Pep/7, could use only 12 bits for memory addresses. How many memory cells could Pep/7 address? 18

19 24 bits 16 bits Explain the address format! 19

20 Can you show what instructions look like in memory? Explain the address format! 20

21 Instruction Format 21

22 Instruction Format Operation code, a.k.a. opcode Specifies which instruction is to be carried out Register specifier Specifies which register is to be used (only use A in this chapter) Addressing-mode specifier Says how to interpret the operand part of the instruction: Direct Immediate Say that again?!? 22

23 Instruction Format Addressing-mode specifier Says how to interpret the operand part of the instruction: Direct Immediate?? Immediate A + B Direct 23

24 Immediate and direct addressing modes 24

25 Immediate and direct addressing modes Example: ADD 42 to accumulator A What exactly am I to add? 25

26 Instruction Format Addressing modes: immediate direct Is there something we are not telling you about Pep s addressing modes? 26

27 PEP/8 machine instructions 27

28 What does this instruction mean, what is its hex code, and what exactly does it do? 28 EOL 1

29 QUIZ Name all the 4 parts of the fetch-execute cycle. What do IR, A, and PC stand for in the computer s architecture? Name and explain the 2 addressing modes we ve covered. 29

30 QUIZ: Immediate vs. direct addressing We have this Pep instruction: SUB 30 from accumulator A What exactly will Pep subtract? 30

31 We have this Pep instruction: SUB 30 from accumulator A What exactly will Pep subtract? A: It depends on the addressing mode! If immediate (000), then the integer 30 goes in A. If direct (001), then the content of the memory address 30 goes in A. Solution 31

32 QUIZ: Immediate vs. direct addressing We have this Pep instruction: LOAD 20 (decimal) into accumulator A What exactly will Pep load? 32

33 What does this instruction mean, what is its hex code, and what exactly does it do? 33

34 What does this instruction mean, what is its hex code, and what exactly does it do? 34

35 What do these instructions mean, what are their hex codes, and what exactly do they do? 35

36 Wait a second... 36

37 Conclusions It is useless to write operands into IR. IR is written only in the FETCH stage of the Fetch-Execute cycle, when the 3 bytes of the instruction are brought from memory. Operands can be written only to: Accumulator Memory Some instructions cannot have the immediate addressing mode 37

38 What do these instructions mean, what are their hex codes, and what exactly do they do? 38

39 What does this instruction mean, what is its hex code, and what exactly does it do? Why is there only one on this page?

40 40 What do these instructions mean, what are their hex codes, and what exactly do they do?

41 Problem 17 / 190 The PEP/8 memory has the following contents: 0001 A FF What are the contents of reg. A after this instruction is executed: C The first step is 41

42 Problem 17 / 190 The PEP/8 memory has the following contents: 0001 A FF What are the contents of reg. A after this instruction is executed: C

43 Problem 16 / 189 The PEP/8 memory has the following contents: 0001 A FF What are the contents of reg. A after this instruction is executed: C

44 0001 A FF Instruction executed: C

45 6.3 Program to write "Hello" Every program ends with this! 45

46 Your turn! What does this program do?

47 Steps for executing a machine-language program Machine code program in a file on disk Loader Execute Program in memory 47

48 SKIP Pep/8 Simulator EOL 248

49 Problem 33 / 191 The PEP/8 memory has the following program in memory (in hex): Convert the program to binary and explain in your own words what it does. 49

50 Fact: Writing programs in machine language sucks! (i.e. it is time-consuming, boring, errorprone, unintuitive, etc.) 50

51 that s why we invented assembly language 51

52 6.4 Assembly Language Assembly language A language that uses mnemonic codes to represent machine-language instructions Assembler A program that reads each of the instructions in mnemonic form and translates it into the machine-language equivalent 52

53 Steps for executing an assembly-language program Loader 53 Execute Program in memory

54 Pep/8 Assembly Language Opcode is 04 Opcode is 31 Opcode is 38 Opcode is 39 54

55 Hello program in assembly mnemonic operand addressing mode comments CHARO CHARO CHARO CHARO CHARO STOP.END 0x0048, i ;Outputs character 'H' 0x0065, i 0x006C, i 0x006C, i 0x006F, i What in the world is this?! 55

56 A New Program Problem: Read and sum three values and print the sum How would you do it by hand? 56

57 Declaring variables in assembly: We simply reserve space in memory for them! Labels they are just placeholders for memory addresses 57

58 Assembler directives, a.k.a. pseudo-ops What is the difference between operations and pseudo operations? 58

59 Completed Program sum:.word 0x0000 num1:.block 2 num2:.block 2 num3:.block 2 main: LDA sum,d DECI num1,d ADDA num1,d DECI num2,d ADDA num2,d DECI num3,d ADDA num3,d STA sum,d DECO sum,d STOP.END 59

60 Completed Program Houston, we have a problem! How does the CPU know that the program starts here? sum:.word 0x0000 num1:.block 2 num2:.block 2 Num3:.BLOCK 2 main: LDA sum,d DECI num1,d ADDA num1,d DECI num2,d ADDA num2,d DECI num3,d ADDA num3,d STA sum,d DECO sum,d STOP.END 60

61 Solution: Branch instruction BR main sum:.word 0x0000 num1:.block 2 num2:.block 2 num3:.block 2 main: LDA sum,d DECI num1,d ADDA num1,d DECI num2,d ADDA num2,d DECI num3,d ADDA num3,d STA sum,d DECO sum,d STOP.END See comments on next slide 61

62 Unconditional branch! Completed Program 62

63 Your turn! Change the program so it adds only two numbers: always EOL 3

64 We have covered the beginning of section 6.4. We stopped before the sub-section A Program with Branching. Read the text carefully and make sure you can explain in your own words what each instruction accomplishes. Individual work (do in notebook for next time): 16, 17, 19, EOL 3 64

65 Decision-making instructions BR Set PC to operand unconditionally BRLT i Set PC to operand if A < 0 BREQ i Set PC to operand if A = 0 65

66 Decision making problem: Same as previous sum program, but print the sum only if positive or zero; if negative, print an error message negmsg: CHARO 0x0045,i BR finish main: LDA sum,d BRLT negmsg STA sum,d DECO sum,d finish: STOP What ASCII code is this? 66

67 Decision making problem: Same as before, but print the sum only if positive or zero; if negative, print E (Error) negmsg: CHARO 0x0045,i BR finish main: LDA sum,d BRLT negmsg STA sum,d DECO sum,d finish: STOP ASCII code for 'E' How many ways are there to reach finish?

68 QUIZ: Would the decision program from the first example still work if the negmsg block were placed after the main program instead of before? main: LDA sum,d BRLT negmsg STA sum,d DECO sum,d finish: STOP negmsg: CHARO 0x0045,i BR finish 68

69 QUIZ: What does this program do? BR main a:.block 2 main: DECI a, d LDA a, d SUBA 0x002A, i STA a, d DECO a, d STOP.END 69

70 Solution BR main a:.block 2 main: DECI a, d LDA a, d SUBA 0x002A, i STA a, d DECO a, d STOP.END A: It subtracts 42 from the number entered, and displays the result. 70

71 QUIZ: What does this program do? BR main a:.block 2 main: DECI a, d LDA a, d SUBA 0x002A, i STA a, d BREQ yes DECO a, d fin: STOP yes: CHARO 0x0046, i BR fin.end ASCII code for 'F' 71

72 QUIZ: Write an assembly program to subtract from and put the result in memory Take inspiration from the program we studied last time: BR main sum:.word 0x0000 num1:.block 2 num2:.block 2 num3:.block 2 main: LDA sum,d DECI num1,d ADDA num1,d DECI num2,d ADDA num2,d DECI num3,d ADDA num3,d STA sum,d DECO sum,d STOP.END 72

73 Three quizzes for individual work Write a program that adds the number 3 to a number entered by the user, and prints : the result if equal to zero, otherwise it prints nothing. the result if less than zero, otherwise it prints nothing. the result if greater than zero, otherwise it prints nothing. 73

74 What does this program do? (p.173) CPA must always be followed by a conditional branch! 74

75 High-level software (Ch.9) Algorithms (and data structures) Low-level software Components Circuits Gates Transistors

76 6.5 Algorithms and Pseudocode Algorithm = A sequence of steps for solving a problem Muḥammad ibn Mūsā al-khwārizmī ( A.D.) 76

77 Remember: Decision-making instructions BR Set PC to operand unconditionally BRLT i Set PC to operand if A < 0 BREQ i Set PC to operand if A = 0 77

78 Not in text How to describe an algorithm in an intuitive way? Flowcharts! We use decision-making instructions to build: branches loops 78

79 Problems with flowcharts: They re hard to follow when they get complex Not in text 79

80 Problems with flowcharts: They re hard to follow when they get complex They re hard to draw in electronic documents Not in text 80

81 Problems with flowcharts: They re hard to follow when they get complex They re hard to draw in electronic documents Not in text Our text uses only pseudocode 81

82 6.5 Algorithms and Pseudocode Pseudocode = A mixture of English and formatting to make the steps in an algorithm explicit There are no syntax rules in pseudocode! Pseudocode is not case sensitive! Example: Repeated-division algorithm (convert base-10 number to other bases): While ( the quotient is not zero ) Divide the decimal number by the new base Make the remainder the next digit to the left in the answer Replace the original decimal number with the quotient 82

83 Algorithms can also be described in natural language! 83

84 but pseudocode is more precise IF concerned about cholesterol Put butter substitute in a pot ELSE Put butter in a pot Turn on burner Put pot on the burner WHILE (NOT bubbling) Leave pot on the burner Put other ingredients in the blender Turn on blender WHILE (more in pot) Pour contents into lender in slow steam Turn off blender 84

85 Draw the flowchart for this pseudocode IF concerned about cholesterol Put butter substitute in a pot ELSE Put butter in a pot Turn on burner Put pot on the burner WHILE (NOT bubbling) Leave pot on the burner Put other ingredients in the blender Turn on blender WHILE (more in pot) Pour contents into lender in slow steam Turn off blender 85

86 Pseudocode functionality Pseudocode has all of the concepts encountered in any high-level programming language, only the syntax is informal: Variables Assignment I/O Selection / decision Repetition / loop Boolean expressions 86

87 Reading assignment: Pages of the text Refer to your Python programming experience! 87

88 We can test a pseudocode algorithm w/pencil & paper, a.k.a. desk checking While ( the quotient is not zero ) Divide the decimal number by the new base Make the remainder the next digit to the left in the answer Replace the original decimal number with What is 93 in base 8? 93/8 gives 11 remainder 5 11/8 gives 1 remainder 3 1/ 8 gives 0 remainder 1 answer

89 Organizing the solution in a computer-like way gives us better idea of what is required for the computer to execute it, e.g. two numbers need to be entered, etc. 89

90 QUIZ: Desk-check the repeated division algorithm with decimalnumber = 242, and newbase = 8 Answer:

91 SKIP 6.6 Testing 91

92 Read and take notes in notebook: Software Piracy and Copyrighting Have you every "borrowed" software from a friend? Have you ever "lent" software to a friend? Did you know that about 100,000 jobs are lost in the US every year due to such "borrowing" and "lending?" 92

93 Chapter Review Questions List the operations that a computer can perform Describe the important features of the Pep/8 virtual machine Distinguish between immediate addressing mode and direct addressing mode Write a simple machine-language program Distinguish between machine language and assembly language 93

94 Chapter Review Questions Describe the steps in creating and running an assembly-language program Write a simple program in assembly program Distinguish between instructions to the assembler (a.k.a. directives) and instructions to be translated into machine code (a.k.a. executable instructions) Distinguish between following an algorithm and developing one 94

95 Chapter Review Questions Describe the pseudocode constructs used in expressing an algorithm Use pseudocode to express and algorithm Distinguish between black-box and clear-box testing 95

96 Homework Due Wednesday, Oct.26 End of chapter exercises: 10, 11, 12, 13, 14, 15, 18, 20, Correction in 20: use E1 instead of E0 27, 34, Hint for 34: machine code 31 means decimal input 36, 41, Hint for 41: How are integers represented in Pep/8? 44, 45

97 All PEP instructions, with machine codes 00 Stop STOP 04 Branch unconditional BR 08 Branch if Less Than BRLT 0A Branch if equal BREQ 31 Decimal Input Direct DECI 38 Decimal Output Immediate DECO 39 Decimal Output Direct DECO 49 Char. Input Direct CHARI 50 Char. Output Immediate CHARO 51 Char. Output Direct CHARO 70 Add to A Immediate ADDA 71 Add to A Direct ADDA 80 Subtract from A Immediate SUBA 81 Subtract from A Direct SUBA C0 Load into A Immediate LDA C1 Load into A Direct LDA E1 Store A Direct STA 97

Low-level software. Components Circuits Gates Transistors

Low-level software. Components Circuits Gates Transistors QUIZ Pipelining A computer pipeline has 4 processors, as shown above. Each processor takes 15 ms to execute, and each instruction must go sequentially through all 4 processors. A program has 10 instructions.

More information

QUIZ. Name all the 4 parts of the fetch-execute cycle.

QUIZ. Name all the 4 parts of the fetch-execute cycle. QUIZ Name all the 4 parts of the fetch-execute cycle. 1 Solution Name all the 4 parts of the fetch-execute cycle. 2 QUIZ Name two fundamental differences between magnetic drives and optical drives: 3 Solution

More information

Extra-credit QUIZ Pipelining -due next time-

Extra-credit QUIZ Pipelining -due next time- QUIZ Pipelining A computer pipeline has 4 processors, as shown above. Each processor takes 15 ms to execute, and each instruction must go sequentially through all 4 processors. A program has 10 instructions.

More information

High-level software (Ch.9) Algorithms and data structures. Low-level software. Components Circuits Gates Transistors

High-level software (Ch.9) Algorithms and data structures. Low-level software. Components Circuits Gates Transistors High-level software (Ch.9) Algorithms and data structures Low-level software Components Circuits Gates Transistors Remember: Decision-making instructions BR Set PC to operand unconditionally BRLT i Set

More information

Low-Level Programming Languages and Pseudocode

Low-Level Programming Languages and Pseudocode Chapter 6 Low-Level Programming Languages and Pseudocode Chapter Goals List the operations that a computer can perform Describe the important features of the Pep/8 virtual machine Distinguish between immediate

More information

LOW-LEVEL PROGRAMMING LANAGUAGES AND PSEUDOCODE. Introduction to Computer Engineering 2015 Spring by Euiseong Seo

LOW-LEVEL PROGRAMMING LANAGUAGES AND PSEUDOCODE. Introduction to Computer Engineering 2015 Spring by Euiseong Seo LOW-LEVEL PROGRAMMING LANAGUAGES AND PSEUDOCODE Introduction to Computer Engineering 2015 Spring by Euiseong Seo Where are we? Chapter 1: The Big Picture Chapter 2: Binary Values and Number Systems Chapter

More information

Write "Nell" Write "N" Write "e" Write "l" Write "l" Write "N" Write 4E (hex) Write "e" W rite 65 (hex) Write "l" W rite 6C (hex)

Write Nell Write N Write e Write l Write l Write N Write 4E (hex) Write e W rite 65 (hex) Write l W rite 6C (hex) Chapter 7 Exercises 1. What does it mean when we say that a computer is a programmable device? Programmable means that data and instructions are logically the same and are stored in the same place. The

More information

CSC 221: Computer Organization, Spring 2009

CSC 221: Computer Organization, Spring 2009 1 of 7 4/17/2009 10:52 AM Overview Schedule Resources Assignments Home CSC 221: Computer Organization, Spring 2009 Practice Exam 2 Solutions The exam will be open-book, so that you don't have to memorize

More information

Chapter. Assembly Language

Chapter. Assembly Language Chapter 5 Assembly Language Mappings The mapping from Asmb5 to ISA3 is one-toone The mapping from HOL6 to Asmb5 is oneto-many Symbols Defined by an identifier followed by a colon at the start of a statement

More information

Wednesday, February 7, 2018

Wednesday, February 7, 2018 Wednesday, February 7, 2018 Topics for today The Pep/9 memory Four example programs The loader The assembly language level (Chapter 5) Symbolic Instructions Assembler directives Immediate mode and equate

More information

Wednesday, March 12, 2014

Wednesday, March 12, 2014 Wednesday, March 12, 2014 Topics for today Solutions to HW #3 Arrays and Indexed Addressing Global arrays Local arrays Buffer exploit attacks Solutions to Homework #3 1. deci N,d < (a) N not defined lda

More information

Wednesday, February 4, Chapter 4

Wednesday, February 4, Chapter 4 Wednesday, February 4, 2015 Topics for today Introduction to Computer Systems Static overview Operation Cycle Introduction to Pep/8 Features of the system Operational cycle Program trace Categories of

More information

COSC 122 Computer Fluency. Computer Organization. Dr. Ramon Lawrence University of British Columbia Okanagan

COSC 122 Computer Fluency. Computer Organization. Dr. Ramon Lawrence University of British Columbia Okanagan COSC 122 Computer Fluency Computer Organization Dr. Ramon Lawrence University of British Columbia Okanagan ramon.lawrence@ubc.ca Key Points 1) The standard computer (von Neumann) architecture consists

More information

CS 101, Mock Computer Architecture

CS 101, Mock Computer Architecture CS 101, Mock Computer Architecture Computer organization and architecture refers to the actual hardware used to construct the computer, and the way that the hardware operates both physically and logically

More information

Monday, February 16, 2015

Monday, February 16, 2015 Monday, February 16, 2015 Topics for today How assemblers work Symbol tables ILC Pass 1 algorithm, Error checking Pass 2 Immediate mode and equate Assembler variants: Disassembler, Cross assembler Macros

More information

Course Schedule. CS 221 Computer Architecture. Week 3: Plan. I. Hexadecimals and Character Representations. Hexadecimal Representation

Course Schedule. CS 221 Computer Architecture. Week 3: Plan. I. Hexadecimals and Character Representations. Hexadecimal Representation Course Schedule CS 221 Computer Architecture Week 3: Information Representation (2) Fall 2001 W1 Sep 11- Sep 14 Introduction W2 Sep 18- Sep 21 Information Representation (1) (Chapter 3) W3 Sep 25- Sep

More information

QUIZ: Generations of computer technology. Hardware:

QUIZ: Generations of computer technology. Hardware: QUIZ: Generations of computer technology Hardware: 1. 2. 3. 4. 5. 1 QUIZ: Generations of computer technology Software: 1. 2. 3. 4. 5. 6. 2 Steampunk! 3 The Telectroscope, 1878-2008 Steampunk Wikipedia

More information

Wednesday, February 15, 2017

Wednesday, February 15, 2017 Wednesday, February 15, 2017 Topics for today Before and after assembly: Macros, Linkers Overview of Chapter 6 Branching Unconditional Status bits and branching If statements While statements The V and

More information

Wednesday, September 13, Chapter 4

Wednesday, September 13, Chapter 4 Wednesday, September 13, 2017 Topics for today Introduction to Computer Systems Static overview Operation Cycle Introduction to Pep/9 Features of the system Operational cycle Program trace Categories of

More information

Unified Engineering Fall 2004

Unified Engineering Fall 2004 Massachusetts Institute of Technology Department of Aeronautics and Astronautics Cambridge, MA 02139 Unified Engineering Fall 2004 Problem Set #3 Solutions C&P PSET 3 Solutions 1. 12

More information

The CPU and Memory. How does a computer work? How does a computer interact with data? How are instructions performed? Recall schematic diagram:

The CPU and Memory. How does a computer work? How does a computer interact with data? How are instructions performed? Recall schematic diagram: The CPU and Memory How does a computer work? How does a computer interact with data? How are instructions performed? Recall schematic diagram: 1 Registers A register is a permanent storage location within

More information

QUIZ: What value is stored in a after this

QUIZ: What value is stored in a after this QUIZ: What value is stored in a after this statement is executed? Why? a = 23/7; QUIZ evaluates to 16. Lesson 4 Statements, Expressions, Operators Statement = complete instruction that directs the computer

More information

Wednesday, September 21, 2016

Wednesday, September 21, 2016 Wednesday, September 21, 2016 Topics for today More high-level to translations Compilers and Assemblers How assemblers work Symbol tables ILC Pass 1 algorithm, Error checking Pass 2 Immediate mode and

More information

Monday, February 11, 2013

Monday, February 11, 2013 Monday, February 11, 2013 Topics for today The Pep/8 memory Four example programs The loader The assembly language level (Chapter 5) Symbolic Instructions Assembler directives Immediate mode and equate

More information

Introduction to Computers - Chapter 4

Introduction to Computers - Chapter 4 Introduction to Computers - Chapter 4 Since the invention of the transistor and the first digital computer of the 1940s, computers have been increasing in complexity and performance; however, their overall

More information

CS 31: Intro to Systems Digital Logic. Kevin Webb Swarthmore College February 2, 2016

CS 31: Intro to Systems Digital Logic. Kevin Webb Swarthmore College February 2, 2016 CS 31: Intro to Systems Digital Logic Kevin Webb Swarthmore College February 2, 2016 Reading Quiz Today Hardware basics Machine memory models Digital signals Logic gates Circuits: Borrow some paper if

More information

Teaching London Computing

Teaching London Computing Teaching London Computing CAS London CPD Day 2016 Little Man Computer William Marsh School of Electronic Engineering and Computer Science Queen Mary University of London Overview and Aims LMC is a computer

More information

William Stallings Computer Organization and Architecture 8 th Edition. Chapter 11 Instruction Sets: Addressing Modes and Formats

William Stallings Computer Organization and Architecture 8 th Edition. Chapter 11 Instruction Sets: Addressing Modes and Formats William Stallings Computer Organization and Architecture 8 th Edition Chapter 11 Instruction Sets: Addressing Modes and Formats Addressing Modes Immediate Direct Indirect Register Register Indirect Displacement

More information

Show how to connect three Full Adders to implement a 3-bit ripple-carry adder

Show how to connect three Full Adders to implement a 3-bit ripple-carry adder Show how to connect three Full Adders to implement a 3-bit ripple-carry adder 1 Reg. A Reg. B Reg. Sum 2 Chapter 5 Computing Components Yet another layer of abstraction! Components Circuits Gates Transistors

More information

CS 31: Intro to Systems Digital Logic. Kevin Webb Swarthmore College February 3, 2015

CS 31: Intro to Systems Digital Logic. Kevin Webb Swarthmore College February 3, 2015 CS 31: Intro to Systems Digital Logic Kevin Webb Swarthmore College February 3, 2015 Reading Quiz Today Hardware basics Machine memory models Digital signals Logic gates Circuits: Borrow some paper if

More information

Introduction to MiniSim A Simple von Neumann Machine

Introduction to MiniSim A Simple von Neumann Machine Math 121: Introduction to Computing Handout #19 Introduction to MiniSim A Simple von Neumann Machine Programming languages like C, C++, Java, or even Karel are called high-level languages because they

More information

Tutorial for Chapter 3, 4

Tutorial for Chapter 3, 4 Eastern Mediterranean University School of Computing and Technology ITEC2 Computer Organization & Architecture Tutorial for Chapter 3, 4 Number Systems Binary Number Systems o Base = 2 o A single bit can

More information

COSC121: Computer Systems: Review

COSC121: Computer Systems: Review COSC121: Computer Systems: Review Jeremy Bolton, PhD Assistant Teaching Professor Constructed using materials: - Patt and Patel Introduction to Computing Systems (2nd) - Patterson and Hennessy Computer

More information

Laboratory. Low-Level. Languages. Objective. References. Study simple machine language and assembly language programs.

Laboratory. Low-Level. Languages. Objective. References. Study simple machine language and assembly language programs. Laboratory Low-Level 7 Languages Objective Study simple machine language and assembly language programs. References Software needed: 1) A web browser (Internet Explorer or Netscape) 2) Applet from the

More information

Copyright 2000 N. AYDIN. All rights reserved. 1

Copyright 2000 N. AYDIN. All rights reserved. 1 Computer Architecture Prof. Dr. Nizamettin AYDIN naydin@yildiz.edu.tr http://www.yildiz.edu.tr/~naydin A virtual processor for understanding instruction cycle The Visible Virtual Machine (VVM) 1 2 The

More information

Dec Hex Bin ORG ; ZERO. Introduction To Computing

Dec Hex Bin ORG ; ZERO. Introduction To Computing Dec Hex Bin 0 0 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

QUIZ: Generations of computer technology. Hardware:

QUIZ: Generations of computer technology. Hardware: QUIZ: Generations of computer technology Hardware: 1. 2. 3. 4. 5. 1 QUIZ: Generations of computer technology Software: 1. 2. 3. 4. 5. 6. 2 Chapter 2 Binary Values and Number Systems Numbers Natural numbers,

More information

csitnepal Unit 3 Basic Computer Organization and Design

csitnepal Unit 3 Basic Computer Organization and Design Unit 3 Basic Computer Organization and Design Introduction We introduce here a basic computer whose operation can be specified by the resister transfer statements. Internal organization of the computer

More information

EE 5340/7340 Motorola 68HC11 Microcontroler Lecture 1. Carlos E. Davila, Electrical Engineering Dept. Southern Methodist University

EE 5340/7340 Motorola 68HC11 Microcontroler Lecture 1. Carlos E. Davila, Electrical Engineering Dept. Southern Methodist University EE 5340/7340 Motorola 68HC11 Microcontroler Lecture 1 Carlos E. Davila, Electrical Engineering Dept. Southern Methodist University What is Assembly Language? Assembly language is a programming language

More information

EE 3170 Microcontroller Applications

EE 3170 Microcontroller Applications EE 3170 Microcontroller Applications Lecture 4 : Processors, Computers, and Controllers - 1.2 (reading assignment), 1.3-1.5 Based on slides for ECE3170 by Profs. Kieckhafer, Davis, Tan, and Cischke Outline

More information

Advanced Parallel Architecture Lesson 3. Annalisa Massini /2015

Advanced Parallel Architecture Lesson 3. Annalisa Massini /2015 Advanced Parallel Architecture Lesson 3 Annalisa Massini - Von Neumann Architecture 2 Two lessons Summary of the traditional computer architecture Von Neumann architecture http://williamstallings.com/coa/coa7e.html

More information

2.2 THE MARIE Instruction Set Architecture

2.2 THE MARIE Instruction Set Architecture 2.2 THE MARIE Instruction Set Architecture MARIE has a very simple, yet powerful, instruction set. The instruction set architecture (ISA) of a machine specifies the instructions that the computer can perform

More information

16.1. Unit 16. Computer Organization Design of a Simple Processor

16.1. Unit 16. Computer Organization Design of a Simple Processor 6. Unit 6 Computer Organization Design of a Simple Processor HW SW 6.2 You Can Do That Cloud & Distributed Computing (CyberPhysical, Databases, Data Mining,etc.) Applications (AI, Robotics, Graphics, Mobile)

More information

User. Application program. Interfaces. Operating system. Hardware

User. Application program. Interfaces. Operating system. Hardware Operating Systems Introduction to Operating Systems and Computer Hardware Introduction and Overview The operating system is a set of system software routines that interface between an application program

More information

Monday, March 9, 2015

Monday, March 9, 2015 Monday, March 9, 2015 Topics for today C functions and Pep/8 subroutines Passing parameters by reference Globals Locals More reverse engineering: Pep/8 to C Representation of Booleans C Functions and Pep/8

More information

Wednesday, April 22, 2015

Wednesday, April 22, 2015 Wednesday, April 22, 2015 Topics for today Topics for Exam 3 Process management (Chapter 8) Loader Traps Interrupts, Time-sharing Storage management (Chapter 9) Main memory (1) Uniprogramming (2) Fixed-partition

More information

2. Computer Evolution and Performance

2. Computer Evolution and Performance 2. Computer Evolution and Performance Spring 2016 Spring 2016 CS430 - Computer Architecture 1 Chapter 2: Computer Evolution and Performance Reading: pp. 16-49 Good Problems to Work: 2.1, 2.3, 2.4, 2.8,

More information

The LC3's micro-coded controller ("useq") is nothing more than a finite-state machine (FSM). It has these inputs:

The LC3's micro-coded controller (useq) is nothing more than a finite-state machine (FSM). It has these inputs: midterm exam COSC-120, Computer Hardware Fundamentals, fall 2012 Computer Science Department Georgetown University NAME Open books, open notes (laptops included). Show and explain all your work. Answers

More information

Monday, October 17, 2016

Monday, October 17, 2016 Monday, October 17, 2016 Topics for today C functions and Pep/8 subroutines Passing parameters by reference Globals Locals Reverse Engineering II Representation of Booleans C Functions and Pep/8 Subroutines

More information

ORG ; TWO. Assembly Language Programming

ORG ; TWO. Assembly Language Programming Dec 2 Hex 2 Bin 00000010 ORG ; TWO Assembly Language Programming OBJECTIVES this chapter enables the student to: Explain the difference between Assembly language instructions and pseudo-instructions. Identify

More information

1 Little Man Computer

1 Little Man Computer 1 Little Man Computer Session 5 Reference Notes CPU Architecture and Assembly 1.1 Versions Little Man Computer is a widely used simulator of a (very simple) computer. There are a number of implementations.

More information

the SAP-2 I. Intro cmpt-150-arc Sections 8-8, 8-9, 9-4, 9-5, 9.6, We ll do this in bits and pieces, doing the beginning of each section first.

the SAP-2 I. Intro cmpt-150-arc Sections 8-8, 8-9, 9-4, 9-5, 9.6, We ll do this in bits and pieces, doing the beginning of each section first. I. Intro the SAP-2 cmpt-150-arc Sections 8-8, 8-9, 9-4, 9-5, 9.6, 9.8 1. We ll do this in bits and pieces, doing the beginning of each section first. 1. The SAP-2 adds a lot of functionality to the SAP-1

More information

Assembly Language for Intel-Based Computers, 4 th Edition. Chapter 1: Basic Concepts. Chapter Overview. Welcome to Assembly Language

Assembly Language for Intel-Based Computers, 4 th Edition. Chapter 1: Basic Concepts. Chapter Overview. Welcome to Assembly Language Assembly Language for Intel-Based Computers, 4 th Edition Kip R. Irvine Chapter 1: Basic Concepts Slides prepared by Kip R. Irvine Revision date: 09/15/2002 Chapter corrections (Web) Printing a slide show

More information

Wednesday, April 19, 2017

Wednesday, April 19, 2017 Wednesday, April 19, 2017 Topics for today Process management (Chapter 8) Loader Traps Interrupts, Time-sharing Storage management (Chapter 9) Main memory (1) Uniprogramming (2) Fixed-partition multiprogramming

More information

Wednesday, September 27, 2017

Wednesday, September 27, 2017 Wednesday, September 27, 2017 Topics for today Chapter 6: Mapping High-level to assembly-level The Pep/9 run-time stack (6.1) Stack-relative addressing (,s) SP manipulation Stack as scratch space Global

More information

Microcontroller Systems

Microcontroller Systems µcontroller systems 1 / 43 Microcontroller Systems Engineering Science 2nd year A2 Lectures Prof David Murray david.murray@eng.ox.ac.uk www.robots.ox.ac.uk/ dwm/courses/2co Michaelmas 2014 µcontroller

More information

Monday, March 13, 2017

Monday, March 13, 2017 Monday, March 13, 2017 Topics for today Arrays and Indexed Addressing Global arrays Local arrays Buffer exploit attacks Arrays and indexed addressing (section 6.4) So far we have looked at scalars (int,

More information

A rubric for programming assignments

A rubric for programming assignments Fall 2012 Comp 162 Peter Smith A rubric for programming assignments Generally, half the points for a program assignment are for the Correctness of the program with respect to the specification. The other

More information

Module 5 - CPU Design

Module 5 - CPU Design Module 5 - CPU Design Lecture 1 - Introduction to CPU The operation or task that must perform by CPU is: Fetch Instruction: The CPU reads an instruction from memory. Interpret Instruction: The instruction

More information

CSCI170 Lecture 1: Analysis of Programming Languages. John Magee 1 September 2011 Some material copyright Jones and Bartlett

CSCI170 Lecture 1: Analysis of Programming Languages. John Magee 1 September 2011 Some material copyright Jones and Bartlett CSCI170 Lecture 1: Analysis of Programming Languages John Magee 1 September 2011 Some material copyright Jones and Bartlett 1 Overview/Questions How can we control the computer s circuits? How does the

More information

Show how to connect three Full Adders to implement a 3-bit ripple-carry adder

Show how to connect three Full Adders to implement a 3-bit ripple-carry adder Show how to connect three Full Adders to implement a 3-bit ripple-carry adder 1 Reg. A Reg. B Reg. Sum 2 Chapter 5 Computing Components Yet another layer of abstraction! Components Circuits Gates Transistors

More information

Project 3: RPN Calculator

Project 3: RPN Calculator ECE267 @ UIC, Spring 2012, Wenjing Rao Project 3: RPN Calculator What to do: Ask the user to input a string of expression in RPN form (+ - * / ), use a stack to evaluate the result and display the result

More information

COMPUTER ORGANIZATION & ARCHITECTURE

COMPUTER ORGANIZATION & ARCHITECTURE COMPUTER ORGANIZATION & ARCHITECTURE Instructions Sets Architecture Lesson 5a 1 What are Instruction Sets The complete collection of instructions that are understood by a CPU Can be considered as a functional

More information

EE 3170 Microcontroller Applications

EE 3170 Microcontroller Applications Lecture Overview EE 3170 Microcontroller Applications Lecture 7 : Instruction Subset & Machine Language: Conditions & Branches in Motorola 68HC11 - Miller 2.2 & 2.3 & 2.4 Based on slides for ECE3170 by

More information

Final Labs and Tutors

Final Labs and Tutors ICT106 Fundamentals of Computer Systems - Topic 2 REPRESENTATION AND STORAGE OF INFORMATION Reading: Linux Assembly Programming Language, Ch 2.4-2.9 and 3.6-3.8 Final Labs and Tutors Venue and time South

More information

COSC121: Computer Systems: Review

COSC121: Computer Systems: Review COSC121: Computer Systems: Review Jeremy Bolton, PhD Assistant Teaching Professor Constructed using materials: - Patt and Patel Introduction to Computing Systems (2nd) - Patterson and Hennessy Computer

More information

5-1 Instruction Codes

5-1 Instruction Codes Chapter 5: Lo ai Tawalbeh Basic Computer Organization and Design 5-1 Instruction Codes The Internal organization of a digital system is defined by the sequence of microoperations it performs on data stored

More information

2. MACHINE REPRESENTATION OF TYPICAL ARITHMETIC DATA FORMATS (NATURAL AND INTEGER NUMBERS).

2. MACHINE REPRESENTATION OF TYPICAL ARITHMETIC DATA FORMATS (NATURAL AND INTEGER NUMBERS). 2. MACHINE REPRESENTATION OF TYPICAL ARITHMETIC DATA FORMATS (NATURAL AND INTEGER NUMBERS). 2.. Natural Binary Code (NBC). The positional code with base 2 (B=2), introduced in Exercise, is used to encode

More information

Computer Organization CS 206 T Lec# 2: Instruction Sets

Computer Organization CS 206 T Lec# 2: Instruction Sets Computer Organization CS 206 T Lec# 2: Instruction Sets Topics What is an instruction set Elements of instruction Instruction Format Instruction types Types of operations Types of operand Addressing mode

More information

CMPS 10 Introduction to Computer Science Lecture Notes

CMPS 10 Introduction to Computer Science Lecture Notes CMPS Introduction to Computer Science Lecture Notes Binary Numbers Until now we have considered the Computing Agent that executes algorithms to be an abstract entity. Now we will be concerned with techniques

More information

Chapter 2. Binary Values and Number Systems

Chapter 2. Binary Values and Number Systems Chapter 2 Binary Values and Number Systems Numbers Natural numbers, a.k.a. positive integers Zero and any number obtained by repeatedly adding one to it. Examples: 100, 0, 45645, 32 Negative numbers A

More information

Chapter 4. MARIE: An Introduction to a Simple Computer. Chapter 4 Objectives. 4.1 Introduction. 4.2 CPU Basics

Chapter 4. MARIE: An Introduction to a Simple Computer. Chapter 4 Objectives. 4.1 Introduction. 4.2 CPU Basics Chapter 4 Objectives Learn the components common to every modern computer system. Chapter 4 MARIE: An Introduction to a Simple Computer Be able to explain how each component contributes to program execution.

More information

Chapter 6 Programming the LC-3

Chapter 6 Programming the LC-3 Chapter 6 Programming the LC-3 Based on slides McGraw-Hill Additional material 4/5 Lewis/Martin Aside: Booting the Computer How does it all begin? We have LC-3 hardware and a program, but what next? Initial

More information

Computer architecture Assignment 3

Computer architecture Assignment 3 Computer architecture Assignment 3 1- An instruction at address 14E in the basic computer has I=0, an operation code of the AND instruction, and an address part equal to 109(all numbers are in hexadecimal).

More information

Tailoring the 32-Bit ALU to MIPS

Tailoring the 32-Bit ALU to MIPS Tailoring the 32-Bit ALU to MIPS MIPS ALU extensions Overflow detection: Carry into MSB XOR Carry out of MSB Branch instructions Shift instructions Slt instruction Immediate instructions ALU performance

More information

Why learn Computer Programming? Computer-based problem solving in Science and Engineering. Why learn Fortran? Elementary Computer Organization

Why learn Computer Programming? Computer-based problem solving in Science and Engineering. Why learn Fortran? Elementary Computer Organization CSE 1540.03 Week #1.1 January 6, 2014 Computer-based problem solving in Science and Engineering Pure math: about beautiful relationships, e.g. partial differential equations Applied math: pure math applied

More information

Lecture 5 Assembly Programming: Arithmetic

Lecture 5 Assembly Programming: Arithmetic CPE 390: Microprocessor Systems Spring 2018 Lecture 5 Assembly Programming: Arithmetic Bryan Ackland Department of Electrical and Computer Engineering Stevens Institute of Technology Hoboken, NJ 07030

More information

von Neumann Architecture Basic Computer System Early Computers Microprocessor Reading Assignment An Introduction to Computer Architecture

von Neumann Architecture Basic Computer System Early Computers Microprocessor Reading Assignment An Introduction to Computer Architecture Reading Assignment EEL 4744C: Microprocessor Applications Lecture 1 Part 1 An Introduction to Computer Architecture Microcontrollers and Microcomputers: Chapter 1, Appendix A, Chapter 2 Software and Hardware

More information

Basic Computer System. von Neumann Architecture. Reading Assignment. An Introduction to Computer Architecture. EEL 4744C: Microprocessor Applications

Basic Computer System. von Neumann Architecture. Reading Assignment. An Introduction to Computer Architecture. EEL 4744C: Microprocessor Applications Reading Assignment EEL 4744C: Microprocessor Applications Lecture 1 Part 1 An Introduction to Computer Architecture Microcontrollers and Microcomputers: Chapter 1, Appendix A, Chapter 2 Software and Hardware

More information

QUIZ: What is the output of this MATLAB code? >> A = [2,4,10,13;16,3,7,18; 8,4,9,25;3,12,15,17]; >> length(a) >> size(a) >> B = A(2:3, 1:3) >> B(5)

QUIZ: What is the output of this MATLAB code? >> A = [2,4,10,13;16,3,7,18; 8,4,9,25;3,12,15,17]; >> length(a) >> size(a) >> B = A(2:3, 1:3) >> B(5) QUIZ: What is the output of this MATLAB code? >> A = [2,4,10,13;16,3,7,18; 8,4,9,25;3,12,15,17]; >> length(a) >> size(a) >> B = A(2:3, 1:3) >> B(5) QUIZ Ch.3 Introduction to MATLAB programming 3.1 Algorithms

More information

Von Neumann Architecture

Von Neumann Architecture Von Neumann Architecture Assist lecturer Donya A. Khalid Lecture 2 2/29/27 Computer Organization Introduction In 945, just after the World War, Jon Von Neumann proposed to build a more flexible computer.

More information

Chapter. Computer Architecture

Chapter. Computer Architecture Chapter 4 Computer Architecture Figure 4.1 Input device Central processing unit Main memory Output device Bus Data flow Control Figure 4.2 Central processing unit () Status bits ( ) Accumulator ( ) Index

More information

UNIT 1 REFERENCE 1 PREPARED BY S.RAVINDRAKUMAR, LECT/ECE, CHETTINAD COLLEGE OF ENGG AND TECH, KARUR

UNIT 1 REFERENCE 1 PREPARED BY S.RAVINDRAKUMAR, LECT/ECE, CHETTINAD COLLEGE OF ENGG AND TECH, KARUR UNIT 1 REFERENCE 1 PROGRAMMING THE 8085 DEVELOPMENT OF PROGRAM A program is a sequence of instructions written to tell a computer to perform a specific function. The instructions are selected from the

More information

Wednesday, September 20, 2017

Wednesday, September 20, 2017 Wednesday, September 20, 2017 Topics for today More high-level to Pep/9 translations Compilers and Assemblers How assemblers work Symbol tables ILC Pass 1 algorithm, Error checking Pass 2 Immediate mode

More information

Unit 1. Digital Representation

Unit 1. Digital Representation 1 Unit 1 Digital Representation 2 Information Representation All information is represented as sequences of 1's and 0's 5 kinds of information Numbers Text Instructions Sound Image/Video 3 Why 1 s and

More information

CHAPTER SIX BASIC COMPUTER ORGANIZATION AND DESIGN

CHAPTER SIX BASIC COMPUTER ORGANIZATION AND DESIGN CHAPTER SIX BASIC COMPUTER ORGANIZATION AND DESIGN 6.1. Instruction Codes The organization of a digital computer defined by: 1. The set of registers it contains and their function. 2. The set of instructions

More information

CS 265. Computer Architecture. Wei Lu, Ph.D., P.Eng.

CS 265. Computer Architecture. Wei Lu, Ph.D., P.Eng. CS 265 Computer Architecture Wei Lu, Ph.D., P.Eng. CS 265 Midterm #1 Monday, Oct 18, 12:00pm-1:45pm, SCI 163 Questions on essential terms and concepts of Computer Architecture Mathematical questions on

More information

Week 6: Processor Components

Week 6: Processor Components Week 6: Processor Components Microprocessors So far, we ve been about making devices, such such as adders, counters and registers. The ultimate goal is to make a microprocessor, which is a digital device

More information

Unit II Basic Computer Organization

Unit II Basic Computer Organization 1. Define the term. Internal Organization-The internal organization of a digital system is defined by the sequence of microoperations it performs on data stored in its registers. Program- A program is

More information

Monday, March 6, We have seen how to translate void functions. What about functions that return a value such as

Monday, March 6, We have seen how to translate void functions. What about functions that return a value such as Monday, March 6, 2017 Topics for today C functions and Pep/9 subroutines Translating functions (c) Non-void functions (d) Recursive functions Reverse Engineering: Pep/9 to C C Functions and Pep/9 Subroutines

More information

Blog -

Blog - . Instruction Codes Every different processor type has its own design (different registers, buses, microoperations, machine instructions, etc) Modern processor is a very complex device It contains Many

More information

5. The result of dividing the 8 bit value by the 8 bit value is:

5. The result of dividing the 8 bit value by the 8 bit value is: 1. The first generation of electronic computers in the 1950's used memory technology based on a. large scale integrated circuits b. medium scale integrated circuits c. transistors d. vacuum tubes e. toroidal

More information

The MARIE Architecture

The MARIE Architecture The MARIE Machine Architecture that is Really Intuitive and Easy. We now define the ISA (Instruction Set Architecture) of the MARIE. This forms the functional specifications for the CPU. Basic specifications

More information

Processor design - MIPS

Processor design - MIPS EASY Processor design - MIPS Q.1 What happens when a register is loaded? 1. The bits of the register are set to all ones. 2. The bit pattern in the register is copied to a location in memory. 3. A bit

More information

Memory General R0 Registers R1 R2. Input Register 1. Input Register 2. Program Counter. Instruction Register

Memory General R0 Registers R1 R2. Input Register 1. Input Register 2. Program Counter. Instruction Register CPU Organisation Central Processing Unit (CPU) Memory General R0 Registers R1 R2 ALU R3 Output Register Input Register 1 Input Register 2 Internal Bus Address Bus Data Bus Addr. $ 000 001 002 Program Counter

More information

2010 Summer Answers [OS I]

2010 Summer Answers [OS I] CS2503 A-Z Accumulator o Register where CPU stores intermediate arithmetic results. o Speeds up process by not having to store these results in main memory. Addition o Carried out by the ALU. o ADD AX,

More information

CSCI 1100L: Topics in Computing Lab Lab 11: Programming with Scratch

CSCI 1100L: Topics in Computing Lab Lab 11: Programming with Scratch CSCI 1100L: Topics in Computing Lab Lab 11: Programming with Scratch Purpose: We will take a look at programming this week using a language called Scratch. Scratch is a programming language that was developed

More information

Computer System. Hiroaki Kobayashi 7/25/2011. Agenda. Von Neumann Model Stored-program instructions and data are stored on memory

Computer System. Hiroaki Kobayashi 7/25/2011. Agenda. Von Neumann Model Stored-program instructions and data are stored on memory Computer System Hiroaki Kobayashi 7/25/2011 7/25/2011 Computer Engineering 1 Agenda Basic model of modern computer systems Von Neumann Model Stored-program instructions and data are stored on memory Fundamental

More information

In this lecture, we will look at how storage (or memory) works with processor in a computer system. This is in preparation for the next lecture, in

In this lecture, we will look at how storage (or memory) works with processor in a computer system. This is in preparation for the next lecture, in In this lecture, we will look at how storage (or memory) works with processor in a computer system. This is in preparation for the next lecture, in which we will examine how a microprocessor actually works

More information

Switching to AQA from OCR

Switching to AQA from OCR Switching to AQA from OCR This resource compares our new GCSE Computer Science specification (8520) with the new OCR Computer Science specification (J276). If you are thinking of switching from OCR to

More information