A B C ((NOT A) AND B) OR C

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

Designing Computers. The Von Neumann Architecture. The Von Neumann Architecture. The Von Neumann Architecture

The Von Neumann Architecture. Designing Computers. The Von Neumann Architecture. CMPUT101 Introduction to Computing - Spring 2001

CMPUT101 Introduction to Computing - Summer 2002

CMPUT101 Introduction to Computing - Summer 2002

The Von Neumann Architecture Odds and Ends. Designing Computers. The Von Neumann Architecture. CMPUT101 Introduction to Computing - Spring 2001

COMPUTER SYSTEM. COMPUTER SYSTEM IB DP Computer science Standard Level ICS3U. COMPUTER SYSTEM IB DP Computer science Standard Level ICS3U

Computer Architecture (part 2)

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

CMPUT 101 with Solutions Quiz 2 (50 minutes) November 16, 2000

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

Von Neumann Architecture

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

CMPUT 101 with Solutions Quiz 2 (50 minutes) August 7, 2002

Chapter 5: Computer Systems Organization

Chapter 5: Computer Systems Organization. Invitation to Computer Science, C++ Version, Third Edition

Computer Architecture COMP360

ASSEMBLY LANGUAGE MACHINE ORGANIZATION

Outcomes. Lecture 13 - Introduction to the Central Processing Unit (CPU) Central Processing UNIT (CPU) or Processor

CMPUT 101 with Solutions Quiz 2 (50 minutes) November 7, 2003

1. Fundamental Concepts

William Stallings Computer Organization and Architecture

20/08/14. Computer Systems 1. Instruction Processing: FETCH. Instruction Processing: DECODE

Chapter 02: Computer Organization. Lesson 02: Functional units and components in a computer organization- Part 1: Processor

Lecture1: introduction. Outline: History overview Central processing unite Register set Special purpose address registers Datapath Control unit

Birkbeck (University of London) Department of Computer Science and Information Systems. Introduction to Computer Systems (BUCI008H4)

Computer Architecture

11/22/1999 7pm - 9pm. Name: Login Name: Preceptor Name: Precept Number:

Recitation Session 6

Computer Logic II CCE 2010

AS/A Level Computing Syllabus 2011

Class Notes. Dr.C.N.Zhang. Department of Computer Science. University of Regina. Regina, SK, Canada, S4S 0A2

6.1 Combinational Circuits. George Boole ( ) Claude Shannon ( )

VON NEUMANN ARCHITECTURE. VON NEUMANN ARCHITECTURE IB DP Computer science Standard Level ICS3U

SCRAM Introduction. Philipp Koehn. 19 February 2018

Unit 8 - Week 7: Organization and Optimization of Micro-programmed Controlled Control Unit

SECONDARY SCHOOL, L-IMRIEĦEL HALF YEARLY EXAMINATIONS 2016/2017

Computing Layers. Chapter 5 The LC-3

Conditions, logical expressions, and selection. Introduction to control structures

Computer Architecture Review CS 595

CSE 2021 COMPUTER ORGANIZATION

Reference Sheet for C112 Hardware

Basic Processing Unit: Some Fundamental Concepts, Execution of a. Complete Instruction, Multiple Bus Organization, Hard-wired Control,

Birkbeck (University of London) Department of Computer Science and Information Systems. Introduction to Computer Systems (BUCI008H4)

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

ECE 341 Midterm Exam

LECTURE 4. Logic Design

Faculty of Engineering Systems & Biomedical Dept. First Year Cairo University Sheet 6 Computer I

CC312: Computer Organization

Computer Systems. Binary Representation. Binary Representation. Logical Computation: Boolean Algebra

Introduction to Computer Science. Homework 1

Chapter 5 The LC-3. ACKNOWLEDGEMENT: This lecture uses slides prepared by Gregory T. Byrd, North Carolina State University 5-2

Chapter 4. The Processor. Instruction count Determined by ISA and compiler. We will examine two MIPS implementations

Chapter 5: The Processor: Datapath and Control

Introduction to Control Structures

REGISTER TRANSFER AND MICROOPERATIONS

CSE 2021 COMPUTER ORGANIZATION

Introduction to Computer Engineering. CS/ECE 252, Fall 2016 Prof. Guri Sohi Computer Sciences Department University of Wisconsin Madison

Module 5 - CPU Design

EEL 5722C Field-Programmable Gate Array Design

GCSE DIGITAL TECHNOLOGY

Basic Computer Architecture

Introduction to Computer Engineering. Chapter 5 The LC-3. Instruction Set Architecture

Computer Organization II CMSC 3833 Lecture 33

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

Topic #6. Processor Design

COSC 243. Computer Architecture 1. COSC 243 (Computer Architecture) Lecture 6 - Computer Architecture 1 1

Processor design - MIPS

Information Science 1

Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Computing Layers

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

Introduction to CPU architecture using the M6800 microprocessor

Learning objectives. Computer principles The characteristics of contemporary processors, input, output and storage devices

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

Design of Decode, Control and Associated Datapath Units

Computer Architecture Lecture No.10,11

Lecture 11: Control Unit and Instruction Encoding

A Review of Chapter 5 and. CSc 2010 Spring 2012 Instructor: Qian Hu

Arrays: Higher Dimensional Arrays. CS0007: Introduction to Computer Programming

COSC121: Computer Systems: Review

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

Operators & Expressions

ASSIGNMENT ECE514 (COMPUTER ORGANIZATION) ASSIGNMENT NO. 3

CPSC 121: Models of Computation

CPU. Fall 2003 CSE 207 Digital Design Project #4 R0 R1 R2 R3 R4 R5 R6 R7 PC STATUS IR. Control Logic RAM MAR MDR. Internal Processor Bus

Lecture 3 (02/06, 02/08): Condition Statements Decision, Operations & Information Technologies Robert H. Smith School of Business Spring, 2017

SISTEMI EMBEDDED. Basic Concepts about Computers. Federico Baronti Last version:

Computer Science /21/2000

Sample Exam I PAC II ANSWERS

Chapter 4. The Processor

Processing Unit CS206T

Computer Organization

CPE 335. Basic MIPS Architecture Part II

Control Structures. Lecture 4 COP 3014 Fall September 18, 2017

The Stored Program Computer

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

Chapter 4 The Von Neumann Model

COMP2121: Microprocessors and Interfacing. Instruction Set Architecture (ISA)

CS1004: Intro to CS in Java, Spring 2005

BASIC COMPUTER ORGANIZATION. Operating System Concepts 8 th Edition

Transcription:

chapter5 pg 184 1,2,6 1 Assuming that x=1 and y=2, determine the value of each of the following Boolean expressing: (x=1) AND(y=3) (x<y) OR (x>1) Not[(x=1) AND (y=2)] Answer: False True False 2 Assume that A, B and C are Boolean variables that can take on the values true and false Create a truth table to show all the possible values for the Boolean expression: ((NOT A) AND B) OR C Input Output A B C ((NOT A) AND B) OR C True True True True True True False False True False True True True False False False False True True True False True False True False False True True False False False False 6 For what values of A and B will the value of the following Boolean expression be false? (A OR B) OR (NOT A) Answer: None Because: Input Output A B (A OR B) OR (NOT A) True True True True False True False True True False False True

chapter5 pgs 270 6, 7, 8, 21, 23, 24 6 The maximum size of the memory unit on this machine is 2 24 The dimensions of the twodimensional memory are 2 12 2 12 or 4096 4096 7 One could store 4 MB of memory using a 20 bit MAR by thinking of our 4 MB memory as being composed of four separate 1 MB units Then if we had a separate 2-bit register that specified which of the four units we were accessing, we could use the 20 bit MAR to access into that one particular memory unit In a sense, the new 2-bit register could be thought of as the two high-order bits of a 22-bit MAR 8 We would have to make two fetches to get the complete instruction Alternately, we might fetch only the first 16 bits, which could be the operation code, and then decode that part of the instruction Then, during the execution phase, we might go back to memory to fetch the last 16 bits, which could be the address of the operand on which we are going 21 For reference: v-200 w -201 x - 202 y -203 z-204 a set v to x - y + z (assume command SUBTRACT X,Y,Z exists which is z = x - y) 50 SUBTRACT 202, 203, 200 v now has the value x - y 51 ADD 200, 204, 200 v now has the value x y + z b set v to value of (w + x) - (y + z) 50 ADD 201, 202, 200 v now has the value w + x 51 ADD 203, 204, 201 w now has the value y + z 52 SUBTRACT 200, 201, 200 v now has the value (w + x) c if (v w) then else set x to y (y + z)

set x to z 50 COMPARE 200, 201 Compare v and w and set condition codes 51 JUMPGE 54 If v w go to address 54 52 MOVE 204, 202 Otherwise give x the value of z 53 JUMP 55 Go to address 55 54 MOVE 203, 202 Give x the value of y 55 The next instruction begins here d while y < z do set y to value (y + w + z) set z to value (z + v) end of loop 23 The error is on the second line The instruction ADD 19 does not add the integer 19 to the value of y but, instead, the contents of memory cell 19 To correct this error you would need to store the constant +19 into a memory cell, say location 600, and then write the instruction ADD 600 25 ADD X, v, Y 1 IRaddr1 MAR Send address of X, currently in IRaddr1, to the MAR 2 FETCH Fetch the contents of cell X and put in the MDR 3 MDR ALU Send contents of MDR to the ALU 4 IR addr2 ALU Send the second address field directly into the ALU without fetching since it is a constant, not an address 5 ADD Activate ALU and select output of add circuit; the ALU now holds CON(X)+v 6 IR addr3 MAR Send address of Y, currently in IRaddr3, to the MAR 7 FETCH Fetch the contents of cell Y and put in the MDR 8 MDR ALU Send contents of MDR to the ALU

9 ADD Activate ALU and select output of add circuit, which is (CON(x)+v) + CON(Y) 10 ALU MDR Copy output of the ALU to the MDR 11 STORE Store the value in the MDR into memory cell Y, whose address is still in the MAR chapter 5 pg 272 challenge work Q1 1 With 100 processors, one can perform up to 100 addition operations at each step One possible algorithm will use up to 50 processors simultaneously In the while loop: instead of While i < 101 do the following Sum = Sum + ai, one could perform 50 operations simultaneously (sum1 = a1 + a2 sum2 = a3 + a4 sum3 = a5 + a6 sum50 = a99 + a100) resulting in 50 new sums On iteration 2, one could perform 25 operations simultaneously (secondsum1=sum1+sum2 secondsum2=sum3+sum4 secondsum25=sum49+sum50) resulting in 25 new sums Iteration 3 adds 12 pairs giving 12 new sums plus 1 remaining from the previous level Iteration 4 adds 6 pairs giving 6 new sums plus 1 remaining from the previous level Iteration 5 adds 3 pairs giving 3 new sums plus 1 remaining from the previous level

Iteration 6 adds 2 pairs giving 2 new sums Iteration 7 adds 1 pair, giving the final result Instead of 100 iterations, 7 iterations will be needed, which means the algorithm with the parallel processing is over 14 times faster This is logarithmic time instead of the linear time required to do the job sequentially No more than 50 processors were needed and any more than 50 processors would be too many for this specific problem